From 1fd61d139a01e05ee1c3fca5727e291cefecec37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?A=CC=81lvaro=20Velad=20Galva=CC=81n?= Date: Mon, 8 Jan 2024 16:15:11 +0100 Subject: [PATCH] fix(Demo): Allow play MP4 and TS in legacy iOS devices --- demo/main.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/demo/main.js b/demo/main.js index d36d992cc0..3d261d57ab 100644 --- a/demo/main.js +++ b/demo/main.js @@ -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.'; }