Reputation: 2016
I have uploaded video (.mp4) in my site but in chrome it always display audio. but when I download it and play to windows player it display fine with audio and video.
someone one told me to convert video and then upload but those video uploaded by our customer so I can't tell them to convert any specific format and upload, Because it's a question of my reputation, I can't say that to people like that.
The below code which I try but it always display as audio, and dose not display and video thumb.
.bg-image {
border: 1px solid #999;
float: left;
}
<div class="bg-image" data-path="/10001100.mp4">
<video width="100px" height="100px" src="/assets/videos/10001100.mp4" type="video/mp4">
<source src="/assets/videos/10001100.mp4" type="video/mp4" />
</video>
</div>
<div class="bg-image" data-path="/vl44.mp4">
<video width="100px" height="100px" src="/assets/videos/vl44.mp4" type="video/mp4">
<source src="/assets/videos/vl44.mp4" type="video/mp4" />
</video>
</div>
you can run and check above snippet, in that fist video dose not display preview, but other video display preview. both video are .mp4 but one is working other not. but if you download first video then it working fine in you computer player.
Please help me. I really need this. I saw a lot of questions in Stack overflow but I didn't find any solution for me.
Upvotes: 1
Views: 1875
Reputation: 1765
In your code above, the first video does not play because the codec is not supported in Chrome.
The video codec (measured at https://ffprobe.a.video) is:
codec name : mpeg4 (which is H.263)
codec long name : MPEG-4 part 2
The 2nd video does play in Chrome, and the video codec is:
codec name : h264
codec long_name : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
H.264 support is pretty universal, so re-encode the first video to h264 video, and it'll play,
Upvotes: 4
Reputation: 11
Your problem is with the file encoding. HTML5 supports very few types and, sadly, every browser can play only part of this narrow list. Html Video player plays sound but not video
Upvotes: 0