Video doesn't play in iOS

So, I’m trying to play a video on the background of an Ionic app. It all goes well on android, but on iOS it does not load. There isn’t any error message logged on the console. I saw 2/3 threads with the same problem, but I couldn’t figure out a solution. Can someone help me, please?

Code:

<video class="video" autoplay muted loop>
    <source [src]='videoPath' type="video/webm">
</video>
this.videoPath = this.videoURL('assets/video/background.webm');

videoURL(url : string) : SafeResourceUrl {
    return this.domSanitizer.bypassSecurityTrustResourceUrl(
      url
   );
  }

The problem was: iOS doesn’t support WebM video format.

Mp4 works just fine.

1 Like