From 8a3bed710c104c9729fec2072318e50f9fe15ab2 Mon Sep 17 00:00:00 2001 From: theodab Date: Fri, 1 Apr 2022 20:32:12 -0700 Subject: [PATCH] feat(HLS): Re-add TS support to Safari (#4097) It appears that the problems we previously had with TS content on Safari have been fixed. We no longer need the workaround where we transmuxed TS on that platform. --- lib/polyfill/mediasource.js | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/lib/polyfill/mediasource.js b/lib/polyfill/mediasource.js index f0c39ce0b8..4508185804 100644 --- a/lib/polyfill/mediasource.js +++ b/lib/polyfill/mediasource.js @@ -38,11 +38,6 @@ shaka.polyfill.MediaSource = class { // Chromecast cannot make accurate determinations via isTypeSupported. shaka.polyfill.MediaSource.patchCastIsTypeSupported_(); } else if (safariVersion) { - // TS content is broken on Safari in general. - // See https://github.com/shaka-project/shaka-player/issues/743 - // and https://bugs.webkit.org/show_bug.cgi?id=165342 - shaka.polyfill.MediaSource.rejectTsContent_(); - // NOTE: shaka.Player.isBrowserSupported() has its own restrictions on // Safari version. if (safariVersion <= 12) { @@ -127,29 +122,6 @@ shaka.polyfill.MediaSource = class { }; } - /** - * Patch isTypeSupported() to reject TS content. Used to avoid TS-related MSE - * bugs on Safari. - * - * @private - */ - static rejectTsContent_() { - const originalIsTypeSupported = MediaSource.isTypeSupported; - - MediaSource.isTypeSupported = (mimeType) => { - // Parse the basic MIME type from its parameters. - const pieces = mimeType.split(/ *; */); - const basicMimeType = pieces[0]; - const container = basicMimeType.split('/')[1]; - - if (container.toLowerCase() == 'mp2t') { - return false; - } - - return originalIsTypeSupported(mimeType); - }; - } - /** * Patch |MediaSource.isTypeSupported| to always reject |codec|. This is used * when we know that we are on a platform that does not work well with a given