How can I display a custom error message for video player in angular for chrome browser

Viewed 15

I want to display a custom error message in <video> tag for .mov files in angular. Since chrome does not support .mov files directly, I want to show a custom error message for the video like 'This video can not be played, you can download the video' and give a download button to download the video and let user play in some external player.

I came across multiple events, like (canplay) but this event triggers when browser can play the video not the other way.

<video *ngIf="mediaType === 'video'" controls 
(canplay)="videoIsPlayable($event)" 
controlsList="nodownload nofullscreen noremoteplayback" 
disablepictureinpicture width="100%" height="100%"> 

  <source [src]="sanitizedUrl" [type]="mediaData?.mimeType" />
  Your browser does not support the <code>video</code> element.

</video>

Or is there any good open source library which can be used to solve this problem?

0 Answers
Related