如何让subtitleoctopus从index.m3u8中提取字幕?

问题描述

我使用的 wordpress 主题已内置于 jwplayer8。在帮助下,我能够让播放器工作并播放 HLS 视频。现在我希望得到 .ASS 字幕工作。我找到了 SubtitlesOctopus,似乎所有的示例代码都有预先定义和标记的字幕轨道。并非我的所有视频都仅限于 1-2 个字幕轨道。我希望找到一种方法,让它从 index.m3u8 中提取字幕,就像 webvtt 字幕的认设置一样。或者有没有办法让它搜索目录并使用文件名作为标签

这是我当前为玩家编写的脚本

<?PHP 
$episode_pagi = DDbmoviesHelpers::EpisodeNav($tmdbids,$temporad,$episode);
$next_episode = doo_isset($episode_pagi,'next');
$link_next = !empty($next_episode) ? 'href="'.$next_episode['permalink'].'" title="'.$next_episode['title'].'"' : 'href="#" class="nonex"';

?>
<!DOCTYPE html>
<html lang="en" dir="ltr" data-cast-api-enabled="true">
    <head>
        <Meta name="viewport" content="width=device-width,initial-scale=1">
        <Meta name="robots" content="noindex">
        <title>JW Player</title>
        <script src='https://ssl.p.jwpcdn.com/player/v/8.6.2/jwplayer.js'></script>
        <script type="text/javascript">jwplayer.key="<?PHP echo $jw8key; ?>";</script>
        <script type="text/javascript">
            var jw = <?PHP echo json_encode($data)."\n"; ?>
        </script>
        <style type="text/css" media="all">
            html,body{padding:0;margin:0;height:100%}
            #player{width:100%!important;height:100%!important;overflow:hidden;background-color:#000}
        </style>
    </head>
    <body class="jwplayer">
        <div id="player"></div>
        <script type="text/javascript">
            const defaulGateway = "https://gateway.anime4all.net/ipfs/";
            let gateway;
            if(sessionStorage.getItem("ipfsGateway")) {
                gateway = sessionStorage.getItem("ipfsGateway");
            } else {
                gateway = defaulGateway;
            }
            const player = jwplayer('player').setup({
                image: jw.image,mute: false,volume: 100,autostart: jw.auto,repeat: false,abouttext: jw.text,aboutlink: jw.link,skin: {
                    active: jw.color
                },logo: {
                    file: jw.logo,hide: true,link: jw.link,margin: '15',position: jw.lposi
                },sources: [{
                    file: gateway + "<?PHP echo $_GET['source'].'/index.m3u8'; ?>",type: 'video/mp4'
                }],"cast": {}
            })
            player.on("complete",() => {
                console.log("video completed" + "<?PHP echo $next_episode; ?>");
                window.parent.eval(() => {
                    window.parent.location.href = window.parent.nextEpisode;
                })()
            })
        </script>
    </body>
</html>

https://github.com/libass/JavascriptSubtitlesOctopus https://www.jwplayer.com/html5-video-player/

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)