Jump to content

Recommended Posts

Hello i have this code

 

<!DOCTYPE html>
    <html>
    <head>
    <meta charset=utf-8 />
<title>Channel1</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>
      <video id="my_video_1" class="video-js vjs-fluid vjs-default-skin" controls preload="auto"
      data-setup='{}'>
        <source src="http://example.com/example.com/dir/url.txt" type="application/x-mpegURL">
</video>
      
    <script>
    var player = videojs('my_video_1');
    player.play();
    </script>
      
    </body>
    </html>

 

I have to insert a url. But i want to read a txt file in the same local location which contains the url..

I tried

 

$html = file_get_contents("link.txt");

But php doesn't work on html file...

How do i do that?

 

Thanks alot

Edited by MikePer
spelling error
  • MikePer changed the title to Play a m3u8 stream from url in local .txt file
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.