Skip to content

Commit

Permalink
Fix: Add Support to iOS 12 in MediaCapabilities polyfill (shaka-proje…
Browse files Browse the repository at this point in the history
…ct#3573)

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: shaka-project#3530 .
  • Loading branch information
Álvaro Velad Galván authored Aug 16, 2021
1 parent 233c2bf commit ef506ac
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/polyfill/media_capabilities.js
Original file line number Diff line number Diff line change
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 ef506ac

Please sign in to comment.