Skip to content

视频播放功能改进请求 #209

Description

@facefunny

下面功能实现个人版不行

希望添加'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' } });

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions