Shalkam
Shalkam

Reputation: 783

Cordova 5.3.3 - How to play local mp4 video

I am having trouble playing a local mp4 video.

I've tried the instructions here http://forum.xda-developers.com/showpost.php?p=63139114&postcount=9 but it doesn't work.

I also have tried a couple of cordova plugins but they seem to work only for older version.

Currently I am using this code

<video id="action" controls>
                        <source src="file:///android_asset/www/videos/jospan.mp4" type="video/mp4">
                    </video>

Regards,

Mostafa

Upvotes: 1

Views: 2135

Answers (1)

Carlos Galeano
Carlos Galeano

Reputation: 386

You have to call the file from the folder inside the www bin about to the index.html file.

For example this taxo:

  • www
    • index.html
    • videos
      • yourvideo.mp4
    • otherBins/

So you have to call the file from this bin on the source tag:

source src="videos/yourvideo.mp4" type="video/mp4"

The video will be inside your app.

I hope this work for you! My best!

Upvotes: 1

Related Questions