Link "Now Playing" track title to original YouTube video#41
Merged
Conversation
Co-authored-by: paulpv <1393897+paulpv@users.noreply.github.com>
Co-authored-by: paulpv <1393897+paulpv@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Link 'Now Playing' track to original YouTube video
Link "Now Playing" track title to original YouTube video
Oct 29, 2025
Copilot stopped work on behalf of
paulpv due to an error
October 29, 2025 01:33
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds clickable YouTube links to the now-playing title display. When a track contains a YouTube ID in its filename or path (formatted as [VIDEO_ID]), the track title becomes a hyperlink that opens the corresponding YouTube video in a new tab.
- Introduces CSS styling for clickable track title links
- Adds a helper function
resolveYouTubeUrlFromTrackto extract YouTube URLs from track objects - Modifies the
playIndexfunction to conditionally render the track title as either a link or plain text
Comments suppressed due to low confidence (1)
player.html:565
- When dynamically changing the
nowTitleelement from plain text to containing a link (or vice versa), thearia-atomic="true"attribute causes screen readers to announce the entire element content. However, usinginnerHTML = ''andappendChildat lines 2859-2866 may interfere with the intended accessibility behavior. Consider testing with screen readers to ensure the link is properly announced when tracks change, or maintaining consistent text content in the element to preserve the ARIA live region behavior.
<span id="nowTitle" class="now-title" aria-live="polite" aria-atomic="true">—</span>
| link.className = 'now-title-link'; | ||
| link.href = youtubeUrl; | ||
| link.target = '_blank'; | ||
| link.rel = 'noopener'; |
There was a problem hiding this comment.
The rel attribute should include both noopener and noreferrer for enhanced security when opening links in a new tab. This prevents the new page from accessing the window.opener property and also strips referrer information. Update to link.rel = 'noopener noreferrer';.
Suggested change
| link.rel = 'noopener'; | |
| link.rel = 'noopener noreferrer'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a track filename contains a YouTube video ID in the format
[videoId], the "Now Playing" title now renders as a clickable link tohttps://youtu.be/{id}. Tracks without video IDs display as plain text.Changes
resolveYouTubeUrlFromTrack()- Converts track object to entry format and delegates to existingresolveYouTubeUrl()to extract video ID from filename/path<a>element withtarget="_blank"andrel="noopener"when YouTube URL detected, otherwise sets plain text.now-title-linkCSS - Accent color with hover underline, matching existing.history-path-linkpatternImplementation
Screenshot
Top example shows track with
[5Dc-5DD8P-0]rendered as cyan link. Bottom shows regular track as plain text.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.