RESOLVED WONTFIX 94786
MediaController play() doesn't work
https://bugs.webkit.org/show_bug.cgi?id=94786
Summary MediaController play() doesn't work
Changbin Shao
Reported 2012-08-23 00:47:58 PDT
reproduce step: 1. open attached file in safari/chrome 2. check if video is able to display. result: video is not able to play.
Attachments
test file (599 bytes, text/html)
2012-08-23 00:51 PDT, Changbin Shao
no flags
Changbin Shao
Comment 1 2012-08-23 00:51:10 PDT
Created attachment 160105 [details] test file test.html
Jer Noble
Comment 2 2012-08-23 10:32:03 PDT
Unfortunately, this code is working exactly as expected. The spec says: "A MediaController is a blocked media controller ... if all of its slaved media elements have their paused attribute set to true." Since the test case has a MediaController with a single slaved media element, and that media element is paused, the MediaController is a blocked media controller, and play() will not cause playback to start until the slaved media element is unpaused.
Changbin Shao
Comment 3 2012-08-23 19:25:45 PDT
Thanks, it make sense for me now. While I still have questions here. For instance, there are two video tags, with id vid1 & vid2. var con = new MediaController(); vid1.controller = con; vid2.controller = con; con.play();//won't work since MediaController is blocked. vid1.play();//won't work since MediaController is blocked(because MediaElement 2 is still paused) vid2.play(); //works, since MediaController is not blocked now. con.pause();//MediaController is paused. How about its slaved elements, should be paused or not? con.play();//what the result should be? As the spec says: "A MediaController is a blocked media controller if the MediaController is a paused media controller...",so no video should play?
Jer Noble
Comment 4 2012-08-24 09:12:23 PDT
(In reply to comment #3) > Thanks, it make sense for me now. While I still have questions here. > For instance, there are two video tags, with id vid1 & vid2. > > var con = new MediaController(); > vid1.controller = con; > vid2.controller = con; > con.play();//won't work since MediaController is blocked. > vid1.play();//won't work since MediaController is blocked(because MediaElement 2 is still paused) Not quite. The MediaController is only blocked if *all* of its slaved media elements are paused. So at this point, the MediaController goes from a blocked media controller to a playing one. Vid1 will begin playing. > vid2.play(); //works, since MediaController is not blocked now. > con.pause();//MediaController is paused. How about its slaved elements, should be paused or not? They are blocked on their MediaController. They are still "playing" technically, but their timelines are stopped. > con.play();//what the result should be? As the spec says: "A MediaController is a blocked media controller if the MediaController is a paused media controller...",so no video should play? Once the MediaController goes from a paused media controller to a playing media controller, the slaved media elements should begin playing. (Assuming the MediaController does not become blocked for some other reason, like one of the slaved media elements stalling, etc.)
Changbin Shao
Comment 5 2012-08-27 02:31:47 PDT
Thanks a lot for your explanation! (In reply to comment #4) > (In reply to comment #3) > > Thanks, it make sense for me now. While I still have questions here. > > For instance, there are two video tags, with id vid1 & vid2. > > > > var con = new MediaController(); > > vid1.controller = con; > > vid2.controller = con; > > con.play();//won't work since MediaController is blocked. > > vid1.play();//won't work since MediaController is blocked(because MediaElement 2 is still paused) > > Not quite. The MediaController is only blocked if *all* of its slaved media elements are paused. So at this point, the MediaController goes from a blocked media controller to a playing one. Vid1 will begin playing. Just for your information. Spec says: "A MediaController is a blocked media controller...if any of its slaved media elements whose autoplaying flag is true still have their paused attribute set to true" && "All media elements have an autoplaying flag, which must begin in the true state", so I think vid2 still blocks mediaController, thus vid1 is still not able to play. Checked my idea on Chrome. > > vid2.play(); //works, since MediaController is not blocked now. > > con.pause();//MediaController is paused. How about its slaved elements, should be paused or not? > > They are blocked on their MediaController. They are still "playing" technically, but their timelines are stopped. > > > con.play();//what the result should be? As the spec says: "A MediaController is a blocked media controller if the MediaController is a paused media controller...",so no video should play? > > Once the MediaController goes from a paused media controller to a playing media controller, the slaved media elements should begin playing. (Assuming the MediaController does not become blocked for some other reason, like one of the slaved media elements stalling, etc.)
Note You need to log in before you can comment on or make changes to this bug.