Closed Bug 1227720 Opened 10 years ago Closed 10 years ago

[EME] Shaka player ClearKey demo doesn't work in Firefox

Categories

(Core :: Audio/Video: Playback, defect, P2)

defect

Tracking

()

VERIFIED FIXED
mozilla45
Tracking Status
firefox44 --- affected
firefox45 --- verified

People

(Reporter: cpearce, Unassigned)

References

Details

If you load the Shaka demo player, and run the clearkey "Car/CENC" example, it doesn't work. STR: 1. Load http://shaka-player-demo.appspot.com/ in Firefox Nightly. 2. Press "Load Stream" (without changing any of the "Stream Setup" options). Expected result: * video plays. Observed result: * Video fails to play. NSPR logs: 17136[106f7b80]: GMPService::mozilla::gmp::GeckoMediaPluginServiceParent::AddOnGMPThread: C:\Users\cpearce\AppData\Roaming\Mozilla\Firefox\Profiles\681ziqb7.nightly_x86\gmp-gmpopenh264\1.5.1 0[1719140]: GMPParent[1067d800|childPid=0] GMPParent ctor 17136[106f7b80]: GMPParent[1067d800|childPid=0] mozilla::gmp::GMPParent::Init: for gmp-gmpopenh264 17136[106f7b80]: GMPService::mozilla::gmp::GeckoMediaPluginServiceParent::AddOnGMPThread: C:\Users\cpearce\AppData\Roaming\Mozilla\Firefox\Profiles\681ziqb7.nightly_x86\gmp-eme-adobe\15 0[1719140]: GMPParent[f9eac00|childPid=0] GMPParent ctor 17136[106f7b80]: GMPParent[f9eac00|childPid=0] mozilla::gmp::GMPParent::Init: for gmp-eme-adobe 17136[106f7b80]: GMPService::mozilla::gmp::GeckoMediaPluginServiceParent::AddOnGMPThread: C:\Program Files (x86)\Nightly\gmp-clearkey\0.1 0[1719140]: GMPParent[17bfe000|childPid=0] GMPParent ctor 17136[106f7b80]: GMPParent[17bfe000|childPid=0] mozilla::gmp::GMPParent::Init: for gmp-clearkey 0[1719140]: MediaSource(21d44380)::mozilla::dom::MediaSource::MediaSource: MediaSource(aWindow=20143c10) mSourceBuffers=1eeb9b20 mActiveSourceBuffers=1eeb9bb0 0[1719140]: MediaSource(0)::mozilla::dom::MediaSource::IsTypeSupported: IsTypeSupported(aType=video/mp4; codecs="avc1.640028")OK 0[1719140]: MediaSource(0)::mozilla::dom::MediaSource::IsTypeSupported: IsTypeSupported(aType=video/mp4; codecs="avc1.4d401f")OK 0[1719140]: MediaSource(0)::mozilla::dom::MediaSource::IsTypeSupported: IsTypeSupported(aType=video/mp4; codecs="avc1.4d401e")OK 0[1719140]: MediaSource(0)::mozilla::dom::MediaSource::IsTypeSupported: IsTypeSupported(aType=video/mp4; codecs="avc1.4d401e")OK 0[1719140]: MediaSource(0)::mozilla::dom::MediaSource::IsTypeSupported: IsTypeSupported(aType=video/mp4; codecs="avc1.4d4015")OK 0[1719140]: MediaSource(0)::mozilla::dom::MediaSource::IsTypeSupported: IsTypeSupported(aType=audio/mp4; codecs="mp4a.40.2")OK 0[1719140]: MediaSource(0)::mozilla::dom::MediaSource::IsTypeSupported: IsTypeSupported(aType=audio/mp4; codecs="mp4a.40.2")OK 0[1719140]: MediaSource(0)::mozilla::dom::MediaSource::IsTypeSupported: IsTypeSupported(aType=audio/mp4; codecs="mp4a.40.2")OK 0[1719140]: Navigator::RequestMediaKeySystemAccess(keySystem='org.w3.clearkey' options=[{label='', audioCapabilities=[{contentType='audio/mp4; codecs="mp4a.40.2"'}], videoCapabilities=[{contentType='video/mp4; codecs="avc1.4d4015"'}]}]) 0[1719140]: MediaKeySystemAccessManager::Request org.w3.clearkey 0[1719140]: navigator.requestMediaKeySystemAccess promise resolved 0[1719140]: navigator.requestMediaKeySystemAccess succcess latency 0ms reported via telemetry 0[1719140]: HTMLMediaElement.setMediaKeys promise resolved 0[1719140]: MediaSource(21d44380)::mozilla::dom::MediaSource::~MediaSource: Browser console: Could not read chrome manifest 'file:///C:/Program%20Files%20(x86)/Nightly/chrome.manifest'. 1448400856684 Toolkit.GMP TRACE GMPProvider.startup - enabled=true, gmpPath=C:\Users\cpearce\AppData\Roaming\Mozilla\Firefox\Profiles\681ziqb7.nightly_x86\gmp-gmpopenh264\1.5.1 1448400856685 Toolkit.GMP INFO GMPProvider.startup - adding gmp directory C:\Users\cpearce\AppData\Roaming\Mozilla\Firefox\Profiles\681ziqb7.nightly_x86\gmp-gmpopenh264\1.5.1 1448400856686 Toolkit.GMP TRACE GMPProvider.startup - enabled=true, gmpPath=C:\Users\cpearce\AppData\Roaming\Mozilla\Firefox\Profiles\681ziqb7.nightly_x86\gmp-eme-adobe\15 1448400856686 Toolkit.GMP INFO GMPProvider.startup - adding gmp directory C:\Users\cpearce\AppData\Roaming\Mozilla\Firefox\Profiles\681ziqb7.nightly_x86\gmp-eme-adobe\15 1448400856687 Toolkit.GMP INFO GMPProvider.startup - adding clearkey CDM directory C:\Program Files (x86)\Nightly\gmp-clearkey\0.1 Using native Promises. promise.js:85:5 Using native EME as-is. mediakeys.js:48:5 Using native Promises. promise.js:85:5 Using native EME as-is. mediakeys.js:48:5 Key event not available on some keyboard layouts: key="c" modifiers="accel,alt" browser.xul Key event not available on some keyboard layouts: key="i" modifiers="accel,alt,shift" browser.xul mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create repair:8:3078 + video/mp4; codecs="avc1.640028" is supported player.js:191:3 + video/mp4; codecs="avc1.4d401f" is supported player.js:191:3 + video/mp4; codecs="avc1.4d401e" is supported player.js:191:3 + video/mp4; codecs="avc1.4d4015" is supported player.js:191:3 + audio/mp4; codecs="mp4a.40.2" is supported player.js:191:3 MKSC Object { audioCapabilities: Array[1], videoCapabilities: Array[1], initDataTypes: undefined, distinctiveIdentifier: "optional", persistentState: "optional", sessionTypes: Array[1] } eme_manager.js:292:5 MKSC Object { audioCapabilities: Array[1], videoCapabilities: Array[1], initDataTypes: undefined, distinctiveIdentifier: "optional", persistentState: "optional", sessionTypes: Array[1] } eme_manager.js:292:5 MediaKeySystemAccess::GetKeySystemStatus(org.w3.clearkey, minVer=-1) result=available version='1' msg='' eme_manager.js:428:5 shaka.media.EmeManager.prototype.chooseEncrypted_() eme_manager.js:428 (Async: promise callback) shaka.media.EmeManager.prototype.initialize() eme_manager.js:168 (Async: promise callback) shaka.player.Player.prototype.load() player.js:322 app.load_() app.js:764 app.loadDashStream() app.js:727 app.loadStream() app.js:685 onclick() shaka-player-demo.appspot.com:1 Player error error { target: null, isTrusted: false, detail: TypeError, eventPhase: 0, bubbles: true, cancelable: false, defaultPrevented: false, timeStamp: 5917.794139675971, NONE: 0, CAPTURING_PHASE: 1, AT_TARGET: 2 } app.js:884:3 app.onPlayerError_() app.js:884 shaka.util.FakeEventTarget.prototype.recursiveDispatch_() fake_event_target.js:167 shaka.util.FakeEventTarget.prototype.dispatchEvent() fake_event_target.js:145 shaka.player.Player.prototype.load/<() player.js:353 (Async: promise callback) shaka.player.Player.prototype.load() player.js:322 app.load_() app.js:764 app.loadDashStream() app.js:727 app.loadStream() app.js:685 onclick() shaka-player-demo.appspot.com:1 Invalid URI. Load of media resource failed. shaka-player-demo.appspot.com 1448400917561 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall A version change occurred. Ignoring media.gmp-manager.lastCheck to check immediately for new or updated GMPs. 1448400917561 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Version change, resetting media.gmp-gmpopenh264.trial-create 1448400917561 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Version change, resetting media.gmp-eme-adobe.trial-create 1448400917561 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Version change, resetting media.gmp-eme-clearkey.trial-create 1448400917561 Toolkit.GMP INFO GMPInstallManager._getURL Using url: https://aus5.mozilla.org/update/3/GMP/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml 1448400917562 Toolkit.GMP INFO GMPInstallManager._getURL Using url (with replacement): https://aus5.mozilla.org/update/3/GMP/45.0a1/20151124030553/WINNT_x86-msvc-x64/en-US/nightly/Windows_NT%2010.0.0.0%20(x64)/default/default/update.xml 1448400917786 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Last check was: 61360 seconds ago, minimum seconds: 86400 1448400917786 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Will not check for updates. 1448400918553 Toolkit.GMP INFO GMPAddon.constructor Created new addon: gmp-eme-adobe (isValid: true, isInstalled: true, hashFunction: sha512, hashValue: d0077885971419a5db8e8ab9f0cb2cac236be98497aa9b6f86ff3b528788fc01a755a8dd401f391f364ff6e586204a766e61afe20cf5e597ceeb92dee9ed1ebc, size: 3696996) 1448400918553 Toolkit.GMP INFO GMPAddon.constructor Created new addon: gmp-gmpopenh264 (isValid: true, isInstalled: true, hashFunction: sha512, hashValue: 26a9a0a56b4342cab4e84275b89027f1053c579c346a39545465534ea72aafd0749f38a2aa738a5c0b693433656920bcc44fb0b8fb6436a8b1f1264ebad848b3, size: 333716) 1448400918554 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Found 2 addons advertised. 1448400918554 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Found addon: gmp-eme-adobe (isValid: true, isInstalled: true, hashFunction: sha512, hashValue: d0077885971419a5db8e8ab9f0cb2cac236be98497aa9b6f86ff3b528788fc01a755a8dd401f391f364ff6e586204a766e61afe20cf5e597ceeb92dee9ed1ebc, size: 3696996) 1448400918554 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Addon |gmp-eme-adobe| already installed. 1448400918554 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Found addon: gmp-gmpopenh264 (isValid: true, isInstalled: true, hashFunction: sha512, hashValue: 26a9a0a56b4342cab4e84275b89027f1053c579c346a39545465534ea72aafd0749f38a2aa738a5c0b693433656920bcc44fb0b8fb6436a8b1f1264ebad848b3, size: 333716) 1448400918554 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall Addon |gmp-gmpopenh264| already installed. 1448400918554 Toolkit.GMP INFO GMPInstallManager.simpleCheckAndInstall No new addons to install, returning Looks like EME is starting, but the player isn't creating the CDM. The non-encrypted case works fine.
Summary: [EME] Shaka player doesn't work in Firefox → [EME] Shaka player ClearKey demo doesn't work in Firefox
P2 because EME compatibility is important, but we don't know of real world content that uses ClearKey or the Shaka Player.
Priority: -- → P2
The first problem is that Firefox reports the CDM version number in the MediaKeySystemAccess.keySystem attribute (i.e. org.w3.clearkey.1 for v1), and shaka.media.EmeManager.prototype.chooseEncrypted_ is doing a verbatim string comparison on the keysystem for "org.w3.clearkey", which we're failing. The second problem is that our clearkey CDM doesn't support the "webm" initData format, and that's what they're passing to their MediaKeySession.generateRequest() call, even though this particular example is an MP4 test case.
Depends on: 1230026
(In reply to Chris Pearce (:cpearce) from comment #3) > The first problem is that Firefox reports the CDM version number in the > MediaKeySystemAccess.keySystem attribute (i.e. org.w3.clearkey.1 for v1), > and shaka.media.EmeManager.prototype.chooseEncrypted_ is doing a verbatim > string comparison on the keysystem for "org.w3.clearkey", which we're > failing. Is this a Firefox bug or a Shaka bug? The EME spec says "subsystems may be defined as determined by the key system provider". Is the W3C the key system provider of Clear Key? Or is Mozilla the provider of our implementation? https://w3c.github.io/encrypted-media/#key-system
Flags: needinfo?(cpearce)
The EME spec says that the keySystem string should be "org.w3.clearkey", so our behaviour of changing the reported keySystem string to be something other than that is in violation of the spec. It's not what Chrome implements and clearly it is not what is expected by webdevs. We could disable this behaviour for ClearKey only, and keep it for Adobe Primetime (where it's useful to Netflix), but I expect other webdevs will make the same mistake for Primetime too. I've filed https://github.com/w3c/encrypted-media/issues/133 to begin the process of standardizing this functionality. We could work towards getting shaka-player changed, but then we'll have to play whack-a-mole with every other player that makes the same assumption. I think the only thing we can do is remove this behaviour from Firefox, and try to get something standardized.
Flags: needinfo?(cpearce)
Depends on: 1230272
The "Car/CENC" (YT DASH EME test) - MP4, ClearKey" stream now plays successfully in Nightly 45.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
Verified fixed in Nightly 45.0a1 build 2015-12-06.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.