Skip to content

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

https://api.nxvav.cn/api/m3u8/?url=https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8&autoplay=true&live=true

https://api.nxvav.cn/api/m3u8/?url=https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8&autoplay=true&live=true&cover=https://api.nxvav.cn/api/bing/

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

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;
?>

请求参数

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

返回参数

返回参数类型说明
HTMLtext/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": "视频地址无效"
}