html5视频标签与Android全屏播放 [英] html5 video tag to play full screen with Android

查看:115
本文介绍了html5视频标签与Android全屏播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个移动网站,当有人点击某个链接时,我想要播放该视频:

I'm creating a mobile site where I have a video I'd like to play when someone clicks on a link:

<div id="player"></div>
<a href="#" onclick="DoNav('<?php echo $url; ?>');" title="Click to play video"> <?php echo $result_videos[$i]["camera_name"]; ?> </a>

<script type="text/javascript">
function DoNav(theUrl)
{

  // only add the player if it doesn't yet exist
  if($('#myfileplayer').length == 0) {
    var mydiv = $("#player");
    var myvideo = $("<video id='myfileplayer' src='"+ theUrl + "' width='320' height='240' controls></video>");
    mydiv.append(myvideo);
  } else {
    $('#myfileplayer').attr("src",theUrl); 
  }

} 
</script>

使用iPhone,效果很好,我点击视频即可全屏显示。 Android也可以,但它需要您点击要播放的视频然后点击全屏。你是否可以像玩iPhone一样进入全屏?

With the iPhone, this works great, I click on video and it goes full screen. Android works as well but it requires you to click the video to play then click on the full screen. Is it possible to get to the full screen like iPhone just when you hit play?

推荐答案

我已经放弃了这一点。我的结论是Android设备上的html5视频标签会破坏大块。它适用于某些设备但不适用于其他设备。并且没有像3.x或4.x那样的常见标准,它似乎是随机的。我希望这会很快好转,特别是因为闪存支持不再存在。

I've given up on this. My conclusion is that the html5 video tag on Android devices blows chunks. It works in some devices but not on others. And there is no common criteria like 3.x or 4.x, it just seems to be random. I hope this gets better sometime soon especially since flash support is not longer existent.

奇怪地坚持使用简单的 href 似乎是最一致的。你失去了一些控制但比视频标签更好......至少到目前为止。

Oddly sticking with a simple href seems to be the most consistent. You lose some controls but way better than the video tag...at least so far.

这篇关于html5视频标签与Android全屏播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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