Purushottam zende
Purushottam zende

Reputation: 552

mp4 Videos not playing on Website

I am uploading the mp4 videos on server and playing them on the front end embeded with HTML video tag. Below is the code which is used.

<video width="480" height="294" controls="controls">
    <source src="http://server.com/user_data/machine/133/videos/1_2.mp4" type="video/mp4">
    <source src="http://server.com/user_data/machine/133/videos/1_2.mp4" type="video/webm">
    <source src="http://server.com/user_data/machine/133/videos/1_2.mp4" type="video/ogg">      
</video>

Problem is, it plays some of the videos and some not. Both are mp4 but it plays some of the videos and others not. And for some, they does not video but only the audio.

Can you help me out on what to check and how to resolve this.

thanks,

Upvotes: 1

Views: 3552

Answers (3)

Eric
Eric

Reputation: 18912

Also make sure your website serves the right MIME-type for the file. If you are using nginx you need to install the http_mp4_module.

Upvotes: 0

Syed Ali Hamza
Syed Ali Hamza

Reputation: 1

Zende if you want to embed .webm or .ogg format of video in website then you have to convert the video in .webm or .ogg format

Upvotes: 0

Afsar
Afsar

Reputation: 3124

For different source you should have different types of video

File    Type
MP4     video/mp4
WebM    video/webm
Ogg     video/ogg

Upvotes: 1

Related Questions