Closed Bug 1115835 Opened 5 years ago Closed 4 years ago

load event delayed even after media element loadeddata event

Categories

(Core :: Audio/Video, defect, P3)

x86_64
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: karlt, Unassigned)

References

(Blocks 1 open bug, )

Details

STR: Load http://people.mozilla.org/~karlt/mse/mediasource_demo.html?file=mediasource_test.webm&chunks=50&eos_chunk=0&eos_delay=-1&delay_chunk=2000&start=-1

The resource fetch algorithm implies that the load event should no longer be delayed after loadeddata has fired:

"Once the readyState attribute reaches HAVE_CURRENT_DATA, after the loadeddata event has been fired, set the element's delaying-the-load-event flag to false. This stops delaying the load event."
http://www.w3.org/TR/2014/REC-html5-20141028/embedded-content-0.html#concept-media-load-resource

Actual results: load is not fired until additional data is appended after loadeddata:

0: Log: (times in ms)
5: file=mediasource_test.webm
5: chunks=50 (number of chunks to divide the file into)
5: eos_chunk=0 (1..chunks: chunk# at which mediaSource.endOfStream() is called; use 0 for no call)
5: eos_delay=-1 (delay in ms between last appendBuffer and endOfStream, -1 to wait for updateend)
5: delay_chunk=2000 (delay in ms between reading each chunk)
5: start=-1 (start playing time, -1 for none)
7: video.ratechange
9: video.loadstart
11: mediaSource.sourceopen -> mediaSource readyState: open
12: mediaSource.addSourceBuffer('video/webm; codecs="vorbis,vp8"')
39: mediaSource readyState: open
674: URL mediasource_test.webm loaded.
674: chunkSize:4389, totalSize:219448
675: appending chunk:1 size=4389 readyState=open updating=true
675: video.play()
676: sourceBuffer.updatestart
676: video.progress
677: video.play
679: video.waiting
679: sourceBuffer.update
680: sourceBuffer.updateend
680: video.durationchange mediaSource.duration = 6.042
680: video.durationchange mediaSource.duration = 6.042
685: video.loadedmetadata
2677: appending chunk:2 size=4389 readyState=open updating=true
2677: sourceBuffer.updatestart
2678: video.loadeddata
2679: video.progress
2680: sourceBuffer.update
2680: sourceBuffer.updateend
4677: appending chunk:3 size=4389 readyState=open updating=true
4678: sourceBuffer.updatestart
4680: video.progress
4680: sourceBuffer.update
4680: sourceBuffer.updateend
4683: body.load
Bug 975782 comment 8 observed that this behavior began when bug 1065827 landed, but I don't know whether that is due to loadeddata being earlier or load being later.
Priority: -- → P2
Priority: P2 → P3
Looks fix now:
2: Log: (times in ms)
72: file=mediasource_test.webm
73: chunks=50 (number of chunks to divide the file into)
73: eos_chunk=0 (1..chunks: chunk# at which mediaSource.endOfStream() is called; use 0 for no call)
73: eos_delay=-1 (delay in ms between last appendBuffer and endOfStream, -1 to wait for updateend)
74: delay_chunk=2000 (delay in ms between reading each chunk)
74: start=-1 (start playing time, -1 for none)
115: video.ratechange
140: video.loadstart
142: mediaSource.sourceopen -> mediaSource readyState: open
144: mediaSource.addSourceBuffer('video/webm; codecs="vorbis,vp8"')
147: mediaSource readyState: open
1765: URL mediasource_test.webm loaded.
1771: chunkSize:4389, totalSize:219448
1780: appending chunk:1 size=4389 readyState=open updating=true
1780: video.play()
1782: sourceBuffer.updatestart
1786: video.play
1796: video.waiting
1823: video.progress
1827: sourceBuffer.update
1829: sourceBuffer.updateend
1852: video.durationchange mediaSource.duration = 6.042
1853: video.resize
1909: video.loadedmetadata
3789: appending chunk:2 size=4389 readyState=open updating=true
3791: sourceBuffer.updatestart
3805: video.progress
3807: sourceBuffer.update
3808: sourceBuffer.updateend
5797: appending chunk:3 size=4389 readyState=open updating=true
5799: sourceBuffer.updatestart
5845: video.progress
5852: sourceBuffer.update
5854: sourceBuffer.updateend
5962: body.load
6062: video.loadeddata

load is fired right before loadeddata
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.