Skip to content

m3u8视频播放器

m3u8播放器支持播放网络上所有主流音视频格式文件。例如:m3u8、hls、dash、flv、webtorrent、mp4等

接口地址

https://api.nxvav.cn/api/m3u8/

请求示例

https://api.nxvav.cn/api/m3u8/?url=https://ghfast.top/https://raw.githubusercontent.com/nuoxian233/Demo_Video/refs/heads/main/flv/RenJiPengYou.flv

https://api.nxvav.cn/api/m3u8/?url=https://ghfast.top/https://raw.githubusercontent.com/nuoxi4n/Demo_Video/refs/heads/main/mp4/No_Doubt.mp4&autoplay=true

https://api.nxvav.cn/api/m3u8/?url=https://ali-m-l.cztv.com/channels/lantian/channel001/1080p.m3u8&autoplay=true&live=true

https://api.nxvav.cn/api/m3u8/?url=https://ghfast.top/https://raw.githubusercontent.com/nuoxi4n/Demo_Video/refs/heads/main/hls/Merry_Christmas_Mr.Lawrence/Merry_Christmas_Mr.Lawrence.m3u8

shell
curl https://api.nxvav.cn/api/m3u8 -X POST -d 'url=https://ghfast.top/https://raw.githubusercontent.com/nuoxi4n/Demo_Video/refs/heads/main/hls/Merry_Christmas_Mr.Lawrence/Merry_Christmas_Mr.Lawrence.m3u8'
php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
   CURLOPT_URL => 'https://api.nxvav.cn/api/m3u8/?url=https://ghfast.top/https://raw.githubusercontent.com/nuoxi4n/Demo_Video/refs/heads/main/hls/Merry_Christmas_Mr.Lawrence/Merry_Christmas_Mr.Lawrence.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;
?>

请求参数

参数名类型必填说明
urlstring视频直链,支持 hls、dash、flv、webtorrent、mp4 等格式
typestring视频类型,可选值autohlsflvdashwebtorrentnormal。不填默认auto
coverstring视频封面图片直链链接
autoplayboolean自动播放,可选值truefalse。不填默认false
liveboolean直播模式,可选值truefalse。不填默认false
loopboolean循环播放,可选值truefalse。不填默认false

返回参数

返回参数类型说明
HTMLtext/html网页播放器

返回示例

text
Content-Type: text/html
Url: https://api.nxvav.cn/api/m3u8/?url=https://ghfast.top/https://raw.githubusercontent.com/nuoxi4n/Demo_Video/refs/heads/main/mp4/No_Doubt.mp4
json
{
    "code": 201,
    "msg": "视频地址无效"
}