lightbox: Open YouTube videos at correct timestamp. #36996
+51
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
lightbox: Open YouTube videos at correct timestamp.
Previously, opening a YouTube link with a timestamp (e.g.,
?t=1m20sor?start=80) in the lightbox would play the video from the beginning because the query parameters were ignored.This commit updates the lightbox logic to correctly parse the
torstartparameter from the URL and pass it to the embedded YouTube player so the video starts at the specific time intended by the sender.Changes:
parse_youtube_start_timehelper function inweb/src/util.ts.web/src/lightbox.tsto use this helper and append thestartparameter to the embed URL.web/tests/util.test.cjsto cover various timestamp formats.Fixes: #36990
How changes were tested:
Manual Verification:
t=42s,t=1m10s).Automated Tests:
parse_youtube_start_timecovering formats like?t=120,?t=2m30s, and?start=80.Screenshots and screen captures:
Screencast.From.2025-12-10.23-07-38.online-video-cutter.com.mp4
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: