Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do only the controls show up when using HTML5 video on Chrome?

I'm using the following HTML5 to display video, but only the controls show up in Chrome. Works fine in Safari and Firefox:

<video width="720" height="480" controls="controls" preload="preload">
    <source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.ogv" type="video/ogg; codecs=theora,vorbis" >
    <source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.mp4" type="video/mp4">
    Your browser doesn't support video.
</video>

Any ideas?

like image 729
HWD Avatar asked Apr 11 '26 06:04

HWD


1 Answers

Looks to me like the first <source> tag has a malformed type attribute:

<source src="<?php bloginfo('url'); ?>/wp-content/uploads/Reel.ogv" type="video/ogg; codecs=theora,vorbis" >

should be type="video/ogg; codecs='theora, vorbis'" if I remember correctly. Also just try type="video/ogg".

like image 125
Bradley Mountford Avatar answered Apr 12 '26 20:04

Bradley Mountford



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!