jPlayer

HTML5 Audio & Video for jQuery

a project by happyworm

Bug Report : Chrome - Fatal Bug

Change currentTime then change SRC.

Chrome version: 9.0.597.98 (Win 7), 9.0.597.102 (OSX 10.6.6)

Official bug report: Issue 74031: Fatal bug when changing media.currentTime then media.src

This page was created to demonstrate a fatal bug in Chrome. The bug occurs if the media.currentTime is changed and then, immediately afterwards, the media.src is changed.

The media used is MP3 (CBR, 44.1kHz, 128kb/s, Joint Stereo) format and will not work on Opera or Firefox, which would require OGG format.

The audio media element was used to demonstrate the problem, however, the same problem occurs when using the video media element.

Audio media demonstrating the problem

Below is an Audio media element that is created through JavaScript. jQuery 1.4.x is used to keep it simple.
The SRC is set to media A and the default browser controls are enabled.

Crash 1: Click here to perform the following actions:
1) Set currentTime to 180.
2) Change the SRC to media B
Crash Condition - Occurs immediately when actions performed.

The following crash examples (#2 and #3) demonstrate how the problem was discovered in the first place.

Crash #2 was found since some browsers did not reset the currentTime to zero at the end of the track. In jPlayer 2 we now detect webkit through a copy of the jQuery 1.4.4 sniffer, which works with Chrome unlike 1.3.2, and then do not perform the currentTime change. It was found to be redundant on webkit anyway. The playlist demo was where the problem was originally found, when the track ended and the media changed.

Crash 2: Click here to create an ended event handler that:
1) Set currentTime to zero
2) Change the SRC to media B
Crash Condition - Wait till the current media ends. (At 03:29)

Crash #3 was also found using our playlist demo. Clicking on the progress bar to change currentTime and then changing the track sometimes crashed Chrome, depending on how fast you were and your bandwidth.

Crash 3: Click here to perform the following actions:
1) Create a progress event handler that:
1.1) Set currentTime to 180.
1.2) Change the SRC to media A
1.3) Remove the progress event handler
2) Change the SRC to media B
Crash Condition - Occurs immediately when actions performed.