Vimeo API Callback Function Help

Thank you @MarkHunte!!

I learned so much from this. I literally spent an hour going through all of your info.

I ended up just using the timeupdate event to update an element as the video progressed like this:

vp.player.on('timeupdate', function(data) {
		
		
		 //evaluate  entries
        switch(true) {
 
   //everything is correct
     case (data.seconds < 13):  
     
     hypeDocument.getElementById("notes").innerHTML = "";
     
     break;
     
     
     case (data.seconds >= 13 && data.seconds < 87):  
     
     hypeDocument.getElementById("notes").innerHTML = "<i>The Tortoise</i> by <strong>Alex P</strong>";
    
     
     break;
     
     case (data.seconds >= 87 && data.seconds < 136):  
     
     hypeDocument.getElementById("notes").innerHTML = "<i>The Fire</i> by <strong>Amelie R</strong>";
     
     break;

etc…

Is there some reason why this would not be a good idea?

Thank you again!

(also do you have a Patreon page as I’d love to support all of your efforts on this forum)

1 Like