-
Notifications
You must be signed in to change notification settings - Fork 0
Link "Now Playing" track title to original YouTube video #41
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
Conversation
Co-authored-by: paulpv <1393897+paulpv@users.noreply.github.com>
Co-authored-by: paulpv <1393897+paulpv@users.noreply.github.com>
paulpv
left a comment
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.
@copilot When this new now playing title link is clicked the player should pause
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.
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'; |
Copilot
AI
Oct 29, 2025
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.
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';.
| link.rel = 'noopener'; | |
| link.rel = 'noopener noreferrer'; |
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.