Javascrips youtube字幕不适用于移动全屏

时间:2017-09-11 09:02:14

标签: javascript html iframe youtube

请帮助!!!

我使用过这段代码: http://siloor.com/youtube.external.subtitle/examples/srt

为youtube视频制作SRT字幕。 但字幕不能在手机全屏幕上运行!! (尤其是iphone)

请帮助!!!!

这是视频: http://www.simplepsy.co.il/corner-of-surprises/dad-handle-his-daughters-walmart-tantrum/

这是我使用的代码 - 在此代码中我想要禁用FULL SCREEN按钮,因为这个问题。

<iframe id="video" width="100%" height="400" src="https://www.youtube.com/embed/xBi9jaOFcRU?playsinline=1" frameborder="0" fs="0"></iframe>
<script src="http://www.simplepsy.co.il/wp-content/uploads/2017/09/youtube.external.subtitle.js"></script>
<script src="http://www.simplepsy.co.il/wp-content/uploads/2017/09/subtitles.parser.js"></script>
<script>
var httpRequest = new XMLHttpRequest();

httpRequest.onreadystatechange = function() {
    if (httpRequest.readyState === XMLHttpRequest.DONE) {
        var subtitles = parser.fromSrt(httpRequest.responseText, true);

        for (var i in subtitles) {
            subtitles[i] = {
                start : subtitles[i].startTime / 1000,
                end   : subtitles[i].endTime / 1000,
                text  : subtitles[i].text
            };
        }

        var youtubeExternalSubtitle = new YoutubeExternalSubtitle.Subtitle(document.getElementById('video'), subtitles);
    }
};

httpRequest.open('GET', 'http://www.simplepsy.co.il/wp-content/uploads/2017/09/walmartsubt.srt', true);
httpRequest.send(null);
</script>

0 个答案:

没有答案