PSPK
PSPK

Reputation: 29

How to play videos of different formats in html using video tag

I have a page where I need to display videos with different extensions.

Example: .mp4, .wmv

<video width="100%" controls>
   <source data-ng-src="{{video.url}}" type="video/*">
        Your browser does not support this video.
</video>

I just put a star but it is not playing my video.Showing an empty screen.Can anyone please suggest me help.Thanks.

Upvotes: 0

Views: 1779

Answers (1)

Sreekanth Reddy Balne
Sreekanth Reddy Balne

Reputation: 3424

In case you need it to support multiple types of videos, you must add multiple source of those videos. The browser picks the appropriate one to play.

And moreover, your code doesn't contain the src attribute.

<video width="100%" controls>
  <source src="http://www.educationalquestions.com/video/ELL_PART_5_768k.wmv" type="video/wmv">
  <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
  <source src="https://www.w3schools.com/html/mov_bbb.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>

Upvotes: 3

Related Questions