Play video from local file (mobile)

Play video from local file (mobile)

  

HI there,

Currently I'm developing a mobile app that can record video and audio and display the media, I have succeeded the recording process for both video and audio and my next goal is to display what I've record.

The output of the recording is a path to the file e.g file:///path/to/the/media/file.mp4

So far, I've tried using built-in Video controls, HTML5 <video> and <audio> tag and put the filepath as the src, but both of them won't display the recorded media.

Any suggestion how to make my app able to play a video or audio from local file?

The plugin that I'm using to record the media is https://github.com/apache/cordova-plugin-media-capture

Hi Albertus,

You should check the forge sample app Streamer: https://www.outsystems.com/forge/component/1708/streamer/.

The app allows you to play a video directly from the server or download it and play it from local storage.


Best regards,

Albertus Adityo Wahono wrote:

HI there,

Currently I'm developing a mobile app that can record video and audio and display the media, I have succeeded the recording process for both video and audio and my next goal is to display what I've record.

The output of the recording is a path to the file e.g file:///path/to/the/media/file.mp4

So far, I've tried using built-in Video controls, HTML5 <video> and <audio> tag and put the filepath as the src, but both of them won't display the recorded media.

Any suggestion how to make my app able to play a video or audio from local file?

The plugin that I'm using to record the media is https://github.com/apache/cordova-plugin-media-capture

Hi Albertus, 

i've tried to use https://github.com/apache/cordova-plugin-media-capture, but when launch the apps in android, it get "cannot read properties 'capture' of undefined"

any ideas how to make it works?


thanks


ari auditianto wrote:

Albertus Adityo Wahono wrote:

HI there,

Currently I'm developing a mobile app that can record video and audio and display the media, I have succeeded the recording process for both video and audio and my next goal is to display what I've record.

The output of the recording is a path to the file e.g file:///path/to/the/media/file.mp4

So far, I've tried using built-in Video controls, HTML5 <video> and <audio> tag and put the filepath as the src, but both of them won't display the recorded media.

Any suggestion how to make my app able to play a video or audio from local file?

The plugin that I'm using to record the media is https://github.com/apache/cordova-plugin-media-capture

Hi Albertus, 

i've tried to use https://github.com/apache/cordova-plugin-media-capture, but when launch the apps in android, it get "cannot read properties 'capture' of undefined"

any ideas how to make it works?


thanks


HI Ari,

Yes, it seems outsystems did something to cordova plugin, I've created a ticket to them regarding this issue.

It was working before, and if you have more than one custom cordova plugin make sure you check and re-test it again. 


now its working again for me, 

btw, Any enlightenment regarding playing video from url like file:/storage//to/file.mp4 ?

tried Video widget but not works

ari auditianto wrote:

now its working again for me, 

btw, Any enlightenment regarding playing video from url like file:/storage//to/file.mp4 ?

tried Video widget but not works

good to hear that, did you made some changes on your plugin somehow? because I just tried to generate a new APK and the record functionality still broken.

Would you mind to share your plugin oml, so that I can check what I missed on mine?

My workaround to play the media is using File Viewer plugin, it's available in Forge.


now i cant do it anymore, i hit capture undefined again, 

i think it's like what u said, its not stable, 

Hello.

Are you using the "head" of the plugin? They commited in that repository yesterday, so, if you're using the head you will get unstability and no control.

As a best practice, you should point to a stable release. Try using:

https://github.com/apache/cordova-plugin-media-capture#1.4.3


Note that you need to regenerate the mobile app and reinstall in the device.

Thanks



César Afonso wrote:

Hello.

Are you using the "head" of the plugin? They commited in that repository yesterday, so, if you're using the head you will get unstability and no control.

As a best practice, you should point to a stable release. Try using:

https://github.com/apache/cordova-plugin-media-capture#1.4.3


Note that you need to regenerate the mobile app and reinstall in the device.

Thanks



Hi Cesar,

I have modified the config to get the repository by specific tag, but it didn't solve the problem. 

let me know if anyone has solve this issue please.


thanks.


Plex can now play local video files on Android, no media server required.  new option means you can load up those files on an SD card, or just sync them over to your device, then use Plex's Android app to watch them while on the go. It will also allow you to open files you have saved in another app – like Dropbox, for instance – and then play them in Plex