How to display local video in a PhoneGap app?

后端 未结 3 1279
心在旅途
心在旅途 2021-02-09 12:09

How can I display a video in a PhoneGap app for iPad ?

I can\'t find any reference.

3条回答
  •  盖世英雄少女心
    2021-02-09 12:55

    In the Ipad's case you should use the html 5 video tag, and an example of its use is the following:

    
    

    I used it only with the mp4 extension, and my video was encoding with h264 codec for video and AAC codec for audio codec.

    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 :( !!');}
     );
    

    resources:

    http://diveintohtml5.info/ (html5/ipad/iphone)

    http://www.808.dk/?code-html-5-video (html5/ipad/iphone)

    http://smus.com/android-phonegap-plugins (Android)

提交回复
热议问题