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

Added first draft of a media-player #46

Merged
merged 8 commits into from
Apr 14, 2023
Merged

Added first draft of a media-player #46

merged 8 commits into from
Apr 14, 2023

Conversation

SimonSimCity
Copy link
Collaborator

This is a first version of how a media-player could look like - just a POC and some ideas of mine.

The player can be tested on the browse route, where I've added a new component temp-playlist. As the comment in the file states, this is just here for testing purpose and should be removed as soon as we have a proper listing of tracks - therefore I've not taken the effort of building a well defined component there.

I tried to decouple the media-player and the queue, as I see them as separate concepts where the one should not much relation to the other. This way we can have many "players" where only one of them is actively playing, another might be prefetching data.

Would be nice to hear your feedback on it.

@SimonSimCity
Copy link
Collaborator Author

Since all this is just a POC as of now, I refrained of implementing it into the private-playlists as well as of now. If you agree that this is a good way to go, I'll start addressing the TODO.

@kkuepper
Copy link
Member

The one thing I stumbled with is the MediaPlayerInjectionKey. I don't quite like the name but I don't have a better idea either. I guess it would be more intuitive if I used Vue a lot.

In general I think it's fine.
@fredrikved @steffanhalv do you have any feedback?

@SimonSimCity
Copy link
Collaborator Author

The one thing I stumbled with is the MediaPlayerInjectionKey.

I've just chosen it for a personal naming preference - not knowing if there is any tendency of naming in the eco-system. Maybe it's quite an OOP-inspired naming 😄 https://devrant.com/rants/502139/oop-programming-be-like

@kkuepper
Copy link
Member

I was more thinking to just call it MediaPlayer and make other exports private or protected.
But having inject in the name makes it clear that it needs to be injected before it can be used.

@SimonSimCity
Copy link
Collaborator Author

SimonSimCity commented Mar 29, 2023

Don't know if this would work out well with lazy loading - haven't tried ... Maybe the player would then be a copy in each component we get in via ll 😓

EDIT: As of what I read online its about the same as using DI in other frameworks, which really seem to shine when having multiple implementations for the same interface... No objection from my side here ... could do some tests if needed to see if my first argument holds any water, but would just leave it as is if nobody has other objections...

# Conflicts:
#	src/App.vue
#	src/main.ts
#	src/views/BrowseView.vue
#	src/views/Playlist/CuratedPlaylistDetails.vue
@SimonSimCity SimonSimCity marked this pull request as ready for review April 11, 2023 15:45
@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #46 (75e75f6) into main (55c0aba) will not change coverage.
The diff coverage is n/a.

❗ Current head 75e75f6 differs from pull request most recent head e5de092. Consider uploading reports for the commit e5de092 to get more accurate results

@@            Coverage Diff            @@
##              main       #46   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines           71        71           
  Branches         5         5           
=========================================
  Hits            71        71           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

src/App.vue Outdated Show resolved Hide resolved
src/components/MediaPlayer.vue Show resolved Hide resolved
src/views/Playlist/CuratedPlaylistDetails.vue Outdated Show resolved Hide resolved
src/App.vue Outdated Show resolved Hide resolved
@SimonSimCity SimonSimCity merged commit f243a5f into main Apr 14, 2023
@SimonSimCity SimonSimCity deleted the media-player branch April 14, 2023 11:53
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.

2 participants