djobi
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: MP4 (H264) video doesn’t always playTo anyone with the same problem, I figured out something that made it work, just add the “muted” keyword in the code. Here’s the code I used :
<video muted autoplay preload="auto"> <source src="https://mywebsite.com/wp-content/uploads/2019/03/Myvideo.mp4" type="video/mp4> <source src="https://mywebsite.com/wp-content/uploads/2019/03/Myvideo.webm" type="video/webm"> <source src="https://mywebsite.com/wp-content/uploads/2019/03/Myvideo.ogv" type="video/ogv"> Your browser does not support the video tag. </video>The explanation seems to be that Chrome decides not to allow videos with audio to autoplay, but cannot detect by itself that a video contains no audio, and therefore needs the “muted” tag to be added for the video to be autoplayed. It’s not a bad thing, but that’s really opaque, this information wasn’t that obvious to find.
Hope this helps someone, good luck.- This reply was modified 7 years, 2 months ago by djobi.
Forum: Fixing WordPress
In reply to: MP4 (H264) video doesn’t always playFrom the document about the video element, it also seems like the video should be working with Chrome 70 and Firefox 63. Although I didn’t know that Safari disabled autoplay by default, which is an interesting thing to know.
But Chrome and Safari doesn’t seem to have this feature, according to the document.Thanks for your advice about autoplay, I absolutely agree with this. I made sure that my video had no audio, was lightweight (a mere 47 ko), and didn’t appear on mobile devices. I didn’t find a better way to implement this animation yet, using my current site builder.
Forum: Fixing WordPress
In reply to: MP4 (H264) video doesn’t always playThank you for your answer @joyously !
I looked at these documents, but it seems like my problem doesn’t fall into the “Known Issues” of this document so far.
For example, according to the document, all versions of Chrome should display the video without any problems, as it is encoded in “MPEG-4/H.264” format, and I’m running the version 70 for Chrome and 63 for Firefox.The resolution of the video is lower than 1920 x 1088, it has no audio track, and the videos are a few seconds long.
But still, they do not always appear.Could there be reasons other than the browsers version for this to happen ?