Reputation: 53
i am using this code to play a video in a wordpress website. the code workes perfectly in all browsers but in chrome controls are disable and the video is not playing. any where else but that site the code works in chrome. changing the theme and disabling plugins did not solve the problem.i have changed the code and the format of videos several times but nothing works on that.
<video width="320" height="240" controls="controls">
<source src=" test.mp4" type="video/mp4" />;
<source src=" test.ogv" type="video/ogg" />;
<source src=" test.webm" type="video/webm" />;
</video>
Upvotes: 1
Views: 1949
Reputation: 53
well, the problem really was ssl. I just activated ssl on my download host and the video played nice and easy. thank you so much for your hint rank. if this link was not: https://w3schools.com/html/tryit.asp?filename=tryhtml5_video i still was searching for the problem on my website.
Upvotes: 1
Reputation: 1765
I know this has been answered, but a note on your source files. Browsers select the first file they "know how to play".
Since every browser that supports video also supports mp4, you'll never actually see any playback of the ogg or webm versions of the video. I would suggest:
<video width="320" height="240" controls>
<source src=" test.webm" type="video/webm" />
<source src=" test.ogv" type="video/ogg" />
<source src=" test.mp4" type="video/mp4" />
</video>
(and since webm and ogg fully overlap - you can probably save yourself from creating the ogg files altogether)
Upvotes: 0
Reputation: 2544
Have you already tried eding the syntax?
You should definately delete the semicolons after the source tags. This is Html, not a javascript code, so there should be no semicolons.
Also you can set the boolean attribute of controls with giving no value, simply put the "controls" inside the tags.
Give this a try, maybe it solves your problem with chrome:
<video width="320" height="240" controls>
<source src=" test.mp4" type="video/mp4" />
<source src=" test.ogv" type="video/ogg" />
<source src=" test.webm" type="video/webm" />
</video>
Upvotes: 0