Wednesday, September 20, 2023

document.getElementById('youtubeVideo').addEventListener('click', function() { // Generate a unique token for the video view var uniqueToken = new Date().getTime() + Math.random().toString(36).substr(2, 9); // Update the YouTube iframe src with the unique token as a parameter // This won't affect the video playback but will give each user a unique link this.src = this.src + '&unique=' + uniqueToken; // Disable right-click to somewhat prevent users from copying the link this.oncontextmenu = function(event) { event.preventDefault(); return false; }; }); /p>

No comments:

Post a Comment