Autoplaying videos in the html node

hello wonderful people!

after some days of trying and researching i finally tend to you.
i have the following problem: in my application i embedded a “” which is basicall a social media scrawler for hashtagged pictures and videos which updates every minute on its own.
the videos autostart as they should if you navigate to the site in chrome, but they dont autostart inside the vvvv html node.

so my question is: is there a way to autostart any video inside the vvvv html node?
i already tried this java script, but it doenst work:

// execute the function every 3000ms
setTimeout(function() {
var visibleVideos = document.querySelectorAll(‘video’);

for (var i = 0; i < visibleVideos.length; i++) {
var currentVideo = visibleVideos[i];
currentVideo.setAttribute(‘loop’, ‘loop’);
currentVideo.setAttribute(‘autoplay’, true);;

}, 3000);

im sorry i can not post my application here because of legal issues.
thx for any help in advance!


Maybe play() method somehow conflicts with autoplay?
Are video elements already created when js is executed?
Can you “manually” add loop and autoplay attributes?

Reedit: [Why would you setAttribute() more than once?] It’s setTimeout, not setInterval, so this is not a valid point. However using onload() makes more sense, since what now is in setTimeout() would be executed immediately when everything is loaded.
Didn’t notice at first, but do you have a class “video” for each “video” tag? To select “video” tags you should use document.getElementsByTagName(‘video’)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.