Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Timeline not rendered when opening a YouTube video in paused state #982

Closed
FichteFoll opened this issue Sep 5, 2024 · 5 comments
Closed

Comments

@FichteFoll
Copy link

When opening a video that needs time to load, such as a YouTube video,and you pause that video before it can start playing, uosc 5.4.0 doesn't show the timeline anymore – neither on hover, nor when flashing or toggling it. Everything else renders fine. One way to cause it to properly render is resizing the window, as is seeking of course.

I suspect this is a caching issue where the update of the video length doesn't reach the timeline component and does not cause it to re-evaluate its render data or similar.

@tomasklaen
Copy link
Owner

tomasklaen commented Sep 5, 2024

Timeline doesn't render when either duration or time are nil. No idea why resizing a window would have an effect on that.

If this worked before, the only commit I suspect might be causing the issue is #969 by @po5.

@FichteFoll
Copy link
Author

FichteFoll commented Sep 5, 2024

My assumption is that resizing the window causes some properties to be re-read, at which point it sees that whatever was nil before (duration probably) is now not nil anymore and the timeline can be rendered again.

@tomasklaen
Copy link
Owner

Does this fix it for you?

diff --git a/src/uosc/main.lua b/src/uosc/main.lua
index 7765572..acad20f 100644
--- a/src/uosc/main.lua
+++ b/src/uosc/main.lua
@@ -451,8 +451,8 @@ function update_fullormaxed()
 end
 
 function update_duration()
-	state.duration = state._duration and ((state.rebase_start_time == false and state.start_time)
-		and (state._duration + state.start_time) or state._duration)
+	set_state('duration', state._duration and ((state.rebase_start_time == false and state.start_time)
+		and (state._duration + state.start_time) or state._duration))
 	update_human_times()
 end
 

tomasklaen added a commit that referenced this issue Sep 6, 2024
@FichteFoll
Copy link
Author

Yes, I am 100% unable to reproduce with this patch for a video I had about 70% fail rate before.

@tomasklaen
Copy link
Owner

Cool. The fix is already in the commit above (dc7c822).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants