Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix MSE polyfill for iOS #7049

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions lib/polyfill/mediasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ shaka.polyfill.MediaSource = class {

if (!window.MediaSource && !window.ManagedMediaSource) {
shaka.log.info('No MSE implementation available.');
} else if (safariVersion) {
} else if (safariVersion && window.MediaSource) {
// NOTE: shaka.Player.isBrowserSupported() has its own restrictions on
// Safari version.
if (safariVersion <= 10) {
Expand Down Expand Up @@ -167,14 +167,16 @@ shaka.polyfill.MediaSource = class {
* @private
*/
static rejectContainer_(container) {
const isTypeSupported =
// eslint-disable-next-line no-restricted-syntax
MediaSource.isTypeSupported.bind(MediaSource);
if (window.MediaSource) {
const isTypeSupported =
// eslint-disable-next-line no-restricted-syntax
MediaSource.isTypeSupported.bind(MediaSource);

MediaSource.isTypeSupported = (mimeType) => {
const actualContainer = shaka.util.MimeUtils.getContainerType(mimeType);
return actualContainer != container && isTypeSupported(mimeType);
};
MediaSource.isTypeSupported = (mimeType) => {
const actualContainer = shaka.util.MimeUtils.getContainerType(mimeType);
return actualContainer != container && isTypeSupported(mimeType);
};
}

if (window.ManagedMediaSource) {
const isTypeSupportedManaged =
Expand Down
Loading