bduffley
(Bonnie )
January 31, 2017, 3:17am
1
I created a test site:
http://background-video-speed.webflow.io/
Preview link:
https://preview.webflow.com/preview/background-video-speed?preview=48ac3cf0cc22890cd40cbecd272d5fb0
Question
How can I control the speed of the video with code? See code inside of Head in page settings.
Typical HTML5 video control code isn’t working since the background video element is contained inside of a hidden div apparently.
Thanks,
Bonnie
samliew
(webflowexpert.com)
January 31, 2017, 3:21am
2
Please post your project share link and website’s published URL when asking for help.
samliew
(webflowexpert.com)
January 31, 2017, 3:50am
4
The root element of the background video component is a div , which contains a standard video element.
You can inspect the test page below with developer tools to see how it works
http://sandbox-903b9c.webflow.io/video-test
bduffley
(Bonnie )
January 31, 2017, 4:10am
5
@samliew - thank you…so, looking at that with developer tools/inspect seems to indicate that the actual video code is hidden…so I can’t directly affect it with code?
It seems like the background video element contains the video code within a hidden div that I can’t give an ID to or manipulate.
Can you help further clarify?
brryant
(Bryant Chou)
January 31, 2017, 2:39pm
7
You can try to set this using custom code (in the <head>
section):
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
1 Like
bduffley
(Bonnie )
January 31, 2017, 2:43pm
8
Hi @brryant !
Thanks so much for helping.
I had already included that code inside of the head section in my test link above (please see the preview link), however it seems to only control the container div, not the actual video itself.
I can’t seem to figure out how to affect the background video itself since the Background Video element is contained within a div I can’t see. Any ideas?
Thanks!
Bonnie
Waldo
(Waldo Broodrÿk)
January 31, 2017, 9:01pm
9
Thanks for sending me an email on the solution here @bduffley
You added the ID of video-loop
to an element then used the following code (either in before </head>
or before </body>
, both work). Neat trick!
<script>
window.onload = function(){
var vid = document.querySelector("#video-loop video");
vid.playbackRate = 0.5;
}
</script>
Thanks again!
system
(system)
Closed
April 2, 2017, 6:01pm
10
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.