MikePer Posted September 19, 2022 Share Posted September 19, 2022 (edited) 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 September 19, 2022 by MikePer spelling error Quote Link to comment https://forums.phpfreaks.com/topic/315348-play-a-m3u8-stream-from-url-in-local-txt-file/ Share on other sites More sharing options...
requinix Posted September 19, 2022 Share Posted September 19, 2022 file_get_contents is probably the right solution. What was the code you had that tried to use it, what happened when you ran it, and what did you expect to happen? Quote Link to comment https://forums.phpfreaks.com/topic/315348-play-a-m3u8-stream-from-url-in-local-txt-file/#findComment-1600777 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.