<?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>19009</bug_id>
          
          <creation_ts>2012-09-25 15:34:22 +0000</creation_ts>
          <short_desc>A MediaKeys should belong to a single HTMLMediaElement.</short_desc>
          <delta_ts>2013-07-02 14:33:35 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>Encrypted Media Extensions</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          <blocked>19156</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Jer Noble">jer.noble</reporter>
          <assigned_to name="Adrian Bateman [MSFT]">adrianba</assigned_to>
          <cc>ddorwin</cc>
    
    <cc>jer.noble</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-media</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>74438</commentid>
    <comment_count>0</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2012-09-25 15:34:22 +0000</bug_when>
    <thetext>Typically, a DOM object has a single parent and 0-to-many child objects.  When it is possible for a DOM Object to change parents (e.g. Node.appendChild(), TextTrack.addCue(), etc.) the new parent will first remove the child from it&apos;s existing parent. 

The normative section of HTMLMediaElement mediaKeys property should add a step to the effect of:

&quot;2. If the given /keys/ is already a HTMLMediaElement&apos;s /keys/, then remove the /keys/ from that HTMLMediaElement.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82927</commentid>
    <comment_count>1</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2013-02-11 22:52:50 +0000</bug_when>
    <thetext>Ping.  This is affecting implementation; the lifetime management issues implied by allowing MediaKeys to belong to multiple HTMLMediaElements are hairy.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84995</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian Bateman [MSFT]">adrianba</who>
    <bug_when>2013-03-26 04:58:49 +0000</bug_when>
    <thetext>I don&apos;t think there&apos;s any reason why a single MediaKeys object couldn&apos;t be used with more than one media element. It is possible you might want to share keys, especially when we resolve bug 19208 so that we know how to keep playing if you already have the key information you need.

This could be a quality of implementation issue. Media engines in user agents may support key sharing up to a certain number of elements (perhaps that limit is 1). It is likely that early implementations would do so after setting once but we shouldn&apos;t unnecessarily constrain future implementations. I propose that we update the spec to throw QUOTA_EXCEEDED exception or something similar if the limit has been reached.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84996</commentid>
    <comment_count>3</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2013-03-26 05:17:32 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I don&apos;t think there&apos;s any reason why a single MediaKeys object couldn&apos;t be
&gt; used with more than one media element. It is possible you might want to
&gt; share keys, especially when we resolve bug 19208 so that we know how to keep
&gt; playing if you already have the key information you need.

There&apos;s at least one good reason, listed above: it makes object lifetime management very hairy.  This would be the first and only DOM object which can have multiple parents.
 
&gt; This could be a quality of implementation issue. Media engines in user
&gt; agents may support key sharing up to a certain number of elements (perhaps
&gt; that limit is 1). It is likely that early implementations would do so after
&gt; setting once but we shouldn&apos;t unnecessarily constrain future
&gt; implementations. I propose that we update the spec to throw QUOTA_EXCEEDED
&gt; exception or something similar if the limit has been reached.

If you want MediaKeys objects to share keys, you should make that an explicit feature of the specification, rather than a side effect of a non-standard ownership model.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85010</commentid>
    <comment_count>4</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2013-03-26 14:38:57 +0000</bug_when>
    <thetext>I retract the statement about MediaKeys being the first DOM object with multiple parents. MediaController also has multiple HTMLMediaElement parents.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85012</commentid>
    <comment_count>5</comment_count>
    <who name="Jer Noble">jer.noble</who>
    <bug_when>2013-03-26 15:27:29 +0000</bug_when>
    <thetext>Additionally, some CDMs will have to be implemented by the media element itself. (This is currently the case with the WebKit Mac port.) By requiring that a MediaKeys object be associated with multiple HTMLMediaElements simultaneously, it would make that implementation at best much more complicated and at worst impossible. 

The benefit posed (sharing keys between media elements) is entirely speculative and could be achieved simply by adding the same key to two, separate MediaKeys objects.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86602</commentid>
    <comment_count>6</comment_count>
    <who name="Adrian Bateman [MSFT]">adrianba</who>
    <bug_when>2013-04-23 18:56:23 +0000</bug_when>
    <thetext>We discussed this on the telcon:
http://www.w3.org/2013/04/02-html-media-minutes.html#item01</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86719</commentid>
    <comment_count>7</comment_count>
    <who name="Adrian Bateman [MSFT]">adrianba</who>
    <bug_when>2013-04-24 20:54:32 +0000</bug_when>
    <thetext>Discussed in the F2F.

Next steps:
1) Add a step that throws an exception from setMediaKeys if the media element would exceed the user agent&apos;s ability to share the MediaKeys object.

2) Add a note to the spec that explains that MediaKeys and MediaKeySession may not be functional in some implementations until the MediaKeys object is set to a media element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87059</commentid>
    <comment_count>8</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2013-05-01 03:19:20 +0000</bug_when>
    <thetext>Consider the related use case in bug 19156 as well. The above resolution may be sufficient.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90110</commentid>
    <comment_count>9</comment_count>
    <who name="Adrian Bateman [MSFT]">adrianba</who>
    <bug_when>2013-07-02 14:33:35 +0000</bug_when>
    <thetext>Changeset -&gt; https://dvcs.w3.org/hg/html-media/rev/f4d8dc9bdacc</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>