Clear error code needed for bad MIME type in addTextTrack
See original GitHub issueHave you read the FAQ and checked for duplicate open issues? Yes, checked open issues as well.
What version of Shaka Player are you using? 2.4.6
Can you reproduce the issue with our latest release version? Yes, 2.5.0-beta2 as well
Can you reproduce the issue with the latest code from master?
Yes
Are you using the demo app or your own custom app? Custom
If custom app, can you reproduce the issue using our demo app? No, since you can’t load an external text track from file.
What browser and OS are you using? Tizen Emulator and Google Chrome 71 on OSX 10.13.6
For embedded devices (smart TVs, etc.), what model and firmware version are you using? Tizen Emulator with 4.0 Web Platform currently, but not strictly limited to this platform.
What are the manifest and license server URIs?
What did you do?
Tried to add an external WebVTT2 text track after the video successfully loads.
Fiddle: https://jsfiddle.net/8Lu0trec
What did you expect to happen? I expected the text track to load successfully and have the player report that there is one text track when queried.
What actually happened?
The WebVTT2 external text track file failed to load and three different unexpected errors appeared in the console, including a crash. Not sure if WebVTT2 is unsupported or if there’s a different issue here, but the error handling / data validation seems to be failing in any case.
EDIT: According to the documentation, this function is supposed to be called in the resolve() promise of the player.load() function, so hopefully I have it implemented correctly?
Console output:
VM85 shaka-player.compiled.debug.js:962 InputEvent.install
VM85 shaka-player.compiled.debug.js:963 mathRound.install
VM85 shaka-player.compiled.debug.js:964 MediaSource.install
VM85 shaka-player.compiled.debug.js:965 Using native MSE as-is.
VM85 shaka-player.compiled.debug.js:1040 VideoPlayPromise.install
VM85 shaka-player.compiled.debug.js:1042 Using native VTTCue.
VM85 shaka-player.compiled.debug.js:822 Unload latency: 0.022
VM85 shaka-player.compiled.debug.js:512 No Period ID given for Period with start time 0, Assigning a default
VM85 shaka-player.compiled.debug.js:264 Dropping Variant (not compatible with key system, platform, or active Variant) {id: 32, language: "en", primary: true, audio: {…}, video: {…}, …}
VM85 shaka-player.compiled.debug.js:264 Dropping Variant (not compatible with key system, platform, or active Variant) {id: 33, language: "en", primary: true, audio: {…}, video: {…}, …}
VM85 shaka-player.compiled.debug.js:264 Dropping Variant (not compatible with key system, platform, or active Variant) {id: 34, language: "en", primary: true, audio: {…}, video: {…}, …}
VM85 shaka-player.compiled.debug.js:264 Dropping Variant (not compatible with key system, platform, or active Variant) {id: 35, language: "en", primary: true, audio: {…}, video: {…}, …}
VM85 shaka-player.compiled.debug.js:264 Dropping Variant (not compatible with key system, platform, or active Variant) {id: 36, language: "en", primary: true, audio: {…}, video: {…}, …}
VM85 shaka-player.compiled.debug.js:264 Dropping Variant (not compatible with key system, platform, or active Variant) {id: 37, language: "en", primary: true, audio: {…}, video: {…}, …}
VM85 shaka-player.compiled.debug.js:264 Dropping Variant (not compatible with key system, platform, or active Variant) {id: 38, language: "en", primary: true, audio: {…}, video: {…}, …}
VM85 shaka-player.compiled.debug.js:264 Dropping Variant (not compatible with key system, platform, or active Variant) {id: 39, language: "en", primary: true, audio: {…}, video: {…}, …}
VM85 shaka-player.compiled.debug.js:818 Found variant with audio and video content, so filtering out audio-only content in all periods.
VM85 shaka-player.compiled.debug.js:830 codecs avc1-mp4a avg bandwidth 3006026.75
VM85 shaka-player.compiled.debug.js:904 onChooseStreams_ {startTime: 0, textStreams: Array(0), variants: Array(16)}
VM85 shaka-player.compiled.debug.js:904 Choosing new streams after period changed
VM85 shaka-player.compiled.debug.js:657 init: completed initial Stream setup
VM85 shaka-player.compiled.debug.js:236 Assertion failed: Type negotiation should happen before MediaSourceEngine.init!
(anonymous) @ VM85 shaka-player.compiled.debug.js:236
Promise.then (async)
shaka.media.MediaSourceEngine.init @ VM85 shaka-player.compiled.debug.js:236
shaka.media.StreamingEngine.loadNewTextStream @ VM85 shaka-player.compiled.debug.js:661
shaka.Player.addTextTrack @ VM85 shaka-player.compiled.debug.js:874
onVideoLoaded @ (index):69
Promise.then (async)
(anonymous) @ (index):66
window.onload @ (index):86
load (async)
(anonymous) @ (index):31
VM85 shaka-player.compiled.debug.js:222 Assertion failed: Text type negotiation should have happened already
shaka.text.TextEngine.initParser @ VM85 shaka-player.compiled.debug.js:222
shaka.media.MediaSourceEngine.reinitText @ VM85 shaka-player.compiled.debug.js:238
(anonymous) @ VM85 shaka-player.compiled.debug.js:236
Promise.then (async)
shaka.media.MediaSourceEngine.init @ VM85 shaka-player.compiled.debug.js:236
shaka.media.StreamingEngine.loadNewTextStream @ VM85 shaka-player.compiled.debug.js:661
shaka.Player.addTextTrack @ VM85 shaka-player.compiled.debug.js:874
onVideoLoaded @ (index):69
Promise.then (async)
(anonymous) @ (index):66
window.onload @ (index):86
load (async)
(anonymous) @ (index):31
(index):81 TypeError: a is not a constructor
at shaka.text.TextEngine.initParser (VM85 shaka-player.compiled.debug.js:222)
at shaka.media.MediaSourceEngine.reinitText (VM85 shaka-player.compiled.debug.js:238)
at VM85 shaka-player.compiled.debug.js:236
onAddExternalTextTrackError @ (index):81
Promise.catch (async)
onVideoLoaded @ (index):80
Promise.then (async)
(anonymous) @ (index):66
window.onload @ (index):86
load (async)
(anonymous) @ (index):31```
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)

Top Related StackOverflow Question
I created https://github.com/google/shaka-player/pull/3110 to resolve it
There are some error codes, but if you pass a random MIME argument, it will still add the track and fail later.