PHP code example of itxiao6 / live
1. Go to this page and download the library: Download itxiao6/live library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
itxiao6 / live example snippets
/**
* 引入Composer 自动加载规则
*/
��直播
* 2.斗鱼
* 3.花椒直播
* 4.一直播
* 5.映客直播
*/
/**
* 自动分析平台 及 抓取直播流信息
*/
$res = \Itxiao6\Live\Live::getInterface() -> auto($_GET['url']);
/**
* 输出测试页面 播放直播
*/
echo '<html>
<head>
<title>视频直播</title>
<meta charset="utf-8">
<link href="https://cdn.bootcss.com/video.js/5.5.3/video-js.css" rel="stylesheet">
<!-- If you\'d like to support IE8 -->
<script src="https://cdn.bootcss.com/video.js/5.5.3/ie8/videojs-ie8.min.js"></script>
</head>
<body>
<h1>直播间</h1>
<video id="my-video" class="video-js" controls preload="auto" width="640" height="300" data-setup="{}"> '.$res -> get_source().' </video>
<script src="https://cdn.bootcss.com/video.js/5.5.3/video.js"></script>
</body>
</html>';