benjipott / video.js-chromecast

Use chromecast with videojs html5 player
Other
207 stars 86 forks source link

Failed to execute 'addCue' on 'TextTrack': parameter 1 is not of type 'TextTrackCue' #17

Open askaliuk opened 7 years ago

askaliuk commented 7 years ago

Hi,

When a user stops to cast an HLS stream with captions, Chrome raises an exception:

Uncaught TypeError: Failed to execute 'addCue' on 'TextTrack': parameter 1 is not of type 'TextTrackCue'.
    at https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:18160:27
    at Array.forEach (native)
    at https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:18159:18
    at Array.forEach (native)
    at Object.jsonToTextTracks (https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:18156:8)
    at Player.loadTech_ (https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:10687:49)
    at Player.sourceList_ (https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:12111:14)
    at Player.src (https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js:12046:12)
    at ChromeCastButton.onStopAppSuccess (https://rawgit.com/benjipott/video.js-chromecast/2.0.7/dist/videojs-chromecast.js:280:26)
    at Y.e.bd (chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js:87:473)

It's very easy to repeat here: http://www.w3schools.com/code/tryit.asp?filename=F09KO2XJN00D

Steps:

  1. start playback
  2. start casting, wait for playback on Chromecast
  3. stop casting
  4. notice an exception in Chrome console

As a result player fails to switch from cast tech back to html5 tech. Any help is appreciated.