Play a stream from url in a text file mpegURL

Viewed 15

Hello i have this code

  <!DOCTYPE html>
    <html>
    <head>
    <meta charset=utf-8 />
<title>CHANNEL</title>

    
      <link href="https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet">
      <script src="https://unpkg.com/video.js/dist/video.js"></script>
      <script src="https://unpkg.com/videojs-contrib-hls/dist/videojs-contrib-hls.js"></script>
       
    </head>
    <body>
    <?php $video = file_get_contents("channel_url.txt"); ?>
      <video id="my_video_1" class="video-js vjs-fluid vjs-default-skin" controls preload="auto"
      data-setup='{}'>
        <source src="$video" type="application/x-mpegURL">
</video>
      
    <script>
    var player = videojs('my_video_1');
    player.play();
    </script>
      
    </body>
    </html>

What im trying to do is read the .txt file which contains the stream m3u8 url but my code seems missing something...

Thanks in advance

0 Answers
Related