This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 19078 - syntax error in handleKeyNeeded examples
Summary: syntax error in handleKeyNeeded examples
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Encrypted Media Extensions (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: David Dorwin
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-26 16:55 UTC by Martin Soukup
Modified: 2012-10-29 17:06 UTC (History)
3 users (show)

See Also:


Attachments

Description Martin Soukup 2012-09-26 16:55:56 UTC
Current spec has examples in 8.2.1, 8.2.2, and 8.3 with invalid syntax. 8.2.1 example:

  function handleKeyNeeded(event) {
    var video = event.target;
    var initData = event.initData;

    if (!video.keys)
      video.keys = MediaKeys("org.w3.clearkey");
    if (!video.keys)
      throw "Could not create MediaKeys";

    var keySession = mediaKeys.createSession(mimeType, initData);
    if (!keySession)
      throw "Could not create key session";

    keySession.onkeymessage="handleMessage(event)";
  }

"mediaKeys" does not map to a valid variable in this context and I assume should be "video.keys" since this matches the final example using MediaKeys in 8.4
Comment 1 David Dorwin 2012-10-29 17:06:32 UTC
Fixed in http://dvcs.w3.org/hg/html-media/rev/b2f27fc0f5f6