-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Description
下面功能实现个人版不行
希望添加'avi', 'mpg', 'mpeg', 'rm', 'rmvb', 'mov', 'wmv', 'asf', 'ts'的在线播放支持,
mp4等格式处理不变,上面几个单独处理,
扒了一下oneindex,可以使用dash实现,
下面代码仅作举例说明
1.获取文件缩略图链接
2.将缩略图链接替换部分
$videourl = str_replace("thumbnail", "videomanifest", $item['thumb']) . "&part=index&format=dash&useScf=True&pretranscode=0&transcodeahead=0";
3.用dplayer播放,添加类型参数为dash
const dp = new DPlayer({ container: document.getElementById('dplayer'), lang:'zh-cn', video: { url: '<?php echo $videourl; ?>', type: 'dash' } });
另外,dplayer有个封面也可以搞下
const dp = new DPlayer({ container: document.getElementById('dplayer'), lang:'zh-cn', video: { url: '<?php echo $videourl; ?>', pic: '文件缩略图链接', type: 'dash' } });
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels