shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.06k stars 1.33k forks source link

Multi Period DASH with Subtitle does not work #5730

Closed taichiro-ishikawa-play closed 11 months ago

taichiro-ishikawa-play commented 11 months ago

Have you read the FAQ and checked for duplicate open issues?

Yes

If the problem is related to FairPlay, have you read the tutorial?

Not related.

What version of Shaka Player are you using?

v4.5.0

Can you reproduce the issue with our latest release version?

Yes

v4.5.0: Does not work v4.4.3: Works

Can you reproduce the issue with the latest code from main?

Yes

Are you using the demo app or your own custom app?

Demo App

If custom app, can you reproduce the issue using our demo app?

NA

What browser and OS are you using?

MacOS 13.6 Chrome 117.0.5938.92

For embedded devices (smart TVs, etc.), what model and firmware version are you using?

NA

What are the manifest and license server URIs?

https://taichiro-ishikawa-play.github.io/hls-sample-stream/dash_multi_period_embed_wvtt/master.mpd

What configuration are you using? What is the output of player.getConfiguration()?

Demo app.

What did you do?

Play above DASH (Multi Period with WebVTT Subtitle) content with subtitle enabled.

What did you expect to happen?

Play normally with subtitle when manifest's period change occurred.

What actually happened?

Player does not show subtitle when manifest's period change occurred. Above sample shows subtitle each period, but v4.5.0 show only first period.

(If manifest is live content, player stucks and does not play anymore.)

Log is here.

TypeError: Cannot read properties of undefined (reading 'split')
    at shaka.util.MimeUtils.getCodecs (mime_utils.js:208:29)
    at shaka.media.MediaSourceEngine.isCodecSwitchNecessary_ (media_source_engine.js:1845:19)
    at shaka.media.MediaSourceEngine.isResetMediaSourceNecessary (media_source_engine.js:1888:15)
    at shaka.media.StreamingEngine.initSourceBuffer_ (streaming_engine.js:1689:51)
    at shaka.media.StreamingEngine.fetchAndAppend_ (streaming_engine.js:1322:18)
    at shaka.media.StreamingEngine.update_ (streaming_engine.js:1169:20)
    at shaka.media.StreamingEngine.onUpdate_ (streaming_engine.js:992:26)
    at shaka.util.DelayedTick.onTick_ (streaming_engine.js:2331:20)
    at onTick (delayed_tick.js:56:14)

More detail, this.sourceBufferTypes_[contentType] is undefined if contentType is ContentType.TEXT. https://github.com/shaka-project/shaka-player/blob/v4.5.0/lib/media/media_source_engine.js#L1783

But, StreamingEngine.initSourceBuffer_ calls isResetMediaSourceNecessary, then calls isCodecSwitchNecessary_.

avelad commented 11 months ago

@taichiro-ishikawa-play I created https://github.com/shaka-project/shaka-player/pull/5731 to resolve it! Sorry...