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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>22259</bug_id>
          
          <creation_ts>2013-06-04 10:55:02 +0000</creation_ts>
          <short_desc>Disabled mediastreamtrack and state of media element</short_desc>
          <delta_ts>2014-04-10 07:30:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebRTC Working Group</product>
          <component>Media Capture and Streams</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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>1</everconfirmed>
          <reporter name="Dominique Hazael-Massieux">dom</reporter>
          <assigned_to name="public-media-capture@w3.org">public-media-capture</assigned_to>
          <cc>adam.bergkvist</cc>
    
    <cc>public-media-capture</cc>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>88608</commentid>
    <comment_count>0</comment_count>
    <who name="Dominique Hazael-Massieux">dom</who>
    <bug_when>2013-06-04 10:55:02 +0000</bug_when>
    <thetext>When a mediastreamtrack is being played in a media element and its enabled attribute is set to false, what is the impact for the media element?

I think the current intent is that the media element from its perspective is still playing, but the played content is the muted output (silence/blackness); among other things, the currentTime should still be updated, and the various relevant events (e.g. timeupdate) should be dispatched.

If so, that should be said explicitly; among other things, it doesn&apos;t seem like this is how Chrome is currently behaving.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88609</commentid>
    <comment_count>1</comment_count>
    <who name="Dominique Hazael-Massieux">dom</who>
    <bug_when>2013-06-04 11:00:41 +0000</bug_when>
    <thetext>Also, is the change in the output after modifying the enabled state synchronous? If not, this should be specified in more details.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94011</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2013-09-30 13:05:00 +0000</bug_when>
    <thetext>General consumer behavior for muted and/or disabled tracks is described in the (MediaStreamTrack) Lify-cycle and Media Flow section [1]. To make it a bit more concrete, I&apos;ve added an example (with media element) based very much on your text below.

Proposed change:
https://github.com/fluffy/webrtc-w3c/commit/6637a2b22d6326410d92e7d724ec8dca1dfdfc06

[1] file:///home/eadaber/webcom/w3c/webrtc-w3c.git/getusermedia.html#life-cycle-and-media-flow</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94087</commentid>
    <comment_count>3</comment_count>
    <who name="Dominique Hazael-Massieux">dom</who>
    <bug_when>2013-10-01 16:11:15 +0000</bug_when>
    <thetext>The proposed change does clarify, thanks!

How about the synchronous or asynchronous impact of changing the enabled state?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94166</commentid>
    <comment_count>4</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2013-10-02 10:02:45 +0000</bug_when>
    <thetext>(In reply to Dominique Hazael-Massieux from comment #3)
&gt; The proposed change does clarify, thanks!
&gt; 
&gt; How about the synchronous or asynchronous impact of changing the enabled
&gt; state?

My, perhaps naive, interpretation is that it&apos;s synchronous.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94172</commentid>
    <comment_count>5</comment_count>
    <who name="Dominique Hazael-Massieux">dom</who>
    <bug_when>2013-10-02 12:19:21 +0000</bug_when>
    <thetext>let&apos;s assume synchronous, and make the spec explicit about it; we can always revert if implementors prove this assumption wrong</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103336</commentid>
    <comment_count>6</comment_count>
    <who name="Dominique Hazael-Massieux">dom</who>
    <bug_when>2014-04-03 12:59:13 +0000</bug_when>
    <thetext>there was some follow up discussion on this: my question on synchronicity was about the effects of setting the enabled flag (black video / silent audio).

In other words, I believe the expectation is that these effects are not obtained synchronously, but rather that there is task queued to black the video and mute the audio — if so, the algorithm should be written (and the task queue be picked).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103346</commentid>
    <comment_count>7</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2014-04-03 13:16:51 +0000</bug_when>
    <thetext>Are you saying that there should be a task scheduled on the JS thread to do this? In that case I don&apos;t think an writable attribute is the right API for this functionality. It would be more appropriate with a request function and let the queued task update a readonly attribute when the task is carried out.

I like the simple attribute though. Couldn&apos;t we specify it to instruct the UA to make the change as soon as possible?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103351</commentid>
    <comment_count>8</comment_count>
    <who name="Dominique Hazael-Massieux">dom</who>
    <bug_when>2014-04-03 13:34:27 +0000</bug_when>
    <thetext>I think there are plenty of examples of a boolean attribute queuing up a task; e.g. http://www.w3.org/html/wg/drafts/html/master/embedded-content.html#dom-audiotrack-enabled

That same links also shows that HTML5 is silent on how and when the disabled state is reflected in the media player, so maybe we don&apos;t need to say anything either. 

That said, part of why they don&apos;t need to say anything is that there is a &quot;change&quot; event fired on enabling/disabling a given track; I think it would be consistent to have a similar event in our case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103353</commentid>
    <comment_count>9</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2014-04-03 13:51:21 +0000</bug_when>
    <thetext>I read the example you provided as there is an event queued to notify the script that something has happened, not to perform the actual &quot;work&quot;.

Regarding doing the &quot;work&quot;, the text says:

&quot;On setting, it must enable the track if the new value is true, and disable it otherwise.&quot;

Can&apos;t we get away with something similar?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103354</commentid>
    <comment_count>10</comment_count>
    <who name="Dominique Hazael-Massieux">dom</who>
    <bug_when>2014-04-03 13:54:16 +0000</bug_when>
    <thetext>I agree that the HTML5 spec is silent on when the work is done, and that we can probably be silent ourselves as a result.

(and thus close this bug)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103355</commentid>
    <comment_count>11</comment_count>
    <who name="Adam Bergkvist">adam.bergkvist</who>
    <bug_when>2014-04-03 13:56:42 +0000</bug_when>
    <thetext>Works for me :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>