question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clear error code needed for bad MIME type in addTextTrack

See original GitHub issue

Have 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:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aveladcommented, Jan 20, 2021
0reactions
TheModMakercommented, Jan 19, 2021

There are some error codes, but if you pass a random MIME argument, it will still add the track and fail later.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clear error code needed for bad MIME type in addTextTrack
Clear error code needed for bad MIME type in addTextTrack #1782 ... No, since you can't load an external text track from file....
Read more >
Resource blocked due to MIME type mismatch (X-Content ...
Check if the file path is correct and the file exists - in my case that was the issue - as I fixed...
Read more >
Properly configuring server MIME types - MDN Web Docs
If a web server or application reports an incorrect MIME type for content (including a "default type" for unknown content), a web browser...
Read more >
4.8.8 The video element - HTML Standard - whatwg
Returns the current error's error code, from the list below. ... (Whether the codecs parameter is allowed or not depends on the MIME...
Read more >
4.8.2 The iframe element — HTML5 - W3C
When the element is created with neither a src attribute nor a type attribute, and when attributes are removed such that neither attribute...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found