I’m using dash and hls for video playback.
but it doesnt work on safari desktop and it doesnt work on mobile safari either
window.onload = (event) => { myFunction( event ) };
function myFunction( event )
{
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) ||
(navigator.userAgent.includes(“Mac”) && “ontouchend” in document);
const manifestUrl = isIOS ? “assets/video/stream.m3u8” : “assets/video/stream.mpd”;
//alert(“Screen Width is: ” + screen.width);
let myvid = document.getElementById(“bg-video”);
//var url = "";
//if ( screen.width >= 1920 ) { url = “assets/video/ULC_REEL_2023_1080p.mp4”; }
//else if ( screen.width >= 1280 ) {url = “assets/video/ULC_REEL_2023_720p.mp4”; }
//else if ( screen.width <= 1080 ) { url = “assets/video/ULC_REEL_2023_1080w.mp4”; }
//else if ( screen.width <= 720 ) { url = “assets/ULC_REEL_2023_720w.mp4”; }
// instantiate it
// const player = new RxPlayer({
// videoElement: myvid
// });
// play a video
// player.loadVideo({
// url: url,
// transport: “dash”,
// autoPlay: true
// });
if (isIOS) {
console.log(“IOS” + manifestUrl);
myvid.src = manifestUrl;
myvid.load();
} else {
const player = new RxPlayer({
videoElement: myvid
});
player.loadVideo({
url: manifestUrl,
transport: “dash”,
autoPlay: true,
loop: true
});
}
// myvid.src = url;
//# load URL (for playback)
// myvid.load();
}