-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PlayReady InvalidStateError on Edge 25 #282
Comments
Yes I spotted this too. https://shaka-player-demo.appspot.com/ Checking the release notes Edge has removed support for VP9, but I have checked the content which uses avc1.4D4015 which is supported. So I don't think it is a codec issue. |
So I have been digging in a bit more. I think it is the call to setMediaKeys https://github.com/google/shaka-player/blob/87ac05e/lib/media/eme_manager.js#L452 Appears to be a native call on Edge, I am unsure if it should be polyfilled or not. |
In uncompiled mode, you should have a log from shaka.polyfill.MediaKeys.install that says either "Using native EME as-is" or "Using EME v20140218". If it's "native EME as-is", then it's not polyfilled and the lack of Promise resolution may be a bug in Edge. Or it could be an incompatibility between the latest Edge's EME and the rest of the ecosystem, in which case we may be able to change some small part of Shaka to be more flexible. Lots of _may_s and _could_s, because I haven't had access to Edge 25 myself to investigate. :-) @sarge, can you check the status of the polyfill? |
So I get the message 'Using native EME as-is', also 'Using native Promises'. @joeyparrish I am about for the next 2 hours if it suits you to take a crack at this. |
Sorry, I'm unable to look into it at the moment. I don't have immediate access to Edge 25. |
Sure ok, any suggested next steps? How can I verify if the promise is not resolving. The media keys object appears valid, it has the correct type and has the createSession, setServerCertificate methods on it. |
Check app.video_.mediaKeys after the point where the Promise should have resolved. If it's null, then Edge really hasn't done it yet. If it's non-null, the Promise should definitely be resolved and I would lean more strongly toward guessing this is bug in Edge. If Edge really isn't setting mediaKeys... I'm not sure where to go next. There's no obvious reason it would block on that. Are there any logs that might be relevant? In the JS console or otherwise? |
OK so it the mediaKeys are null I thought should get another option But looking at the media keys on the video element, they do appear they have been set. I noticed that they are not using a promise on the setMediaKeys function. Could you check if this page does work for you, I don't have access to an older version. Then at least I can open that as a bug as well as referencing the shakaplayer. Also I noticed that the dashif.org reference player is working, any issues if I look at that source to contribute to shaka? |
If Edge implements an old version of EME which does not return a Promise from setMediaKeys(), then that might cause issues. We might have to detect this and polyfill it. Does Edge 20 use native EME? Or are we polyfilling that just like we do for IE11? |
So Edge 20 is using a polyfill EME v20140218 I have force Edge to load that polyfill (on 1.6.2) which does get it further, eme seems to initialize 'All Streams have completed startup!' Player Error - 'The browser does not support the media content' app.video_.mediaKeys -> now has a mediakey with the key system set to "com.microsoft.playready" Perhaps there is something in the polyfill I should remove? |
"The browser does not support the media content" very likely corresponds to the MEDIA_ERROR_SRC_NOT_SUPPORTED you get from Microsoft's own demo. That is triggered by a decoder error event dispatched from the video element, and should not have anything to do with EME. We may not be able to do anything to fix that. Either the content is truly in an unsupported codec or the browser's media pipeline has a bug. So I'd call "does not support" a successful fix for the EME part. :-) I'm not sure we should force the polyfill for Edge as a permanent fix. Let's explore the problem a bit more. Can you modify EmeManager's setupMediaKeys_ to change this:
to something like this:
It would be interesting to see whether or not setMediaKeys returns a Promise on Edge 25. |
So I've done what Sarge has and I've forced Edge 25 to use the polyfill EME v20140218 and it's working! Thanks for the help! I'll keep an eye out to see if there is a more permanent fix. I ran the above and it just seems to return an object that doesn't seem to have anything in it. Let me know if you need me to try anything else. |
So Doolali is correct the console does that output. Debugging shows that this is a Promise object, has methods of catch, then. So it would appear Edge does not resolve this promise. Reordering the MediaKeys.install forcing the IE11 fixes works for me, testing on Chrome 49, Edge 25
|
Actually one more thing, adding the catch to the promise shows that the promise is resolving but with an error. Seems to be some difference between the MediaKeys and MSMediaKeys on Edge. @joeyparrish is this a bug or simply by design at this stage? Have MS committed to removing their vendor prefixes? |
Looks like a rejected setMediaKeys Promise should land us in this error handler in Player: https://github.com/google/shaka-player/blob/87ac05e/lib/player/player.js#L343 This should result in an 'error' event dispatched on player and the player.load() Promise being rejected. @sarge can you confirm? If this isn't happening, Shaka has a bug in its error handling. (This is separate from finding the cause of the rejected Promise, but first things first.) |
Your understanding is correct, the error is bubbled up. The fun was figuring out what the source of the error is, which I am now certain that it is the setMediaKeys call. |
Okay, I see now. I would guess that InvalidStateError means Edge 25 expects some other order of events, but it will take time to investigate. In the mean time, preferring the IE11 EME polyfill seems to be a reasonable work-around. |
I have reproduced this issue with automated integration tests for v2, and I now have a handle on the cause. It seems that this happens when setMediaKeys is called before video.src is set. We shouldn't have an issue with this in v2, as v2's DrmEngine has a two-phase system: initialize() and attach(). To fix it in v1, we will need to split up EmeManager.initialize() so that setupMediaKeys_() occurs after videoSource.attach(). We should be able to publish a fix in v1.6.4. |
Hi, I've recently started using Shaka Player and I'm struggling with the same issue as @Doolali. Thanks, |
@joeyparrish Comparing master and the release version 1.6.3, it looks like this fixes the live streaming on Edge, when testing using "GPAC/SegmentList" sample. But the issue with the on demand profiles remains. I tested with "Oops" It appears that it is still using the native EME. The error still appears on the setMediaKeys. It looks like setMediaKeys is called before videoSource.attach() at https://github.com/google/shaka-player/blob/master/lib/player/player.js#L336 if that is still your theory for why this fails. |
@sarge, using native EME on Edge from I'm investigating now. |
We backported some Edge fixes from v2, but we missed something important. We are working on another fix. |
This moves MediaKeys attachment to after MSE attachment to avoid InvalidStateError on Edge. Issue #282 Change-Id: I84babc870976380f3891b2d1972688a1e18241cb
Edge 13 does not seem to return capabilities in MediaKeySystemConfig. If missing, fall back to a looser way to match streams. Issue #282 Change-Id: I076aff62838bae3dc0e7e9c644c8c8d044c23f31
@Doolali, @sarge, @sergiofagostinho, please try with the latest from |
I've tested 3-4 different pieces of content on a fresh copy of the master on Edge 20 and 25, so happy to say it's resolved. |
@Doolali, thanks! We'll roll these changes out in v1.6.4. |
Hi, I've just pulled the latest commit from master and I get the following:
Which content have you tried @Doolali ? |
@sergiofagostinho, specifically we fixed InvalidStateError with PlayReady assets. It is a known issue that some of the test assets in v1 are incompatible with IE/Edge (#224). They will be replaced in v2. If you have known-good PlayReady assets, please try those. |
@joeyparrish: ok, got it. I used Big Buck Bunny from Edge's Test Page and it worked both in Edge and Chrome. In other words, I've set the following:
Thanks. |
@sergiofagostinho, thanks! |
@sergiofagostinho I was using our own content which we used Unified Streaming's packager to DASH. |
Hello,
I've been testing PlayReady on Edge and have run into an issue that I'm struggling to find the source of.
On Edge 20 PlayReady playback works without any issues, this morning I updated to 25.10586.0.0 and have started getting a Player Error with a message of "InvalidStateError".
Has anyone else experienced this and/or has a solution?
Thanks,
Scott
Update:
Clear content does not have this issue.
Codec: avc1.64000D
The text was updated successfully, but these errors were encountered: