Skip to content
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

Add Now Playing to Title Bar #6314

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Dan-613
Copy link

@Dan-613 Dan-613 commented Nov 10, 2024

Changes
Add Media Playing to Title Bar

Issues
Resolves #6301

@Dan-613 Dan-613 requested a review from a team as a code owner November 10, 2024 21:28
@jellyfin-bot
Copy link
Collaborator

jellyfin-bot commented Nov 10, 2024

Cloudflare Pages deployment

Latest commit dc7a058
Status ✅ Deployed!
Preview URL https://d9d0d5ad.jellyfin-web.pages.dev
Type 🔀 Preview

View build logs

Copy link

sonarcloud bot commented Nov 10, 2024

@bluemoehre
Copy link
Contributor

Are we talking about the window / tab / document title here? Because that's what the code points to, but the screenshot of the issue seems to show something different.


Also I don't like the technical solution of mixing the document title management into this existing function. To make things easy to understand, manage and test, this should be separated. Additionally hard-coded strings are an anti-pattern.

Copy link
Member

@viown viown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did find some bugs:

  • The title will not be reset after playback is stopped.
  • While playing something, moving between library pages will reset the title.

nowPlayingTextElement.appendChild(itemText);
nowPlayingTextElement.appendChild(secondaryText);
}

document.title = documentTitle;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
document.title = documentTitle;
document.title = documentTitle || 'Jellyfin';

We can set documentTitle to initially be an empty string for improved readability.

@@ -539,19 +539,27 @@ function updateNowPlayingInfo(state) {
if (textLines[1].text) {
const text = document.createElement('a');
text.innerText = textLines[1].text;
documentTitle = text.innerText;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does currently show Year - Movie Name for movies and Episode Number - Episode Name - Series for episodes. Not sure if this is how we should go about it, maybe someone else can give suggestions.

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

Successfully merging this pull request may close these issues.

When playing music, Jellyfin doesn't show artist not song name on tab
4 participants