Inzamam Malik
Inzamam Malik

Reputation: 3435

How to play local video in ionic app <video> tag is not working

in ionic app

i am unable to play video from my project folder...

i'm trying to make an app with 3 to 4 static videos which will play on device without internet connection

but i unable to do this

<div class="modal transparent full screen-player" ng-click="closeModal()">
    <video ng-src="img/test.mp4" class="centerme" controls="controls" autoplay> 
    </video>
</div>

currently i'm using this code,

video is playing very fine on ionic serve with this code but when i compile to .apk file by ionic build android or ionic run android this code stop working on device... a video player is appearing on device but not play video..

there is no error in chrome://inspect

i have also tried $cordovaMedia http://ngcordova.com/docs/plugins/media/

but this is not for playing video i think its documentation only showing examples for audios

Upvotes: 2

Views: 8046

Answers (2)

Aashay karekar
Aashay karekar

Reputation: 960

make the local server of the folder if you want to access file for mobile

below link will give a clear explanation of how to do it.

https://stackoverflow.com/a/57494421/7456041

Upvotes: 0

Inzamam Malik
Inzamam Malik

Reputation: 3435

cross walk solved my problem cross walk make me able to use <video> tag in ionic application which is not allowed by default

it is about ionic 1

example code: https://github.com/malikasinger1/ionic-video-player

Upvotes: 3

Related Questions