W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2009

[whatwg] single step v.play();

From: Biju <bijumaillist@gmail.com>
Date: Mon, 20 Apr 2009 21:58:20 -0400
Message-ID: <4a27dd80904201858g522a2033j7f4ff8f92ac8d821@mail.gmail.com>
On Mon, Apr 20, 2009 at 7:01 AM, Philip J?genstedt <philipj at opera.com> wrote:
> element). Given the already ridiculous complexity of media element's
> loading behavior I'm not sure adding more equivalent syntax will help
> matters.

I am sorry if I am missing something, how do adding it make spec complex.
Already spec for play, load and assign to src attribute exist
So remaining logic is only

HTMLVideoElement.prototype.newPlay =
function newPlay(url){
  if(arguments.length) this.src = url;
  this.load();
  this.play();
}


I dont know how other do
But for me watching CNN is
1. goto http://www.cnn.com/video/
2. selected and add videos I wish to see to playlist
3. click first one in the playlist to play
4. Continue watching
5. if you dont like one, skip by clicking the next one


I rarely use volume control or scroll bar.
So basically most of the days I only do
   v.src = newurl;
   v.load();
   v.play();
for every video I watch, hence this is going to most used functionality for me.


======
PS: here is how the usage of the new play method
it plays 2 times for 30 sec.

var firsttime = 1;
var v = document.createElement('video');;
v.newPlay("http://tinyvid.tv/file/hk9gmeag5hla.ogg");
v.addEventListener("play", onplay, false);
function onplay(){
  setTimeout(dodelay,30000);
}
function dodelay(){
  if(firsttime)
    v.newPlay("http://tinyvid.tv/file/hk9gmeag5hla.ogg");
  else
    v.pause();
  firsttime = 0;
}
Received on Monday, 20 April 2009 18:58:20 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:11 UTC