Joshua Brown, 40, was in the Tesla Model S car when it collided with a tractor trailer earlier this month in

A former Navy SEAL has become the first person to die at the wheel of a self-driving car - and a witness has claimed he was watching a Harry Potter movie when his Tesla collided with a truck while on autopilot.

Joshua Brown, 40, died after his computer-guided Tesla Model S plowed into a tractor trailer on a freeway in Williston, Florida, in May.

Despite the claim, Tesla says it is not possible to play films on the vehicle's touchscreen - however it is possible Brown was using another device.

The driver of the truck, Frank Baressi, said the Tesla driver was 'playing Harry Potter on the TV screen' at the time of the crash.

'It was still playing when he died and snapped a telephone pole a quarter mile down the road,' Baressi, 62, said.

'He went so fast through my trailer I didn't see him,' he added.

Baressi says he only heard the movie in the aftermath of the crash - and police did not mention the driver being distracted by a film in any of their reports.

Tesla said its autopilot system failed to detect the truck because its white color was similar to that of the bright sky, adding that the driver also made no attempt to hit the brakes.

The U.S. National Highway Traffic Safety Administration (NHTSA) is investigating.

Preliminary reports suggest Baressi's truck left in front of Brown's Tesla at an intersection of a divided highway where there was no traffic light, officials said.

By the time firefighters arrived, the wreckage of the Tesla - with its roof sheared off completely - had come to rest in a nearby yard hundreds of feet from the crash site, assistant chief Danny Wallace of the Williston Fire Department said.

It has also emerged that Brown - who served in the Navy for 11 years - narrowly avoided a very similar smash earlier this year, when his car did not notice a white truck turning in on him on the freeway.

The driver of the truck, Frank Baressi, said the Tesla driver was 'playing Harry Potter on the TV screen' at the time of the crash. Tesla said it is impossible to play movies on its screens (file picture)

Billionaire chief executive of Tesla Motors Elon Musk tweeted his condolences following Brown's death

Tesla confirmed the man's 'tragic' death, but defended its vehicles, saying they were safer than other cars.

'This is the first known fatality in just over 130 million miles where Autopilot was activated. Among all vehicles in the US, there is a fatality every 94 million miles,' the company said in a statement.

It said neither the driver nor the car hit the brakes as the trailer passed over the Tesla, with the self-driving vehicle colliding with the bottom of the truck.

The company claimed that had the trailer crashed into the front or the rear of the Model S, the driver would have survived.

The statement added that motorists should keep their hands on the wheel and 'be prepared to take over at any time'.

Tesla informed the NHTSA, which has launched an investigation. It has called for 'an examination of the design and performance of any driving aids in use at the time of the crash'.

The agency has not demanded a recall of the vehicles.

Brown died of injuries caused in the crash on May 7.

He was involved in a similar near-miss on April 5 and posted a video of the close call online.

The video shows the Canton, Ohio, resident taking manual control of the Tesla to swerve out of the way of a white truck as it moved in front of him on the freeway.

STEERING, AVOIDING CRASHES & PARKING: TESLA AUTOPILOT'S FUNCTIONS Autosteer: This feature, which is currently in beta, keeps the car in the current lane and engages Traffic-Aware Cruise Control to maintain the car's speed. Tesla requires drivers to remain engaged and aware when Autosteer is enabled and drivers must keep their hands on the steering wheel. Auto Lane Change: When the driver flicks the indicator switch and turn signal, the Model S will move itself to the adjacent lane when safe to do so. Automatic Emergency Steering and Side Collision Warning: Side Collision Warning alerts drivers to objects, such as cars, that are too close to the side of Model S. When the car detects an object close to its side, fluid lines will appear around an image of the Model S image in the instrument panel. Autopark: When driving at low speeds around cities, a 'P' will appear on the instrument panel when the Tesla detects a parking spot. The Autopark guide appears on the touchscreen along with the rear camera display, and, once activated, Autopark will begin to park itself by controlling steering and vehicle speed. The Model S features a forward radar, a forward-looking camera, 12 long-range ultrasonic sensors positioned to sense 16ft around the car in every direction at all speeds, and a high-precision digitally-controlled electric assist braking system. The lane-changing feature is illustrated Advertisement

Brown narrowly avoided a very similar smash earlier this year, when his car did not notice a white truck turning in on him on the freeway. Pictured, the truck cutting him up in April

Tesla said the Model S's autopilot system failed to detect the truck because its white color was similar to that of the bright sky. File picture of a Tesla Model S

Tragic: Tesla said Brown (pictured) - a former Navy SEAL - failed to hit the brakes before the crash on May 7

He said of the incident: 'Once the roads merged, the truck tried to get to the exit ramp on the right and never saw my Tesla. I actually wasn't watching that direction and Tessy (the name of my car) was on duty with autopilot engaged.

'I became aware of the danger when Tessy alerted me with the "immediately take over" warning chime and the car swerving to the right to avoid the side collision.

'You can see where I took over when there's a little bit of blip in the steering. Tessy had already moved to the right to avoid the collision.'

Tesla said its cars come with autopilot disabled and that owners have to acknowledge the system is new when they use it.

'The customer who died in this crash had a loving family and we are beyond saddened by their loss,' Tesla said.

'He was a friend to Tesla... a person who spent his life focused on innovation and the promise of technology and who believed strongly in Tesla’s mission. We would like to extend our deepest sympathies to his family and friends.'

Elon Musk, the billionaire CEO of Tesla Motors, tweeted: 'Our condolences for the tragic loss.'

Mr Musk has been bullish about autopilot, despite Tesla's own warnings that the feature is not for all conditions and not sophisticated enough for the driver to stop concentrating on the road.

He said the the system reduced the probability of having an accident by 50 per cent, without detailing his calculations. In January, he said autopilot is 'probably better than a person right now'.

Shares in Tesla Motors Inc. fell $6.77, or 3.2 per cent, in after-hours trading after news of the crash was released.

Self-driving cars are on the increase as the likes of Tesla and Google explore driverless technology.

A major study released earlier this month said the looming arrival of self-driving vehicles is likely to vastly reduce traffic fatalities, but also poses difficult moral dilemmas.