I have a problem playing a video that is locally stored in an ionic application. I think I tried all possible solutions without success. So I decided to ask here. I will try to describe how my application is built.
My root folder: /myApp/www/
In index.html inside the body tag, I only have a pair of ion-nav-view tags. Im uses 3 patterns stored in:
/views/homepage.html /views/sights/list.html /views/sights/detail.html
Inside /js/app.js I have controllers for each template, and until everything works fine.
Inside /views/sights/detail.html Im using a video tag:
<div class="video-container"> <video controls="controls"> <source ng-src="/video/vid01.mp4" type="video/mp4"/> </video> </div>
I have this set:
<ion-content overflow-scroll="true"> <manifest android:hardwareAccelerated="true" ....> inside AndroidManifest.xml <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Other src paths I've tried:
file:///video/vid01.mp4 file:///android_asset/www/video/vid01.mp4 file:///mnt/sdcard/media/video/vid01.mp4
But it works:
http:
Unfortunately, for me this is not an option. The application will be used on site without any internet connection, so I need to have a video inside the application.
Locally saved videos work fine only if I run the application from cmd: ionic serve .
When I try to deploy an application on Android (4.4.4 kitkat), for example: ionic run android everything works fine, but the video refuses to play.
I think I literally tried everything. Unfortunately, all the tutorials for playing video in an ionic application are made using online video, and these examples only work in the browser, and not on Android devices.