Skip to content
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

player.configure({textDisplayFactory:...}) crashes in player.unload() with a release build #1187

Closed
aptly-io opened this issue Dec 12, 2017 · 6 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@aptly-io
Copy link

What is the correct way for using the textDisplayFactory field in the player's configure structure?

We're using a custom TTML text renderer/displayer. Displaying subtitles works fine.

After switching from the shaka-player.compiled.debug.js to shaka-player.compiled.js we notice a crash in the players' unload(). This does not happen with the debug build.

player.js:1825 Uncaught (in promise) TypeError: a.w.o is not a function
    at dh (player.js:1825)







    at mh (player.js:1859)
    at U.<anonymous> (player.js:1145)
    at <anonymous>

Have you read the FAQ and checked for duplicate issues:
Yes

What version of Shaka Player are you using:
master branch

Can you reproduce the issue with our latest release version:
Yes

Can you reproduce the issue with the latest code from master:
Yes

Are you using the demo app or your own custom app:
My own based on the shaka tutorial "Basic Usage"

If custom app, can you reproduce the issue using our demo app:
No but there's sample code attached to reproduce:
Just dump the 2 attached files in the $ROOT/demo directory
./build/all.py , start http-server -c-1 --cors="*" -p12345 from the root
Now load fm_demo.html with Chrome

What browser and OS are you using:
Chrome (also seeing this on the chromecast)

What are the manifest and license server URIs:
(you can send the URIs to shaka-player-issues@google.com instead, but please use GitHub and the template for the rest)

What did you do?
Using the shaka-player.compiled.js

player.configure({
textDisplayFactory: function() {
return new Displayer();
}
});

setTimeout(function() {
console.log('### UNLOADING');
player.unload(); // crash happens here (or in the .catch())
}, 8000);

What did you expect to happen?
Graceful unloading without leaving the player in an inconsistant state.

What actually happened?
Seeing this crash in the chrome's developer console, leaving the player in an inconsistant state

@aptly-io
Copy link
Author

fm_demo.txt
fm_app.txt

@joeyparrish
Copy link
Member

Sounds like a bug in the way we declared the class. I expect it's TextDisplayer.destroy() that is the issue. Let me do some testing and see if I can confirm that.

@joeyparrish joeyparrish added type: bug Something isn't working correctly and removed needs triage labels Dec 12, 2017
@joeyparrish joeyparrish added this to the v2.3.0 milestone Dec 12, 2017
@joeyparrish joeyparrish self-assigned this Dec 12, 2017
@joeyparrish
Copy link
Member

It appears to be the only external plugin class that implements shaka.util.IDestroyable, and we left out the declaration of destroy() in the externs. This caused the compiler to rename the method inside the compiled library.

@aptly-io
Copy link
Author

@joeyparrish Thank you for your fix!

@joeyparrish
Copy link
Member

We are always happy to help.

joeyparrish added a commit that referenced this issue Dec 18, 2017
Includes an integration test that reproduces the issue.

Closes #1187

Change-Id: I15233fadcdadad8bd79dcad1fd2f1569d8de56f3
@joeyparrish
Copy link
Member

The fix has been cherry-picked for v2.2.9.

@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants