Skip to content Skip to sidebar Skip to footer

How To Play Video Using Html5 Videoplayer In Android Phonegap?

I have created application in android phonegap.I want to play video using html5 video player. My code is: <

Solution 1:

Android has issues with playing video and can often only be triggered via JavaScript by adding a click event handler to the video element and playing the video once that is activated.

For example:

function play() {
   var video = document.getElementById('video');
   video.addEventListener('click',function(){
      video.play();
   },false);
}

You will probably need to adapt this code to work with yours though.


Solution 2:

Everything immediately worked for me. I'm using an iOS emulator.

Make sure you set the permission to go to that URL.

Cordova.plist --> externalhosts

You can use a wildcard to cover several URL's into one.


Solution 3:

Try to add this:

data-setup='{"controls":true}'

Solution 4:

Add the following to your main Activity

@Override
public void init() {
    super.init();

    this.appView.getSettings().setPluginsEnabled(true);
}

Solution 5:

We cant play video using in android. it works fine in iphone though. try using plugin for the purpose. check this out VideoPlayer Plugin


Post a Comment for "How To Play Video Using Html5 Videoplayer In Android Phonegap?"