Skip to content

Commit

Permalink
fix(Demo): Allow play MP4 and TS in legacy iOS devices (#6051)
Browse files Browse the repository at this point in the history
This occurs on a 6th generation iPod touch with iOS 12.
  • Loading branch information
avelad committed Jan 8, 2024
1 parent 5b5b2ce commit f0751cd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion demo/main.js
Expand Up @@ -738,9 +738,19 @@ shakaDemo.Main = class {
if (asset.features.includes(shakaAssets.Feature.DOLBY_VISION_3D)) {
mimeTypes.push('video/mp4; codecs="dvh1.20.01"');
}
const hasSupportedMimeType = mimeTypes.some((type) => {
let hasSupportedMimeType = mimeTypes.some((type) => {
return this.support_.media[type];
});
if (!hasSupportedMimeType &&
!(window.ManagedMediaSource || window.MediaSource) &&
!!navigator.vendor && navigator.vendor.includes('Apple')) {
if (mimeTypes.includes('video/mp4')) {
hasSupportedMimeType = true;
}
if (mimeTypes.includes('video/mp2t')) {
hasSupportedMimeType = true;
}
}
if (!hasSupportedMimeType) {
return 'Your browser does not support the required video format.';
}
Expand Down

0 comments on commit f0751cd

Please sign in to comment.