m3u8视频播放器
m3u8播放器支持播放网络上所有主流音频格式文件。
接口地址
https://api.nxvav.cn/api/m3u8/
请求示例
https://api.nxvav.cn/api/m3u8/?url=https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8
shell
curl https://api.nxvav.cn/api/m3u8 -X POST -d 'url=https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8'
php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.nxvav.cn/api/m3u8/?url=https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
请求参数
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
url | string | 是 | 视频直链,支持m3u8、flv、mp4等格式 |
cover | string | 否 | 视频封面图片链接 |
live | boolean | 否 | 直播模式,可选值true ,false 不填默认false |
loop | boolean | 否 | 循环播放,可选值true ,false 不填默认false |
autoplay | boolean | 否 | 自动播放,可选值true ,false 不填默认false |
返回参数
返回参数 | 类型 | 说明 |
---|---|---|
HTML | text/html | 网页播放器 |
返回示例
text
Content-Type: text/html
Url: https://api.nxvav.cn/api/m3u8/?url=https://ghp.ci/https://raw.githubusercontent.com/nuoxian233/Demo_Video/refs/heads/main/mp4/No_Doubt.mp4
json
{
"code": 201,
"msg": "视频地址无效"
}