reset on load

This commit is contained in:
JJ
2026-03-31 22:49:16 +01:00
parent d457aa97c0
commit 0f6a97170b
+14 -3
View File
@@ -173,7 +173,6 @@ class PowerLoadVideoTopRowWidget extends RgthreeBaseWidget {
// Upload button handlers
this.hitAreas.uploadButton.onClick = async () => {
console.log("[PowerLoadVideo] Upload button clicked");
await this.handleUploadClick(node);
};
this.hitAreas.uploadButton.onDown = () => {
@@ -293,8 +292,6 @@ class PowerLoadVideoTopRowWidget extends RgthreeBaseWidget {
node.loadVideoIntoDisplay(uploadedName);
}
console.log('[PowerLoadVideo] Video uploaded:', uploadedName);
// Force canvas redraw to show the video
app.graph.setDirtyCanvas(true, true);
} else {
@@ -1671,6 +1668,20 @@ app.registerExtension({
return;
}
// Stop playback and reset timeline when loading new video
if (this.timelineWidget?.value?.isPlaying) {
this.timelineWidget.stopPlayback();
this.timelineWidget.value.isPlaying = false;
if (this._stopHoverAudio) this._stopHoverAudio();
}
// Reset current frame to 1 and video time to start
if (this.timelineWidget) {
this.timelineWidget.value.currentFrame = 1;
}
if (videoElement) {
videoElement.currentTime = 0;
}
// Preload audio for hover playback
if (this._loadHoverAudio) this._loadHoverAudio(videoFilename);