Monday, March 5th, 2007

Opera

Category: HTML, Opera

Opera has published a proposal (that is implemented in an internal build) for a <video> HTML element.

This has been talked about for quite awhile, and they got around to doing it.

Example

  1. <script>
  2.   function play(video) { document.getElementById(video).play() }
  3.   function pause(video) { document.getElementById(video).pause() }
  4.   function stop(video) { document.getElementById(video).stop() }
  5. </script>
  6. <video src=news.ogg id=news> ... description of the news ... </video>
  7. <button onclick=play('news')>Play the news!</button>
  8. <button onclick=pause('news')>Pause the news!</button>
  9. <button onclick=stop('news')>Reset</button>

The src=”” attribute, if present, specifies the address of the video. If
present, the attribute must be a URI (or IRI).

When the src=”” attribute is set, the user agent must immediately begin to
download the specified resource, unless the user agent cannot support videos,
or its support for videos has been disabled. As soon as enough data is
received the user agent should start decoding the video. This means that
play() and other methods can already be used before the resource is downloaded
completely.

When downloading a video resource HTTP pipelining must not be used.

If the download fails, the resource is not a supported video format or the
resource can’t be decoded due to an error the user agent must fire an error
event on the <video> element and if it was still downloading it must abort
that process.

Any opinions on the issues?

  • Should we very much like the element just ignore 404 errors and
    the Content-Type header?
  • We could dispatch a load event once the complete video is downloaded,
    but it probably makes more sense to have some kind of streaming here. Perhaps
    the process event stuff from Web API is even enough if a Content-Length header
    is provided.
  • Maybe have a loop([times]) member like Audio() has?
  • height / width

Ready to get rid of generic ugly object/embed tags?

Posted by Dion Almaer at 4:43 am
17 Comments

+++--
3.3 rating from 29 votes

17 Comments »

Comments feed TrackBack URI

how about an info() method ?

Comment by moisadoru — March 5, 2007

Ready to get rid of generic ugly object/embed tags?

Ready to have a growing number of pretty and specific but different (audio, video, applet, flash, vrml, panorama, myOwnObject, mineToo, etc) tags? Mmm…

Comment by Gonzalo — March 5, 2007

Watching Videos on a HTML website is not that common, even if some partys might want it to be. Videos and HTML are too different.

Embed is fine and makes much more sense here.. (we embed something in a page that usually does not belong there). That theres a little fuzz about object/embed since IE vs NS, is another story.. even tho there is still no allround solution, this proposal goes into the wrong direction.

When i read something like “the user agent should start decoding the video” i get a bad feeling about it already.. A user agent should never decode videos nor mp3s.. it’s a browser, not iTunes. Thats why there a plugins.

Comment by Kjell Bublitz — March 5, 2007

That doesn’t make any sense. We WANT to get rid of any img/video tags for the use of object tag – that what was said form the beginning of xhtml standard…

Comment by Oskar Krawczyk — March 5, 2007

totally agree with Oskar

plus, should that be limited to non-interactive (linear) video? for what purpose?

Comment by warp. — March 5, 2007

> When the src=”” attribute is set, the user agent must
> immediately begin to download the specified resource

That is sooo wrong. Also binding codec support to the browsers developers’ mercy? Opera often comes up with nice ideas. This is not one of them.

Comment by Martin — March 5, 2007

If you’re gonna do it, don’t ignore the content-type, as not every database driven website uses static addresses for videos (i.e. can’t check the extension to see if it as flv, avi, mov, rm, etc.

Comment by Chad — March 5, 2007

There are so many complex details that this gives us a chance to do right or wrong:
– content negotation: select different video based on language, connection speed, and codecs supported by the browser. The spec should define some manditory codecs.
– javascript integration: this is going to need a really robust javascript object for sending play, pause, fast forward, rewind, volums, and scrub commands, and firing events related to these things as well.
– skinning and layering: video should be able to support transparency and overlays both above and below

The flash video playback system just works. Its what has really enabled sites like YouTube. No confusing choices of players, etc, and te ability to completely control the playback experience. The video tag would help bring that sort of ability to AJAX apps if done right. Although if I were to implement such an app today, I’d have a small flash video player and my own set of libraries to communicate with it over javascript.

Comment by Joseph Annino — March 5, 2007

can this same approach be applied to flash as well? and instead of a “video” tag, just call it “media” and then have it apply to video, audio AND flash…..

Comment by naterkane — March 5, 2007

Whats wrong with the way it works right now?

Comment by Steve Boyd — March 5, 2007

Most of the discussion seems to be around whether there should be an assumed patent-free codec, whether it should be the only supported thing or just the default. The choice of the codec should not be imposed in my opinion. The market should sort that out. How about just having a type attribute to specify a MIME type that identifies how the video is encoded? That would be a lot simpler than all this negotiation thing that requires a lot of cooperation between the server and client sides. And it would be a lot more open than limiting to some arbitrary choice the standards authors settled on.

Comment by Bertrand Le Roy — March 5, 2007

HÃ¥kon Lie presented a demo of this build at the recent Browser Wars panel discussion at Yahoo! (video link). He argued that OGG Theora is not “some arbitrary choice that standards authors settled on” because it is an open source format – it is more open than the current market alternatives.

Comment by Dave L — March 6, 2007

Well, Dave, wouldn’t choice be the most open? Supporting Ogg is one thing that I’m entirely in favor of, but that shouldn’t be the *only* choice. Realistically, contents providers are going to make or kill the success of such a tag, and you can bet that most of them will want some format that has some DRM (whether you like that or not, which I personally don’t). So if there is a new tag that supports only Theora, well, only Wikipedia will use it, and the rest of the world will continue to use the proprietary plug-ins (some of which have 98% penetration).
Also, I’m not sure how the BSD-style license of Theora plays with the requirements of proprietary browser vendors. Opera seems to be fine with it, but I doubt Microsoft would be ready to integrate it into IE. Just trying to be pragmatic here.

Comment by Bertrand Le Roy — March 6, 2007

What’s with the strange HTML in that example?
And how about….http://msdn2.microsoft.com/en-us/library/ms533100.aspx last time I tried these they worked in FireFox too.

Comment by Oliver — March 9, 2007

sweet blog

Comment by wats up — June 25, 2007

That is amazing, we need the video tag, and throra is good, wish to see ie8 support it too. The object and embed is not good for web.

Comment by afcn007 — July 27, 2007

i really like your blog. how it explains how to use the code simply. but im still a noob in that area , but i do understand it , some what, ;)
good job. i like.

Comment by johnny — October 29, 2007

Leave a comment

You must be logged in to post a comment.