We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am having fun exploring the DOM library. Trying to build something with video: I would like to build a video player where the video playhead jumps around based on certain parameters/user interactions. But only within the frames that are already (pre)loaded, otherwise I will have blank frames and pauses depending on the user's connection speed. Now, in terms of references/examples there's not much @ P5jS.org yet. But I have found this nice reference page: http://www.w3schools.com/tags/ref_av_dom.asp for HTML Audio/Video Properties. But how to use them properly in P5.js is quite obscure to me… for example:
Assumed what I've found here http://www.w3schools.com/tags/av_prop_duration.asp I was expecting the following code to work...
var randomF = floor(random(0, myVideo.duration));
But it doesn't.
While the code below gives me the result I was looking for:
var randomF = floor(random(0, myVideo.duration()));
I don't know why round brackets are needed here, I just discovered by chance this was what was the way to go… so I also tried the following:
var randomF = floor(random(0, myVideo.buffered.end()));
Assuming this would have worked out as well, but it didn't :((
Thank a lot for your help!