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

UI for the music player #399

Merged
merged 3 commits into from
Jan 2, 2021
Merged

UI for the music player #399

merged 3 commits into from
Jan 2, 2021

Conversation

heyhippari
Copy link
Contributor

@heyhippari heyhippari commented Dec 16, 2020

This adds a working music UI and a basic audio player using Shaka as a backend (to be replaced with Howler or something else in the future).

Screenshot_2020-12-27 Jellyfin

Screenshot_2020-12-27 Jellyfin(1)

Comment on lines 109 to 112
<v-footer v-if="false" app>
<music-player />
</v-footer>
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs a higher z-index, otherwise, home sections overlay ontop of it.

Copy link
Contributor

Choose a reason for hiding this comment

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

a value of 5 works well, and it does not overlay on the nav draw

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

image

Probably a good idea to hide volume controls on narrower screens

@ThibaultNocchi
Copy link
Member

ThibaultNocchi commented Dec 16, 2020

I do agree, especially when narrower screens are tablets or phones having dedicated volume buttons. But I think that's what the second screenshot show, doesn't it?

@camc314
Copy link
Contributor

camc314 commented Dec 16, 2020

I do agree, especially when narrower screens are tablets or phones having dedicated volume buttons. But I think that's what the second screenshot show, doesn't it?

yeah that's right. The second screenshot in the original is a phone. My screenshot is a desktop window at about 50% width

@ThibaultNocchi
Copy link
Member

Oh yeah you're right, my bad. I don't know if totally hiding is a great idea, maybe only letting the icon and show a vertical slide above when hovering?

@heyhippari heyhippari force-pushed the music-player-ui branch 2 times, most recently from 3113e69 to 8a53ebc Compare December 27, 2020 02:27
@heyhippari
Copy link
Contributor Author

Alright, so this evolved a bit, with the recent merge of the playback manager, and now has a basic Shaka-based audio player (basically a copy of VideoPlayer, but with an <audio> tag. It shall be replaced with the Howler-based player we have planned in the future) and shows information on currently playing audio, as well as allow some basic control and linking to artist/album.

It also adds a few niceties, like an itemHelper mixin, containing a canPlay method, which checks if the current item is playable, and shows the currently playing track in tracklists (I'd like to refine this in the future, so only the source of the currently playing queue highlights this currently playing item, much like Spotify does).

Still no queue button, fullscreen, shuffle or repeat, since that's for Preview Release 2, probably.

@KristupasSavickas
Copy link
Contributor

Minor issue I noticed - play button remains in paused state after transitioning to the next playlist item:

output

<v-slider
:value="currentPosition"
hide-details
min="0"
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
min="0"
:min="0"

This shouldn't be necessary anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The component accepts number | string, so this isn't needed.

@ferferga
Copy link
Member

ferferga commented Jan 1, 2021

@MrTimscampi After a rebase this is good to go imo. I made some quick small improvements to the slider, so it updates more smoothly (right now it makes a huge jump). I also added a nice label with the selected time and now the bar doesn't act like crazy when clicked or moved:

slider

If you want I can make a commit before your rebase so we can get this changes here or I can make a PR with cumulative improvements later, whatever you prefer :)

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

There is an empty file LikeButton.vue that can be removed

:to="`/item/${getCurrentItem.AlbumId}`"
>{{ getCurrentItem.Name }}</nuxt-link
>
<v-btn class="d-none d-md-inline-flex" icon>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<v-btn class="d-none d-md-inline-flex" icon>
<v-btn class="d-none d-md-inline-flex" icon disabled>

Comment on lines 16 to 19
class="text-truncate link"
:to="`/item/${getCurrentItem.AlbumId}`"
>{{ getCurrentItem.Name }}</nuxt-link
>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
class="text-truncate link"
:to="`/item/${getCurrentItem.AlbumId}`"
>{{ getCurrentItem.Name }}</nuxt-link
>
class="text-truncate link"
:to="`/item/${getCurrentItem.AlbumId}`"
>
{{ getCurrentItem.Name }}
</nuxt-link>

<nuxt-link
tag="span"
class="text--secondary text-caption text-truncate mt-md-n2 link"
:to="`/artist/${getCurrentItem.AlbumArtists[0].Id}`"
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this making the assumption that there is an album artist.

In the case where there isn't, won't this produce an error

Copy link
Contributor Author

@heyhippari heyhippari Jan 2, 2021

Choose a reason for hiding this comment

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

I always have an album artist, even for albums from solo artists.

<template>
<audio
ref="audioPlayer"
:poster="poster"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
:poster="poster"

There is nowhere to show the poster, so this is unneeded.

Comment on lines 52 to 59
poster(): string {
return this.getImageUrlForElement(ImageType.Backdrop, {
itemId:
this.getCurrentItem?.ParentBackdropItemId ||
this.getCurrentItem?.SeriesId ||
this.getCurrentItem?.Id
});
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
poster(): string {
return this.getImageUrlForElement(ImageType.Backdrop, {
itemId:
this.getCurrentItem?.ParentBackdropItemId ||
this.getCurrentItem?.SeriesId ||
this.getCurrentItem?.Id
});
}

@@ -38,7 +41,13 @@
</td>
<td style="width: 3em" class="pr-0 pl-0 text-center">
<v-btn icon>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<v-btn icon>
<v-btn icon disabled>

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

Settings/metadata is inaccessible on narrow screens:

image

@neopc10
Copy link

neopc10 commented Jan 1, 2021

Why the fullscreen button? It seems to me that it's a bit of a waste of space. On Tidal, for instance, clicking anywhere on the minibar will go to the full window player. It seems to me that JF would be well served by this. The add to playlist button, too, to perhaps an overflow menu.
image

@heyhippari
Copy link
Contributor Author

heyhippari commented Jan 1, 2021

@neopc10 We are planning to have this kind of screen for the fuill screen button:
image

While the queue button will navigate to the current queue.

@camc314 That's z-index stuff with the navigation drawer. Afaik it's fixed on master, but this branch needs to be rebased.

@KristupasSavickas I've seen this happen with videos too, so it's not specific to this branch. Definitely needs to be investigated, though.

@ferferga ferferga changed the title Add placeholder UI for the music player UI for the music player Jan 1, 2021
@hamburglar2160
Copy link

I really like what Tidal does here with their UX seems to borrow at least a bit from that.

Spotify doesn't seem to give two craps about albums in general and I think that's a missed opportunity on their end. I think the Vue client would really benefit from having the album linked in addition to the song title and album artist. as posted above. Tidal actually has a "playing from " link instead of album and I think that's a really nice touch that would be applicable here in the future.

Tidal also has a fantastic "whole window" player UI, which I don't think is being considered for this round of PRs, but certainly deserves serious consideration for the Vue client: the album cover, player, and metadata on the left 50% of the screen and the queue on the right 50%. On Tidal's "whole window" UI there's also a button that leads to a "fullscreen" UI that I would argue is inferior to the Spotify one @MrTim linked above.

Clearly the fullscreen button is placeholding for the Spotify-like fullscreen view. Is there an intention to do a whole window player UI as well? I would argue that the absolute sweet spot for flow in this client would be "play music -> minibar appears -> click anything that's not a button on the minibar to navigate to the tidal-like "whole window" player -> click fullscreen button there to get to a spotify-like fullscreen UI.

I think making the seekbar take up only a fraction of the minibar as opposed to the entire width of the screen is a downgrade from what jf-web has. Having that more granular control I think is useful. I see that Spotify chose to do that though and it certainly works with their fullscreen view.

I'm bringing this up here and now only because the PR is just slightly less of a placeholder than it might have been an hour ago.

@ferferga
Copy link
Member

ferferga commented Jan 2, 2021

@hamburglar2160 All this discussion belongs to #238, please keep this one on topic with this specific feature.

This is also a first round design. Home Header's first PR was really basic and it has gotten better after a few PRs. After all, this whole client is a Work in Progress.

@heyhippari
Copy link
Contributor Author

Indeed, please keep this on topic. PRs are mainly for implementation discussions, not brainstorming future features. We have discussion threads for every major feature specifically for gathering ideas and discussing said features and what we want to do with them.

Also, @hamburglar2160 , please avoid tagging people unrelated to the project. It was probably done accidentally, but it's quite a rude thing to do in general.

@heyhippari heyhippari force-pushed the music-player-ui branch 2 times, most recently from c36b0b9 to eac1b8a Compare January 2, 2021 13:35
@codecov-io
Copy link

codecov-io commented Jan 2, 2021

Codecov Report

Merging #399 (71d91c4) into master (1030175) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #399      +/-   ##
=========================================
- Coverage    0.67%   0.62%   -0.05%     
=========================================
  Files          74      77       +3     
  Lines        1932    2073     +141     
  Branches      273     294      +21     
=========================================
  Hits           13      13              
- Misses       1918    2059     +141     
  Partials        1       1              
Impacted Files Coverage Δ
components/Item/Card.vue 0.00% <0.00%> (ø)
components/Layout/AudioControls.vue 0.00% <0.00%> (ø)
components/Layout/HomeHeader/HomeHeaderItems.vue 0.00% <0.00%> (ø)
components/Layout/VolumeSlider.vue 0.00% <0.00%> (ø)
components/Players/AudioPlayer.vue 0.00% <0.00%> (ø)
components/Players/PlayerManager.vue 0.00% <ø> (ø)
components/Players/TrackList.vue 0.00% <0.00%> (ø)
pages/genre/_itemId/index.vue 0.00% <0.00%> (ø)
pages/item/_itemId/index.vue 0.00% <0.00%> (ø)
store/playbackManager.ts 0.00% <0.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1030175...71d91c4. Read the comment docs.

Copy link
Member

@ferferga ferferga left a comment

Choose a reason for hiding this comment

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

Minor stuff

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 2, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@heyhippari heyhippari merged commit 6bb48a0 into master Jan 2, 2021
@heyhippari heyhippari deleted the music-player-ui branch January 2, 2021 14:52
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.

8 participants