简体   繁体   中英

How to play .MOV video file on Ionic 3?

I have tried using Ionic Native Video Player, however, it doesn't work. When I tried to play any videos, it just shows a black screen with no audio or whatsoever. Then, I tried HTML5 video tag. However, it only works for MP4 and doesn't work for .MOV file.

Is there any plugins or solution for this?

Ionic Native Video Player

ionViewDidLoad() {

    this.videoPlayer
      .play("../../assets/sample.mov")
      .then(() => {
       console.log("video completed");
      })
      .catch(err => {
        console.log(err);
      });
}

HTML5 Video Player

<video fullscreen="fullscreen" autoplay="true">
    <source src="../../assets/sample.mov" type="video/mp4">
</video>

this code working fine in my project

<video fullscreen="fullscreen" autoplay="true">
     <source src="../../assets/sample.mov" type="video/mp4">
</video>

enter image description here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM