Jump to content

Play a m3u8 stream from url in local .txt file


Recommended Posts

Hello i have this code


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

      <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>
      <video id="my_video_1" class="video-js vjs-fluid vjs-default-skin" controls preload="auto"
        <source src="http://example.com/example.com/dir/url.txt" type="application/x-mpegURL">
    var player = videojs('my_video_1');


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
Link to comment
Share on other sites

  • MikePer changed the title to Play a m3u8 stream from url in local .txt file

Join the conversation

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

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.