Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PhoneGap Android VideoPlayer Plugin example
<!DOCTYPE HTML>
<html>
<head>
<meta name="viewport" content="width=320; user-scalable=yes" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>PhoneGap</title>
<script type="text/javascript" charset="utf-8" src="phonegap-1.1.0.js"></script>
<script type="text/javascript" charset="utf-8" src="video.js"></script>
<script type="text/javascript">
function init(){
document.addEventListener("deviceready", console.log('ready'), true);
}
function playVideo(vidUrl) {
window.plugins.videoPlayer.play(vidUrl);
}
</script>
</head>
<body onload="init();">
<a href="#" onclick="playVideo('http://path.to.my/file.mp4')">Play HTTP</a><p/>
<a href="#" onclick="playVideo('file:///path/to/my/file.mp4')">Play File</a><p/>
</body>
</html>
@danigit001

This comment has been minimized.

Copy link

@danigit001 danigit001 commented Jan 18, 2013

Hi macdonst, i will be really gratefull if you could post an full project example for cordova 2.2.0, im trying to make it work but unsuccessfully. Please help.

@djoseph74

This comment has been minimized.

Copy link

@djoseph74 djoseph74 commented Feb 6, 2013

Here's what I have. Its basically the same thing as you see above:

<body onload="javascript:init()">
    <div class="app">
        <p><a href="#" onclick="playVideo('https://www.youtube.com/watch?v=gYOLV66XukY')">Play File</a><p/>
    </div>
    <script type="text/javascript" src="cordova-2.3.0.js"></script>
    <script type="text/javascript" charset="utf-8" src="video.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
    <script type="text/javascript">
        app.initialize();

        function init()
        {
            document.addEventListener("deviceready", console.log('ready'), true);
        }

        function playVideo(vidUrl) 
        {
            window.plugins.videoPlayer.play(vidUrl);
        }
    </script>
</body>
@Peter125

This comment has been minimized.

Copy link

@Peter125 Peter125 commented May 7, 2013

Hello, please can anyone help me, I have problems to get the videoplayer plugin working in dreamweaver cs6.
Have anyone an link to a step by step tutorial for it?

Thanks for answers

Best regards

@llangill

This comment has been minimized.

Copy link

@llangill llangill commented Jun 11, 2015

Hello,

Does anyone know if this plugin will work with Facebook embedded video? If not, does anyone know how to get Facebook video to work on a page?

L.

@mohammad-ali021

This comment has been minimized.

Copy link

@mohammad-ali021 mohammad-ali021 commented Aug 30, 2015

is there any step by step tutorial of this plugin, because I have done the all steps but it didn't work for me in cordova 3.6!
any help ?

@sergiorafaelledezmavazquez

This comment has been minimized.

Copy link

@sergiorafaelledezmavazquez sergiorafaelledezmavazquez commented Feb 29, 2016

Play File


So I worked ; Opened window youtube in my Android

@faustoct

This comment has been minimized.

Copy link

@faustoct faustoct commented May 22, 2016

Does anyone know how to play embedded facebook videos in phonegap? I know that is possible to play the original mp4 but I'm not sure how trustworthy it is.

@varmarajnikant

This comment has been minimized.

Copy link

@varmarajnikant varmarajnikant commented Mar 17, 2017

hi , i have create a one cordova project and i want to play video in my app which is store in my phone
please tell me solution on varmarajnikant7051varma@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment