Apple HLS Issue
CompletedI am unable to get streams to work on iOS16 devices. Here is a sample of my code.
function InitializeVideos(authKey) {
for (key in cameraIds) {
var cameraId = cameraIds[key];
var cameraUrl = serverAddress + '/hls/' + cameraId + '.m3u8?lo&auth=' + authKey;
var videoElement = $('#' + key);
if (videoElement.length) {
videoElement = videoElement[0]; // get underlying DOM element
if (Hls.isSupported()) {
var hls = new Hls();
hls.loadSource(cameraUrl);
hls.attachMedia(videoElement);
hls.on(Hls.Events.MANIFEST_PARSED, function() {
if (key == "video3") {
Hls.liveDurationInfinity = true;
}
if (key == "video8") {
videoElement.autoplay();
} else {
videoElement.play();
}
});
} else if (videoElement.canPlayType('application/vnd.apple.mpegURL')) {
videoElement.src = cameraUrl;
}
} else {
//console.log('Video DOM element with ID ' + key + ' does not exist');
console.log(cameraUrl);
}
Is there other codec or streaming protocol I can use to get around this annouying bug that Apple is refusing to fix?
-
Hello Mike,
Could you please provide detailed info about your environment?
Full iOS version with build, VMS version, camera model you are opening the stream from?
The scenario. How is the code provided being launched: in a browser, your application? What is the version of the browser?
Please sign in to leave a comment.
Comments
1 comment