html5视频标签与Android全屏播放

编程入门 行业动态 更新时间:2024-10-26 16:29:37
本文介绍了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全屏播放

本文发布于:2023-07-13 03:17:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1099780.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:全屏   标签   视频   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!