<?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>25866</bug_id>
          
          <creation_ts>2014-05-22 17:26:10 +0000</creation_ts>
          <short_desc>&quot;needkey&quot; event name is misleading</short_desc>
          <delta_ts>2014-08-12 21:35:45 +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>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>LC</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Dorwin">ddorwin</reporter>
          <assigned_to name="David Dorwin">ddorwin</assigned_to>
          <cc>cpearce</cc>
    
    <cc>jdsmith</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-media</cc>
    
    <cc>watsonm</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>106663</commentid>
    <comment_count>0</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-05-22 17:26:10 +0000</bug_when>
    <thetext>The &quot;needkey&quot; event was originally intended to indicate &quot;this stream is (may be) encrypted&quot; and provide some data about it. At one time, it was even possible to fire in response to not having the key for a block. Since then, the algorithm has changed, we&apos;ve dropped MEDIA_ERR_ENCRYPTED, and put less focus on using this event to drive createSession() calls.

The event that is fired Initialization Data Encountered [1] does not necessarily mean that a key is needed (only the CDM knows this and the CDM is not involved in firing this event). Therefore, I think we should rename it to avoid confusion.

Since the event is fired at HTMLMediaElement, it should somehow indicate that it is related to EME/encrypted content. For example, &quot;initdata&quot; is too general and ambiguous. Possible options include &quot;encrypted&quot; and &quot;encryptedinitdata&quot;.

[1] https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html#algorithms-initdata-encountered</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>107740</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Watson">watsonm</who>
    <bug_when>2014-06-12 17:03:13 +0000</bug_when>
    <thetext>Perhaps &quot;encryptedmedia&quot;, since it is indicating that the file triggers the &quot;Encrypted Media Extensions&quot;. More specific than &apos;encrypted&apos; and less obscure than encryptedinitdata (also, the initdata is not the thing that is (might be) encrypted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108241</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Pearce">cpearce</who>
    <bug_when>2014-06-23 19:58:20 +0000</bug_when>
    <thetext>&quot;encrypted&quot; would suffice I think. I think this is better than &quot;encryptedmedia&quot; as the &quot;media&quot; suffix is a bit superfluous, given that the event is targeted at the media element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>108502</commentid>
    <comment_count>3</comment_count>
    <who name="Jerry Smith">jdsmith</who>
    <bug_when>2014-06-30 16:52:06 +0000</bug_when>
    <thetext>I prefer &quot;encryptedmedia&quot; for the same reason Mark lists below.  It seems more complete and is clear.

We also need to update the needkey event interface and dictionary:

[Constructor(DOMString type, optional EncryptedMediaEventInit eventInitDict)]
interface EncryptedMediaEvent : Event {
  readonly attribute DOMString initDataType;
  readonly attribute ArrayBuffer? initData;
};

dictionary EncryptedMediaEventInit: EventInit {
  DOMString initDataType = &quot;&quot;;
  ArrayBuffer? initData = null;
};</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110045</commentid>
    <comment_count>4</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-08-09 01:01:54 +0000</bug_when>
    <thetext>Summary: I&apos;m leaning towards &quot;encrypted&quot; because anything longer is either inaccurate or too wordy.

Background:
* The event really means that the UA has encountered container data that indicates that media data blocks {are possibly | are potentially | may be} encrypted. The event type happens to provide that container data.
* Looking at other APIs, most event names appear to be one of the following:
 - actions (in various tenses)
 - noun-then-verb

&quot;encryptedmedia&quot; does not reflect the meaning or match the existing patterns. If anything, &quot;mediaencrypted&quot; would be more consistent, though this would imply that media was just encrypted.

&quot;encryptedmediaencountered&quot; would be better, but implies the UA has actually encountered encrypted media, which is not necessarily true - the UA just encountered a header.

The following are probably more accurate, though not very appealing:
* potentiallyencryptedmedia[data][encountered]
* encryptionheader[encountered]
* encryptiondata[encountered]
* initdataencountered

Lacking a good accurate and consistent name, &quot;encrypted&quot; seems the least misleading.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110088</commentid>
    <comment_count>5</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-08-12 15:18:59 +0000</bug_when>
    <thetext>Agreed on &quot;encrypted&quot; in the telecon today.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>110112</commentid>
    <comment_count>6</comment_count>
    <who name="David Dorwin">ddorwin</who>
    <bug_when>2014-08-12 21:35:45 +0000</bug_when>
    <thetext>https://dvcs.w3.org/hg/html-media/rev/0e67f757aeb9 renames the &quot;needkey&quot; event to &quot;encrypted&quot; and updates related text.

I changed the event type name to MediaEncryptedEvent &quot;EncryptedEvent&quot; is too generic for the global namespace, and the &quot;Media&quot; prefix is consistent with MediaKeyMessageEvent. We could use a name containing &quot;InitData&quot;, but that seems less flexible if the &quot;encrypted&quot; event ever needs to be extended to contain other attributes.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>