HttpXHRPlugin registration changed in 3.0.0
See original GitHub issueHave you read the FAQ and checked for duplicate open issues? Yes
What version of Shaka Player are you using? 3.0.0
Can you reproduce the issue with our latest release version? 3.0.0 is the latest at the point of opening of the issue so yes.
Can you reproduce the issue with the latest code from master
?
Not tried yet.
Are you using the demo app or your own custom app?
No, but it happens on a minimalist page with some “necessary interactions” to use HttpXHRPlugin
instead of the deafult fetch
-based one.
If custom app, can you reproduce the issue using our demo app? Can I set the default scheme handler to XHR on the demo app?
What browser and OS are you using? Chrome 83.0.4103.97 on Windows 10
For embedded devices (smart TVs, etc.), what model and firmware version are you using? I am on a PC.
What are the manifest and license server URIs? Happens before playback start so does not matter I think.
What did you do? Add this snippet to a minimalist player page.
// Make the XHR-based HTTP plugin the default (shaka 2.4+)
if (shaka.net.HttpXHRPlugin) {
shaka.net.NetworkingEngine.registerScheme('http', shaka.net.HttpXHRPlugin,
shaka.net.NetworkingEngine.PluginPriority.PREFERRED);
shaka.net.NetworkingEngine.registerScheme('https', shaka.net.HttpXHRPlugin,
shaka.net.NetworkingEngine.PluginPriority.PREFERRED);
}
What did you expect to happen? Playback should work normally.
What actually happened? Playback failed with:
Error code undefined object TypeError: Cannot read property 'timeMs' of undefined
at destroyer.js:63
at Ob (networking_engine.js:188)
at multi_map.js:39
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
No problem! It was a very long list.
Now that we are being more strict with semantic versioning, though, you will not need to check the upgrade guides so carefully in the future. v3.anything should be 100% compatible with v3.0.0.
I’m glad we could help!
I’m trying to reproduce this on ChromeOS 83. I commented out the registration of the Fetch-based scheme plugin to force the use of XHR, then recompiled the library and demo. I tried running this in uncompiled, debug, and compiled mode. In all three, I can confirm in the debugger that the XHR plugin is being used, but I can’t reproduce the error you mentioned:
Finally I realized the root of the issue. The signature of the plugin has changed in v3.0.0. Instead of registering the plugin class’s constructor, you register its static
.parse
method:shaka.net.HttpXHRPlugin.parse
.This is mentioned in the upgrade guide, under the heading “Built-in network scheme plugin changes”: https://shaka-player-demo.appspot.com/docs/api/tutorial-upgrade-v2-5.html
Does this help?