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

Allow user to quick play items with play button #332

Merged
merged 3 commits into from
Dec 27, 2020
Merged

Allow user to quick play items with play button #332

merged 3 commits into from
Dec 27, 2020

Conversation

cewert
Copy link
Member

@cewert cewert commented Dec 8, 2020

This allows the user to "quick play" an item with type "Movie" or "Episode" from the home screen, itemgrid2, and the tv season episode list using the play button on the remote.

Changes
Create field quickPlayNode to hold selected (focused) item node
Create observers on the quickPlayNode fields that report to main loop
Validate and play video from main loop

Issues
N/A

@neilsb
Copy link
Member

neilsb commented Dec 11, 2020

I like the idea. Not had a chance to try the code yet, but hopefully this weekend.

Wondering if there was maybe something we could do to avoid having to modify IF statement when we add new supported types (E.g. Music albums, tracks, photos etc). Perhaps we could have a CanQuickplay property of the JFContentItem class that could be set for each type that inherits it?

And possibly even a GetQuickplayItem() function that each item type can override to provide the media info to play. This would let TV Series or Seasons to implement it to return the appropriate video?

@cewert
Copy link
Member Author

cewert commented Dec 12, 2020

something we could do to avoid having to modify IF statement when we add new supported types

I like that idea but the home screen uses HomeData I believe - not JFContentItem but I'd have to double check. Also, I'm not sure the API call I'm using can support all of those different types. If we need different API calls for each type then we can't avoid the type check. we'd have to either validate type before sending to function or have one giant function that writes api call based on type.

a GetQuickplayItem() function that each item type can override

I don't follow. Where would this code live?

@neilsb
Copy link
Member

neilsb commented Dec 12, 2020

I like that idea but the home screen uses HomeData I believe - not JFContentItem but I'd have to double check.

No, you're right. I thought I had moved the home screen over to using the items based of JFContentItem but not yet.

Also, I'm not sure the API call I'm using can support all of those different types.

a GetQuickplayItem() function that each item type can override

I don't follow. Where would this code live?

I think I probably need to think this through some more. I was thinking that the end goal for the selection stuff would be to have a single "Selected Item" (that would be based on a JFContentItem) and for it to have an additional property to tell us whether it should be Viewed or Played. There was then just one function in the main even loop that observed the selectedItem and would perform the appropriate action based on the type

Type View / Play Action
Folder View Show in ItemGrid
Folder Play Play 1st item in Folder (video / photo / music)
Library View Show in ItemGrid
Library Play Play 1st item in Folder (video / photo / music / etc)
Movie View Movie Details Screen
Movie Play Play Video
Music Album View Album Details Screen
Music Album Play Play Album from 1st track
Music Track View Album Details Screen
Music Track Play Play track
Photo View View photos from Album in ItemGrid
Photo Play Show photo
Photo Album View View photos in ItemGrid
Photo Album Play Start slideshow from 1st photo
Playlist View Playlist Details Screen
Playlist Play Play 1st Video in Playlist
TV Show View TV Show Details Screen
TV Show Play Play 1st unplayed Episode
TV Show Season View TV Show Details Screen - Season Selected
TV Show Season Play Play 1st unplayed Episode
TV Episode View TV Show Episode Screen
TV Episode Play Play Video
Video View Video Details Screen
Video Play Play Video

The JFContentItem would define the GetQuickPlayItem() function in the interface, which would be implemented in each of the Data items (i.e. SeriesData would implemented it that it performed an API call to get the 1st unplayed episode in the Series, or if there are none then S1E1. Or whatever logic was decided to be the correct one). The function in the main even loop knows that it could call 'GetQuickPlayItem()' on any JFContentItem and would receive back either a Video, Music Track, or Photo - and display that accordingly.

As I say, needs to thought through some more (if it's even a direction we want to go).

@cewert
Copy link
Member Author

cewert commented Dec 12, 2020

On one hand, I like where your heads at. It seems like the more "roku" way of doing things - attaching the data to nodes.

But on the other hand, it seems unnecessary. We can't get rid of the type check, we'll still have to manually modify the logic as we add support for more item types, and doing this before the home screen rewrite would create extra work.

Like you said, I think we should think it out more. Maybe make issues for all of our big picture stuff i.e. the future plans for JFContentItem, quick play etc.

PS: I also thought quickplay could be used as a way to support deep links but i still need to look into that more.

@neilsb neilsb merged commit 51af9fd into jellyfin:master Dec 27, 2020
@cewert cewert deleted the play-items-with-play-button branch July 17, 2022 18:13
@cewert cewert mentioned this pull request Mar 29, 2023
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