多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
~~~ <?php header('Access-Control-Allow-Origin: *'); //$url = config('app.rtmp')?:'http://srs.wstaichi.com/:8080/live'; $url = "http://srs.wstaichi.com:8080/live/"; $uri = $url.$_GET['g'].'.m3u8'; ?> <!DOCTYPE html> <html> <head> <title></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> <style> body{ margin:0; padding:0; } </style> </head> <body> <video width="<?php echo config('app.video_w');?>" height="<?php echo config('app.video_h');?>" id="video" class="video-js vjs-default-skin" controls muted autoplay autobuffer > <source src="<?php echo $uri;?>" type="application/x-mpegURL"> </video> <script> var player = videojs('video'); player.src({ src: '<?php echo $uri; ?>', type: 'application/x-mpegURL', withCredentials: true }); player.play(); </script> </body> </html> ~~~