First i convert the url (php string) to jquery array,
And now I need the broadcast to work using the var #url.
Works:
hls.loadSource('http://149.56.21.86:25461/live/demivadoiscar/Quz2LG/158.ts');
Not Works:
hls.loadSource('#url');
-
<?php
$url = "http://149.56.21.86:25461/live/demivadoiscar/Quz2LG/158.ts";
?>
<html>
<body>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<video height="600" id="video" controls></video>
var url = <?php $url?>
<script>
if(Hls.isSupported()){
var video = document.getElementById('video');
var hls = new Hls();
hls.loadSource('#url');
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED,function(){
video.play();
});
}
</script>