-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storyboards: Various fixes and code cleaning #4153
Conversation
abaee5c
to
14d704b
Compare
The refactor LGTM, but I'm not sure it fixes #3441 - when I open the url in the browser after replacing |
That's what bugged me out for a moment! Actually, the first URL should now look like this: Note that it's not |
Oh I totally missed that. That's pretty interesting! |
# Parse the JSON structure from Youtube | ||
def self.from_yt_json(container : JSON::Any, length_seconds : Int32) : Array(Storyboard) | ||
# Livestream storyboards are a bit different | ||
# TODO: document exactly how |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried messing around with them in shaka for FreeTube (as we can use the live dash manifest with shaka and get 4 hours of seeking) but the code I came up with based on reversing the player.js file and stepping through it with a debugger, ended up requesting loads of future not yet existing thumbnails (something in my assumptions or calculations must have been off), so I gave up and continued doing the rest of the shaka migration.
I'll let you know if I ever get it working in FreeTube.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for your research ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementing live storyboards is probably something better done on the client side anyway, as it will require information from the streaming URL response headers or the live DASH manifest (at least that's the only way I can think of figuring out the current live segment) and you'll have to update it every 5 seconds, so generating a VTT file on the server side doesn't seem like a viable option for that.
My previous attempt revolved around using shaka's manifest preprocessing function to inject the live storyboards into the DASH manifest based on information in the manifest. Although as shaka already struggles enough with YouTube's 4 hour DVR window (4 hours worth of 5 second segments = 2880, which it has to recalculate every 5 seconds x) ) in the live manifests, so I'm not sure if adding that extra delay is a good idea, even if my solution had worked, which it didn't.
@ChunkyProgrammer Yes, we're aware of that problem. Syeopite added a workaround here: #4040 Edit: Though, I realised that his solution doesn't seem to handle URLs starting with |
Just to clarify, storyboards were working for me when running master locally at this commit 60fae01 (which was the latest at the time of my testing) but not working when using this PR locally |
Okay, I found the issue! |
139dc6c
to
b18c6a8
Compare
It's so weird. Before that PR, all webVTT timestamps were null (see below), but Before
After
|
@SamantazFox Looks like videojs-vtt-thumbnails doesn't follow the spec properly and doesn't unescape the escaped characters. So an exception will need to be added to #4414 to not escape characters for thumbnail files. |
b18c6a8
to
a335bc0
Compare
The workarounds are as follow: * Unescape HTML entities * Always use 0:00:00.000 for cue start/end
e9694a0
to
5b05f3b
Compare
It should be good now. 5b05f3b adds the required workarounds for videojs-vtt-thumbnails: unescaped HTML entities and cue start/end always at 0:00:00.000 |
Well, I was wrong: videojs-vtt-thumbnails still requires proper cue timing, but the start and end times must overlap (see comment in last commit). If they don't, it leaves a 1sec gap and the GUI glitches, resulting in poor user experience. |
Closes #3441
@ChunkyProgrammer and @iBicha can I have your feedback on this one?