Closed kirillstar1 closed 9 months ago
Hey @kirillstar1 thanks for reaching out! Happy New Year! ✨
Sorry for the late reply! Cheers!
You may see this error on your demo site if you scroll down to "HTML5 Video" and then refresh the page. In this case, the video will not start and an error will also appear in the console
@kirillstar1 sorry to bug you bud, but can you add a screenshot of the error here? 🙏 I can't seem to recreate it. Also what browser are you using? What version? Thanks!
Here you can see the video: https://youtu.be/JDV2LS7FL9g As I wrote earlier, when the page is reloaded, the video does not start, but an error is registered. If you start the video manually, it turns on with sound, although by default it should be muted. The browser is Chrome v.120.0.6099.225 if I am not mistaken
UPD: While I was writing this text, a browser update arrived, after which I checked this bug again and it turned out that part of it was fixed) Now the video starts, but still with sound: https://youtu.be/V5CYrYCY4uM Now browser version is 121.0.6167.86.
@kirillstar1 wow! Thanks for the screen capture! 🙏 I'll take a look at it in detail when I have a moment! We'll get to the bottom of this! Ah it's a Chrome only issue, you didn't have to go through all of the trouble to record - you could just have told me your browser. But thanks anyway! I'm recreating the issue on Chrome and Firefox! This is super weird cause this works how it should on Safari and Safari is the one that always works differently.
The attributes are all there, probably we need to explicitly tell them muted="true"
. Though this is not how these attributes work by specification - they should work like a hidden
attribute, without a vaule.
To disable video autoplay, autoplay="false" will not work; the video will autoplay if the attribute is there in the
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#autoplay
I'll let you know when I have the update!
P.S. the mute "warning" you are seeing is for youtube or vimeo, it just says it doesn't recognize the attribute.
@kirillstar1 I think I've fixed it! So here is my interpretation of the issue:
document.createElement('video')
video element object and then add the attributes for "mute" and "autoplay"So I think that it will work now. I'll publish the new release in a bit and let you know!
Thanks for your help @kirillstar1 I wouldn't have detected this without you - since I only use Safari 😆
@kirillstar1 version 1.1.4 is published! Do let me know if it fixes the issue!
Yep, I think it works great! Thanks for fixing the issue and answering. Have a good day!
My pleasure! Thanks for helping me out!
Hi. I found a couple of bugs that make it a little difficult to work.
First: when using html video, you cannot run it without sound. I tried specifying parameters inside the div tag, and also passing them during the function call. I can still control the volume using the suggested functions
mute()
andsetVolume()
, but it would be more convenient to run the background video without sound by default. Because of this bug, an error appears when the browser does not allow the automatic launch of a video with the sound turned on.Second: if you pause the video, and then scroll the page and return to the video, it automatically continues playing, although the indicator shows that it is paused. After this, to pause playback again, you need to press the button to “unpause”, and then press again to pause.
Both of these errors are also present on the demo page of the project.