Q.series classic Downloads
Q.series classic Downloads
Alle Q.series classic, einschließlich Datenblättern mit detaillierten Spezifikationen, Handbüchern, Anleitungen und Konfigurationsbeispielen.
document.addEventListener("DOMContentLoaded", function() {
var playbackConst = 300; // lower numbers = faster playback
var setHeight = document.getElementById("set-height"); // get page height from video duration
var vid = document.getElementById('v0'); // select video element
// Initialize Smooth Scroll
var scroll = new SmoothScroll('body', {
speed: 500,
speedAsDuration: true
});
// Function to set the height dynamically
function setDynamicHeight() {
if (vid.duration) {
var height = Math.floor(vid.duration) * playbackConst + "px";
setHeight.style.height = height;
console.log("Height set to: " + height);
} else {
console.log("Video duration not available yet. Current duration: " + vid.duration);
}
}
// dynamically set the page height according to video length
vid.addEventListener('loadedmetadata', setDynamicHeight);
// Fallback in case loadedmetadata event does not fire
vid.addEventListener('loadeddata', setDynamicHeight);
// Check duration manually after a short delay if events don't fire
setTimeout(setDynamicHeight, 1000);
// Function to update video time based on scroll position
function updateVideoTime() {
var scrollPos = window.pageYOffset;
var frameNumber = scrollPos / playbackConst;
vid.currentTime = frameNumber;
}
// Scroll event handler
function onScroll() {
updateVideoTime();
}
// Attach scroll event listener
window.addEventListener('scroll', onScroll);
// Initial call to set the video frame correctly
updateVideoTime();
});
Weitere Informationen
Normaler Textblock