mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-24 17:35:10 +03:00
6610fa3e57
Builds on top of @tykus160's observation in https://github.com/shaka-project/shaka-player/issues/4903 where `MediaSource.readyState` was either in a `closed` or `ended` state when the `MediaSourceEngine.init()` logic is executed. This fix will simply re-open the `MediaSource` if non-open, resulting in fewer scenarios where the `MEDIA_SOURCE_OPERATION_THREW` error: https://github.com/shaka-project/shaka-player/blob/de0f33c2623b057e80b7cafd53e19fac2f984961/lib/media/media_source_engine.js#L648-L651 is thrown because of an [`InvalidStateError`](https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/addSourceBuffer#exceptions).