简体   繁体   English

如何使html5视频标签在Android 4.x上正常工作

[英]How do I make the html5 video tag to work on Android 4.x

I have a web app (HTML5 + js + mp4 animations) That I want to encapsulate within a Android webview. 我有一个Web应用程序(HTML5 + js + mp4动画),我想将其封装在Android webview中。 Problem is that the mp4 animations (simple html5 video tag with local mp4 files) are not running on android 4.x devices. 问题是mp4动画(带有本地mp4文件的简单html5视频标签)未在android 4.x设备上运行。 What are my alternatives? 我有什么选择? Animated gifs? GIF动画? Flash animations? Flash动画?

The code is very straight forward: 该代码非常简单:

Html: HTML:

<video id="myvid"></video>

JS: JS:

var video = window.gedElementById('myvid');
video.src = "../movies/myvid.mp4";
video.play(); // Doesn't work on Andoroid 4.x

I have worked on this problem for many weeks now and I have given up. 我已经在这个问题上工作了很多周了,但我已经放弃了。 So I'm looking for alternatives. 所以我正在寻找替代品。 Any suggestions? 有什么建议么?

Couldn't you convert it to a file type which is playable? 您不能将其转换为可播放的文件类型吗? Or you could host it online and pull it in from the server. 或者,您可以在线托管它,然后将其从服务器中拉出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM