Bug 19078 - syntax error in handleKeyNeeded examples
syntax error in handleKeyNeeded examples
Product: HTML WG
Classification: Unclassified
Component: Encrypted Media Extensions
PC Windows NT
: P2 normal
: ---
Assigned To: David Dorwin
HTML WG Bugzilla archive list
Depends on:
  Show dependency treegraph
Reported: 2012-09-26 16:55 UTC by Martin Soukup
Modified: 2012-10-29 17:06 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
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";


"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