Closed
Bug 449157
Opened 16 years ago
Closed 13 years ago
Implement the looping attributes in media elements
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla11
People
(Reporter: cajbir, Assigned: kinetik)
References
()
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 1 obsolete file)
6.06 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
start, loopstart, loopend, end, and playcount all control when the video is started, stopped and looped. These are currently unimplemented. See the spec in the URL.
Reporter | ||
Comment 1•16 years ago
|
||
The attributes are currently being discussed in the WHATWG mailing list and may be removed. See the following thread:
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-October/016605.html
Comment 2•16 years ago
|
||
The attributes have been removed from the spec (r2401) and replaced by a single boolean |loop| attribute for infinite loops.[1]
[1] http://html5.org/tools/web-apps-tracker?from=2400&to=2401
Assignee | ||
Updated•16 years ago
|
Assignee: nobody → kinetik
Assignee | ||
Updated•16 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•16 years ago
|
||
Add support for loop attribute, remove obsolete attributes from old spec.
All that's left to do is verify that the correct events fire when playback loops, and write a test.
Comment 4•16 years ago
|
||
Is this going to be ready in time for Firefox 3.5?
Assignee | ||
Comment 5•16 years ago
|
||
No, 3.5 is frozen for the release candidate now, so new features are not being added. Looping (and a few other video features) has been scheduled for the next release, which is why I've recently started working on it.
Comment 6•15 years ago
|
||
Can we see this feature for 3.5.1 or 3.5.2 ?
Assignee | ||
Comment 7•15 years ago
|
||
This feature will be in 3.6 (or whatever the next major release is called).
3.5.x will only receive security and critical fixes. Looping can be achieved using scripting, so it would be very difficult to argue that native support counts as a critical fix for the 3.5.x release branch.
Assignee | ||
Updated•15 years ago
|
Flags: wanted1.9.2?
This seems like low-hanging fruit that we should get in.
It would be nice to have skip-free looping but doing it perfectly would be extremely hard --- requires decoding from the beginning of the stream before we actually seek back there. This patch alone is probably worth taking because it's at least as good as what you can do with script. We could improve it by doing the seek from the decoder thread so that if the data is in the media cache, we can loop without having to go back to the main thread.
Flags: wanted1.9.2? → wanted1.9.2+
Comment 9•15 years ago
|
||
Extremely hard, perhaps -- but essential, in my opinion, regardless whether or not the spec ever requires it. I'm not even sure I'd advertise looping support in its absence, at least not without very prominent caveats about loop behavior not being skip-free.
Comment 10•15 years ago
|
||
I implemented it through an add-on:
https://addons.mozilla.org/en-US/firefox/addon/45730/
I've had an idea about how to implement this skip-free without adding too much complexity. We could allow an HTMLMediaElement to have two nsMediaDecoders: the "current" decoder (today's mDecoder) and a "next" decoder. We now support cloning decoders and sharing the underlying cached data, so we could use that here. When the "current" decoder is near the end and "loop" is specified, we clone it to create the "next" decoder". The "next" decoder starts off paused, at position 0, but will automatically decode some frames into the frame queue (if it needs one). When the "current" decoder ends, we simply replace it with the "next" decoder and start playing.
Hmm, except that doesn't quite work. For total fidelity we need to actually wire together the audio queues and the video frame queues. Hmm.
Comment 12•15 years ago
|
||
Hopefully the internal looping routine will be gapless, at least for audio. As I understand, it is substantially easier to do this for ogg/vorbis than mp3.
The following wikipedia page lists players that support gapless playback. There are some open-source players on there. Maybe looking at their source code will be helpful?
http://en.wikipedia.org/wiki/Gapless_playback
Comment 13•15 years ago
|
||
I found a workaround for now with Firefox 3.6 and tested on Ubuntu Linux 8.04 at least. I used jQuery and had a routine like this in my HTML5 page:
<script type="text/javascript">
$().ready(function(){
$('#snd').bind('ended',{},function() {
$(this).trigger('play');
});
});
</script>
<audio id="snd" src="fire.wav" autoplay="autoplay" playcount="9999" loop="true" />
In other words, I trapped the "ended" event, and made it trigger the play() method to start over again. This was similar to how sonny.piers' plugin worked when I cracked open his XPI file and poked around.
Assignee | ||
Comment 14•14 years ago
|
||
When this bug is fixed, the following test should pass:
(Note that the tests current sniff the user agent for Firefox--hopefully that'll be fixed soon.)
http://test.w3.org/html/tests/submission/Microsoft/video/video_005.htm
Comment 15•14 years ago
|
||
Still MIA in the Firefox 4 beta trunk loads. The loop tag is in the HTML5 spec over at W3 - http://www.w3.org/TR/html5/video.html#attr-media-loop
There's an audio example over at http://forestmist.org/2010/04/html5-audio-loops/ as well as some work arounds.
The missing loop tag functionality is actually affecting developers trying to build HTML5 applications. See the "Issues" section on http://arandomurl.com/2010/07/25/html5-pacman.html
Comment 17•14 years ago
|
||
Also blocks ietestcenter. Why can't I edit that?
Relevant url is: http://samples.msdn.microsoft.com/ietestcenter/html5/MediaElements/media-rules-loop.htm
Updated•14 years ago
|
Blocks: ietestcenter
Assignee | ||
Updated•14 years ago
|
Assignee: kinetik → nobody
Comment 18•14 years ago
|
||
Two years and two months after the original bug was filed...and all the promotion that the Firefox folks are doing over HTML5 - it's REALLY bad that these video (and audio) tags and all of the associated JavaScript events are not working by now.
I had hoped to use both audio and video features in my entry for GameOn-2010 - but right now, the whole thing is just a mess.
This absolutely needs to be there for Firefox 4.0.
Comment 19•14 years ago
|
||
SteveBaker: Please read <https://bugzilla.mozilla.org/page.cgi?id=etiquette.html>, in particular "No pointless comments" and "No obligation". Thanks.
Comment 20•14 years ago
|
||
Resetting to NEW. Set back to ASSIGNED with an assignee, if you're working on
this.
Status: ASSIGNED → NEW
Updated•14 years ago
|
Whiteboard: [wanted2.1?]
Comment 22•13 years ago
|
||
The FishBowl (fhttp://people.mozilla.com/~jmuizelaar/fishbowl/fishbowl-gl.html) benchmark uses the 'loop' attribute. IE 9 and Chrome both implement it, we probably should too.
The new media infrastructure will make seamless looping much easier to implement.
Depends on: 664918
Assignee | ||
Comment 24•13 years ago
|
||
I think it is a mistake not to support this until seamless looping is possible. None of Chrome 17, Opera 11.52, Safari 5.1, or Internet Explorer 9 loop seamlessly.
Assignee: nobody → kinetik
Attachment #379389 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #575791 -
Flags: review?(roc)
Assignee | ||
Comment 25•13 years ago
|
||
Bug 654787 will track looping seamlessly.
Attachment #575791 -
Flags: review?(roc) → review+
Assignee | ||
Comment 26•13 years ago
|
||
Whiteboard: [wanted2.1?]
Target Milestone: --- → mozilla11
Comment 27•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Keywords: dev-doc-needed
Comment 28•13 years ago
|
||
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0a1) Gecko/20111127 Firefox/11.0a1
Mozilla/5.0 (Windows NT 6.1; rv:11.0a1) Gecko/20111127 Firefox/11.0a1
Mozilla/5.0 (Windows NT 5.1; rv:11.0a1) Gecko/20111127 Firefox/11.0a1
Mozilla/5.0 (X11; Linux x86_64; rv:11.0a1) Gecko/20111128 Firefox/11.0a1
Verified using the sites from comment #14 (http://test.w3.org/html/tests/submission/Microsoft/video/video_005.htm), comment #15 (http://forestmist.org/2010/04/html5-audio-loops/) and comment #22 (http://people.mozilla.com/~jmuizelaar/fishbowl/fishbowl-gl.html) and the test passed/audio looping seems to work fine. Still, on Linux there is a delay between loops.
Are there any other tests needed to verify the fix?
Assignee | ||
Comment 29•13 years ago
|
||
Thanks, there's a simple mochitest in the tree as well, so that should cover it.
The extended delay on Linux is bug 582513. That'll be worked around when bug 623444 finally lands.
Comment 30•13 years ago
|
||
There's a prospective use case in Tumblr. There are now two ways to inject the video tag into posts, and looped videos might compliment the love of animated gifs. Demo: http://gchriss.tumblr.com/post/14899370892/demo-html5-video-tumblr
Also, Loop Method 1 from comment #15 fails on FF 9.0 / Linux. The rest work as expected.
Comment 31•13 years ago
|
||
https://developer.mozilla.org/En/HTML/Element/Audio
https://developer.mozilla.org/En/HTML/Element/Video
https://developer.mozilla.org/en/DOM/HTMLMediaElement
https://developer.mozilla.org/En/XPCOM_Interface_Reference/NsIDOMHTMLMediaElement
https://developer.mozilla.org/en/Firefox_11_for_developers
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•