Skip to content

Commit

Permalink
Fix: Add Support to iOS 12 in MediaCapabilities polyfill (#3573)
Browse files Browse the repository at this point in the history
In iOS, there is no support for MediaSource, and we should have  'file' as the type of the MediaiDecodingConfig, to check whether the content is supported or not. We should only require MediaSource support in the polyfill when the type of MediaiDecodingConfig is 'media-source'. 
Issue: #3530 .
  • Loading branch information
Álvaro Velad Galván authored and joeyparrish committed Oct 12, 2021
1 parent 13416e7 commit 180587a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/polyfill/media_capabilities.js
Expand Up @@ -31,11 +31,6 @@ shaka.polyfill.MediaCapabilities = class {
shaka.log.debug(
'MediaCapabilities: Native mediaCapabilities support found.');
return;
} else if (!window.MediaSource) {
shaka.log.debug(
'MediaSource must be available to install mediaCapabilities ',
'polyfill.');
return;
}

if (!navigator.mediaCapabilities) {
Expand Down Expand Up @@ -64,6 +59,9 @@ shaka.polyfill.MediaCapabilities = class {
}

if (mediaDecodingConfig.type == 'media-source') {
if (!shaka.util.Platform.supportsMediaSource()) {
return res;
}
// Use 'MediaSource.isTypeSupported' to check if the stream is supported.
if (mediaDecodingConfig['video']) {
const contentType = mediaDecodingConfig['video'].contentType;
Expand Down

0 comments on commit 180587a

Please sign in to comment.