<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>94786</bug_id>
          
          <creation_ts>2012-08-23 00:47:58 -0700</creation_ts>
          <short_desc>MediaController play() doesn&apos;t work</short_desc>
          <delta_ts>2012-08-27 02:31:47 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows 7</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Changbin Shao">changbin.shao</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>changbin.shao</cc>
    
    <cc>jer.noble</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>702777</commentid>
    <comment_count>0</comment_count>
    <who name="Changbin Shao">changbin.shao</who>
    <bug_when>2012-08-23 00:47:58 -0700</bug_when>
    <thetext>reproduce step:
1. open attached file in safari/chrome
2. check if video is able to display.

result:
video is not able to play.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>702778</commentid>
    <comment_count>1</comment_count>
      <attachid>160105</attachid>
    <who name="Changbin Shao">changbin.shao</who>
    <bug_when>2012-08-23 00:51:10 -0700</bug_when>
    <thetext>Created attachment 160105
test file

test.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>703128</commentid>
    <comment_count>2</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2012-08-23 10:32:03 -0700</bug_when>
    <thetext>Unfortunately, this code is working exactly as expected.  The spec says:

&quot;A MediaController is a blocked media controller ... if all of its slaved media elements have their paused attribute set to true.&quot;

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>703662</commentid>
    <comment_count>3</comment_count>
    <who name="Changbin Shao">changbin.shao</who>
    <bug_when>2012-08-23 19:25:45 -0700</bug_when>
    <thetext>Thanks, it make sense for me now. While I still have questions here.
For instance, there are two video tags, with id vid1 &amp; vid2.
     
var con = new MediaController();
vid1.controller = con;
vid2.controller = con;
con.play();//won&apos;t work since MediaController is blocked.
vid1.play();//won&apos;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: &quot;A MediaController is a blocked media controller if the MediaController is a paused media controller...&quot;,so no video should play?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>704143</commentid>
    <comment_count>4</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2012-08-24 09:12:23 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Thanks, it make sense for me now. While I still have questions here.
&gt; For instance, there are two video tags, with id vid1 &amp; vid2.
&gt; 
&gt; var con = new MediaController();
&gt; vid1.controller = con;
&gt; vid2.controller = con;
&gt; con.play();//won&apos;t work since MediaController is blocked.
&gt; vid1.play();//won&apos;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.

&gt; vid2.play(); //works, since MediaController is not blocked now.
&gt; con.pause();//MediaController is paused. How about its slaved elements, should be paused or not? 

They are blocked on their MediaController.  They are still &quot;playing&quot; technically, but their timelines are stopped.

&gt; con.play();//what the result should be? As the spec says: &quot;A MediaController is a blocked media controller if the MediaController is a paused media controller...&quot;,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.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>705106</commentid>
    <comment_count>5</comment_count>
    <who name="Changbin Shao">changbin.shao</who>
    <bug_when>2012-08-27 02:31:47 -0700</bug_when>
    <thetext>Thanks a lot for your explanation! 

(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; Thanks, it make sense for me now. While I still have questions here.
&gt; &gt; For instance, there are two video tags, with id vid1 &amp; vid2.
&gt; &gt; 
&gt; &gt; var con = new MediaController();
&gt; &gt; vid1.controller = con;
&gt; &gt; vid2.controller = con;
&gt; &gt; con.play();//won&apos;t work since MediaController is blocked.
&gt; &gt; vid1.play();//won&apos;t work since MediaController is blocked(because MediaElement 2 is still paused) 
&gt; 
&gt; 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: &quot;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&quot; &amp;&amp; &quot;All media elements have an autoplaying flag, which must begin in the true state&quot;, so I think vid2 still blocks mediaController, thus vid1 is still not able to play. Checked my idea on Chrome. 
 
&gt; &gt; vid2.play(); //works, since MediaController is not blocked now.
&gt; &gt; con.pause();//MediaController is paused. How about its slaved elements, should be paused or not? 
&gt; 
&gt; They are blocked on their MediaController.  They are still &quot;playing&quot; technically, but their timelines are stopped.
&gt; 
&gt; &gt; con.play();//what the result should be? As the spec says: &quot;A MediaController is a blocked media controller if the MediaController is a paused media controller...&quot;,so no video should play?
&gt; 
&gt; 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.)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>160105</attachid>
            <date>2012-08-23 00:51:10 -0700</date>
            <delta_ts>2012-08-23 00:51:10 -0700</delta_ts>
            <desc>test file</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>599</size>
            <attacher name="Changbin Shao">changbin.shao</attacher>
            
              <data encoding="base64">PGh0bWw+DQo8Ym9keT4NCg0KPGRpdiBpZD0ncGxheWVyX2NvbnRhaW5lcic+DQogIDx2aWRlbyBp
ZD0idmlkIiB3aWR0aD0iMzIwIiBoZWlnaHQ9IjI0MCIgPg0KICAgIDxzb3VyY2Ugc3JjPSI3MjBw
Lm1wNCIgdHlwZT0idmlkZW8vbXA0IiAvPg0KICAgIFlvdXIgYnJvd3NlciBkb2VzIG5vdCBzdXBw
b3J0IHRoZSB2aWRlbyB0YWcuDQogIDwvdmlkZW8+DQo8L2Rpdj4NCg0KDQo8c2NyaXB0IHR5cGU9
J3RleHQvamF2YXNjcmlwdCcgdHlwZT0idGV4dC9qYXZhc2NyaXB0IiA+DQogIHZhciBwbGF5ZXIg
ICAgICAgICAgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgidmlkIik7DQogIHZhciBjb25zb2xl
X2lkICAgICAgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnY29uc29sZScpOw0KICANCiAgZnVu
Y3Rpb24gdGVzdCgpDQogIHsNCiAgICAgY29uc29sZS5sb2coJ2hlbGxvJyk7DQogICAgIHZhciBj
b24gPSBuZXcgTWVkaWFDb250cm9sbGVyKCk7DQogICAgIHBsYXllci5jb250cm9sbGVyID0gY29u
Ow0KICAgICBjb24ucGxheSgpOw0KICB9DQogIA0KICB3aW5kb3cub25sb2FkID0gdGVzdDsNCjwv
c2NyaXB0Pg0KDQo8L2JvZHk+DQo8L2h0bWw+DQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>