在iPad上,视频无法使用HTML5全屏显示 [英] On iPad, video doesn't go fullscreen using HTML5

查看:935
本文介绍了在iPad上,视频无法使用HTML5全屏显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用HTML5在iPad上显示全屏视频,但我得到的结果是:

I tried getting a video to display fullscreen on iPad using HTML5, but the result I get is:


  1. 首次点击视频是播放

  2. 第二次点击全屏视频即将播放。

我不能同时播放视频并在激活后全屏显示。

I can't get both the video to play and turn fullscreen when activated.

以下是我一直使用的来源:

Here's the source I've been using:

$(document).ready(function() { 
    $("#te").bind('click', function() { 
        $('#myVideoTag')[0].play(); 
        $('#myVideoTag')[0].webkitEnterFullScreen(); 
    }); 
});


推荐答案

我遇到了同样的问题,而setTimeout似乎成为我遇到的最佳解决方案。

I was running into the same issue, and setTimeout seems to be the best solution I've run into.

这对我有用:

注意:videoEnable函数通过a标记中的onclick属性调用

note: the videoEnable function is called through an onclick attribute in the "a" tag

//define function

var videoEnable = function(videoCount) {

    //Play video
    $('video').get(videoCount).play(); 

    //Timeout before fullscreen registers
    setTimeout(function(){
        $('video').get(videoCount).webkitEnterFullscreen();
    }, 2000);
}

这就是你要找的吗?

这篇关于在iPad上,视频无法使用HTML5全屏显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆