DEV Community

kapil soni
kapil soni

Posted on

Video tag is not working with avi format?

Hii team,
I have created a website in Angualr 7 and I have used video tag for display the video but problem is that
Video tag is not working with avi and wmv video format but another mp4 it's working any idea why not working

Top comments (3)

Collapse
 
leobm profile image
Felix Wittmann • Edited

The HTML5 video Element does not support all video formats. There are differents between Browsers and Operations Systems too.

Maybe use a service like: cloud.qencode.com/ to transcode your videos to the supported formats.

Edit: Or use a opensource desktop software like: handbrake.fr/
to convert the videos by hand.

Here is a good overview about supported videos formats in different browsers.
caniuse.com/#search=video%20format

In the end you can add multiple files to the HTML5 video tag element.

<video controls>
  <source src="somevideo.webm" type="video/webm">
  <source src="somevideo.mp4" type="video/mp4">
  I'm sorry; your browser doesn't support HTML5 video in WebM with VP8/VP9 or MP4 with H.264.
</video>```

Collapse
 
kapilsoni101 profile image
kapil soni

Sir thanks for ur reply sir,what I do for play avi format video
Sir it's if tried above code for avi format video.
I have tried with multiple Angualr7 video player but nothing worked for me.tell me any other way to play avi format video?

Collapse
 
leobm profile image
Felix Wittmann • Edited

The html video element can't play the avi video format.
Another idea I have: Upload your avi video to youtube and use
a angular library like
npmjs.com/package/ngx-youtube-player
or
npmjs.com/package/ngx-embed-video
to embed the youtube video into your site.