如何在PhoneGap应用程序中显示本地视频? [英] How to display local video in a PhoneGap app?
问题描述
如何在iPad的PhoneGap应用程式中显示影片?
How can I display a video in a PhoneGap app for iPad ?
我找不到任何参考。
推荐答案
在Ipad的情况下,您应该使用html 5视频标签,其使用示例如下:
In the Ipad's case you should use the html 5 video tag, and an example of its use is the following:
<video controls="controls" autoplay="autoplay">
<source src="yourVideo.mp4" type="video/mp4" />
<source src="yourVideo.webm" type="video/webm" />
<source src="yourVideo.ogv" type="video/ogg" />
</video>
我使用它只与mp4扩展名,我的视频编码与h264编解码器的视频和AAC
I used it only with the mp4 extension, and my video was encoding with h264 codec for video and AAC codec for audio codec.
在Android中,我使用了一个来自github的Phonegap插件,名为web Intent(https://github.com/phonegap/phonegap-plugins/tree / master / Android / WebIntent)使用的示例是:
In the Android's, I used a Phonegap plugin from github called web Intent (https://github.com/phonegap/phonegap-plugins/tree/master/Android/WebIntent) a example of usage is:
window.plugins.webintent.startActivity({
action: WebIntent.ACTION_VIEW,
url: 'http"//yourVideo.mp4'},
function() {console.log('Is wirking :D!');},
function() {console.log('Failed to open the URL :( !!');}
);
资源:
http:// diveintohtml5。 info / (html5 / ipad / iphone)
http://diveintohtml5.info/ (html5/ipad/iphone)
http://www.808.dk/?code-html-5-video (html5 / ipad / iphone)
http://www.808.dk/?code-html-5-video (html5/ipad/iphone)
http://smus.com/android-phonegap-plugins (Android)
这篇关于如何在PhoneGap应用程序中显示本地视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!