Search code examples
androidpluginscordovaphonegap-pluginsandroid-video-player

Phonegap Video plugin?


When creating video plugin from the following link Phonegap Video plugin everything is working good & executing fine. But here that particular video is saving into our internal storage & playing. But what i want is need to play that video directly without saving into internal or external storage. I tried, but getting error in simulator as Sorry,this video cannot be played. I don't know where i am doing mistake. Can anyone please help me with this.

Waiting for your reply & Thanks in advance....

code:

//in button onclick="show()" method i am passing the particular url....

     function show()
    {

  window.plugins.videoPlayer.play("file:///android_asset/www/BigBuckBunny.mp4");
    }

Solution

  • Okay so the VideoPlayer can play videos from 3 different types:

    1) SD Card

    file:///sdcard/BigBuckBunny.mp4
    

    which will play directly from the SD Card. The SD Card on Android is fully open with privileges so any application will be able to access the file.

    2) Assets

    file:///android_asset/www/BigBuckBunny.mp4
    

    The only app that can get access to the assets is your own. So in order for the VideoPlayer app, which we start via an Intent, to get access to the video is to copy it to a temporary location on the sd card.

    3) HTTP

    http://www.bigbuckbunny.com/BigBuckBunny.mp4
    

    The Video Player will just stream this video.