Closed Bug 1062733 Opened 8 years ago Closed 8 years ago

Setting currentTime on a video element using a MediaSource fails

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: kinetik, Assigned: kinetik)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached file test_BufferedSeek.html (obsolete) —
While writing a simple seeking test (attached), I discovered that setting currentTime on a non-playing video element using a MediaSource does not work as expected.

Simple steps:
1. Visit flim.org/~kinetik/mediasource.html
   (The left video is standard with id=a, the right is MediaSource with id=x)
2. Open the JS console
3. Enter:
   a.currentTime     (should be 0)
   a.currentTime = 2 (should return 2, the element will seek and update)
   a.currentTime     (should be 2)
4. Enter:
   v.currentTime     (should be 0)
   v.currentTime = 2 (returns 0)
   v.currentTime     (returns 0)
Neither mediasource.html or the attached Mochitest set MediaSource.duration.  The media element clamps seek requests to the ranges reported by GetSeekable.  MediaSourceReader::GetSeekable returns a range of [0, MediaSource.duration].

So this needs bug 896884.
Depends on: 896884
Root cause is bug 1059058.  TrackBuffer::Buffered does not use mCurrentDecoder (only mDecoders), but mDecoders is only populated once the decoder(s) have been initialized.  So TrackBuffer::Buffered does not report ranges for decoders that have not yet completed initialization.
Blocks: 1059058
No longer depends on: 896884
And it's also possible for mCurrentDecoder to be null (if we've called Ended on the SourceBuffer) but for it not to be present in mDecoders yet because it's still initializing.
Assignee: nobody → kinetik
Status: NEW → ASSIGNED
There could be more than one decoder pending initialization, so track
initialized decoders separately from the master list of all decoders managed
by this TrackBuffer.
Attachment #8484019 - Flags: review?(cajbir.bugzilla)
Attachment #8483998 - Attachment is obsolete: true
Comment on attachment 8484019 [details] [diff] [review]
Keep track of all TrackBuffer decoders rather than only fully initialized ones.

Review of attachment 8484019 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/media/mediasource/test/test_BufferedSeek.html
@@ +1,4 @@
> +<!DOCTYPE HTML>
> +<html>
> +<head>
> +  <title>Test whether we can create an MediaSource interface</title>

Title needs changing.
Attachment #8484019 - Flags: review?(cajbir.bugzilla) → review+
https://hg.mozilla.org/mozilla-central/rev/3c00146008c2
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.