diff --git a/web/power_load_video.js b/web/power_load_video.js index f0fb98a..6029d88 100644 --- a/web/power_load_video.js +++ b/web/power_load_video.js @@ -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);