Open NashIlli opened 5 years ago
Hi, Try - file:///storage/emulated/0/YOUR_FOLDER/YOUR_FILE
Hi,
If your video path on ionic is as below, for eg. /src/assets/video/test.mp4
Then, your code to access to that video is:- file:///android_asset/www/assets/video/test.mp4
Hi,
If your video path on ionic is as below, for eg. /src/assets/video/test.mp4
Then, your code to access to that video is:- file:///android_asset/www/assets/video/test.mp4
Hi,
It is not working for me :/ No error msg on the console. It works fine with a hosted video file but impossible to play a local file embeded on the app.
Does someone have an idea of the correct path to set ? (I am using capacitor & ionic 4)
Hi, If your video path on ionic is as below, for eg. /src/assets/video/test.mp4 Then, your code to access to that video is:- file:///android_asset/www/assets/video/test.mp4
Hi,
It is not working for me :/ No error msg on the console. It works fine with a hosted video file but impossible to play a local file embeded on the app.
Does someone have an idea of the correct path to set ? (I am using capacitor & ionic 4)
Hello, somehow it didn't work for me at first, but after trying something out, it works fine now.
Here's what I did, but not sure which one fixed it.
Then I rebuild my APK, it works fine now. I noticed that the latest android version has a different config in its Android "build.gradle" file.
People suggesting this, (Project folder -> platforms -> android -> build.gradle and then change defaultCompileSdkVersion to 30 instead 29.) will bypass the build, but not sure if it will make the plugin works.
Hi Guys Im kind of new to cordova and I know this an old post,
Im trying to play a local video on my app using an HTML5 tag but it seems the seekbar is not working so I ended up using this plugin but unfortunately I'm having an error,
[INFO:CONSOLE(2)] "Uncaught ReferenceError: VideoPlayer is not defined", source: https://localhost/main.js (2)
<button id="MyButton" onclick="playVideo()">Play video</button>
JS File: function playVideo() { VideoPlayer.play( "file:///android_asset/www/assets/dummy-video.mp4", { volume: 0.5, scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING }, function () { console.log("video completed"); }, function (err) { console.log(err); } ); }
I dont kown where I have to locate my local videos and how I have to write the path to play my video in my Ionic Project.
Thanks for all!