-
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
Cannot read property 'length' of null when try to enable captioning #990
Comments
Hi @SemihGk, thanks for reporting. Having access to the app/content would definitely help us figure out what's going on. Feel free to send it to shaka-player-issues@google.com. |
Thank you for your prompt response. I just sent the app with its instructions. Please let me know if you need more information. |
Did you reproduce in the demo by turning captions on and off? Is it easier to reproduce in your own application than in the demo? |
A small update on this.
What I am still looking into is why the track is being set to |
@SemihGk, is your application directly manipulating the track state instead of using It is possible that the browser built-in controls use "disabled" instead of "hidden". |
Thank you for your responses, @vaage and @joeyparrish. We did not set the mode to "disabled" in our application. Everything is just default. Also, same error is reproduced in the demo app. I assume demo app do not have any custom settings as well. It only happens when we turn captions on and off without changing any settings(including built-in browser controls). |
@joeyparrish You are right. Once we change over to use the default browser built-in controls, it uses "disabled" instead of "hidden". @SemihGk Thank you for bringing this to our attention. I will get a fix put together today. |
Thank you, @vaage. We look forward to waiting the fix then. |
This will be cherry-picked to v2.2.2. |
When a text track's mode is set to "disabled" the cues exposed cue list is set to null. However, if you save a reference to the list, the reference is valid. If the track is disabled, the add and remove calls still work. This change caches the reference to the cue's list when the track is first created so that we can always read it - regardless of what mode the track is set to. Fix #990 Change-Id: I8274ea8450e664eeaa359bf9e78d13405fd2e503
Have you read the FAQ and checked for duplicate issues:
What version of Shaka Player are you using:
2.2 (reproduced 2.1.x as well)
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 custom app. I could not reproced the error on the demo app. Probably video contents in the demo app are not suitable for this error.
If custom app, can you reproduce the issue using our demo app:
No.
What browser and OS are you using:
Mac OS: 10.12.6
Chrome 60
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)
If it's required, we can send the custom app.
What did you do?
Enabled captioning on and waited around a minute(time gap is unpredictable). Then, it caught the error when I tried to disable and enable again.
What did you expect to happen?
It should not throw an error.
What actually happened?
Video is stopped. Please check the screenshot. As you may see it in screenshot, It throws the error at lib/text/simple_text_displayer.js :231, cues.length . When 'cues' is null. I put a console.log to show it in screenshot as well.
The text was updated successfully, but these errors were encountered: