reset on load
This commit is contained in:
+14
-3
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user