Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70764

Choose video with cameraoptions and then play it

$
0
0

@christopherkock wrote:

Hello,

I want the user to be able to choose a video from their photolibrary in phone with cameraoptions and then play this video with a tag after choosing it. However my problem is that I always get a broken video showing even thought i get the URL.

My html-file:
<video [hidden]=“hideChosenVideo” src="{{chosenImageHolder}}" [src]=“chosenImageHolder” type=“video/mp4”>

This is my TS-code for this right now:
cameraOptions = {
quality: 50,
//destinationType: this.camera.DestinationType.FILE_URI,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.ALLMEDIA,
allowEdit: true,
sourceType: this.camera.PictureSourceType.PHOTOLIBRARY
};
const chosenFile = await this.camera.getPicture(cameraOptions);
if (isMovie === ‘MOV’ || isMovie === ‘mp4’){
this.camera.getPicture(cameraOptions).then(async (videoUrl) => {
if (videoUrl){
this.chosenVideo = videoUrl;

This gives me a videoUrl that looks like this : “file:///private/var/mobile/Containers/Data/Application/498FBB4A-7316-4E8E-AC08-26F9E8D809E8/tmp/videoname.MOV”

ive tried remove ‘/private/’ and also “file:///private/” from the string but that doesnt help

Ive googled and searched around alot concerning this without any success…
What do I need to do to play the video chosen from the local phone storage?

Thank you in advance!

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70764

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>