How to play the captured video in ionic?

Hey am able to capture the video in ionic 2 but unable to display in the front end. I did check for some solutions in ionic forums but couldn’t get it done. This is my code

videoCapture(mediaType) {

var options = {
  limit: 1,
  mediaType: mediaType,
   duration: 10

 this.mediaCapture.captureVideo(options).then((data: MediaFile[])=>{

 if ('android') && mediaType === {
 /*** some code ***/

 }else {
    let videoData = JSON.stringify(data);

    let res1 = JSON.parse(videoData);
    this.videoURL = res1[0]['fullPath'];
    this.videoType = res1[0]['type'];

    this.safeUrl = this.sanitizer.bypassSecurityTrustUrl(this.videoURL);


Am getting videoURL, and the following is my HTML

 <video controls="controls" preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline" 
width="300" height="300" class="videoPlayer">  
<source [src]="videoURL" type="video/mp4"/></video>

No idea why am unable to display my video. Any help?

Also this is the link I followed…

I made some mistake. Some workaround resolved my issue.


I am also facing the same issue.

 Can you kindly post your code which is working?


Can you please follow the link and try? That’s the solution I got