-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
New Year, New Video Player + Other Goodies #593
Conversation
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.
This is a large PR. I think it would be a good idea to merge this PR first, and then post a separate PR to fix any issues or comments you have with the code.
The changes are very cool.
Thanks for the great work!
CI failed, do we need a fix? |
Yes, but I have messed up Homebrew on my machine so it may take a while. Regarding "reviewing this PR", that will just take place as active development instead of a direct response to this PR. |
The build errors come from my VLCUI package which is new as of this PR. The package itself does not contain the Carthage dependencies and instead links to them through the master project. This same error does come up upon first building the project from a package cache reset during normal development but is fixed by just rebuilding a second time. So, it looks like either the CI system will need some work or I will need to find a different way to link/incorporate VLCUI. @PangMo5 If you're able to check my branch out and build both projects on the latest Xcode, we can consider that good in the meantime. |
I'm using Xcode 14.3 and there seem to be two errors. The first is that the R.swift (named R.swift, but the internal command is swiftgen) Build Phase doesn't seem to be working correctly. This could be an issue with my settings. The second is https://github.com/gunterhager/UDPBroadcastConnection
After that, when I build the project, I get the following error due to that library.
If you pull your project into a new folder and build it, does it still build? |
swiftgen has always complained since it is run on every build but that is just a warning. The Carthage dependencies are complaining because they were built with Swift 5.6.1 and not 5.8. You will need to delete the contents of the Carthage folder and rebuild. |
Ah, right, I cleared the Carthage folder and did There's a swift 5.8 syntax issue, so I get an error, but after fixing that, it works. I checked that both Swiftfin and Swiftfin tvOS build fine in Xcode 14.3. |
With the new year, this means another one of my huge PRs encompassing months worth of work and not adhering to my own git guidelines.
iOS/iPadOS - New Video Player
The video player has been entirely re-designed with new visuals and customization options. Now mostly in SwiftUI, future features can be more easily implemented and managed which is great for future contributions.
The new video player is influenced by iOS 16's new native video player:
iOS - Movie Default
iOS - TV Show Default
iPadOS - Movie Default
iPadOS - TV Show Default
More customization is provided to enhance your playback experience.
Video Player Settings
Below are highlights for some of the new features.
Gestures
Actions performed during a gesture are now fully customizable and more can be easily added in the future. During most actions a toast will appear to provide information about the results of the gesture.
New gestures include:
Buttons
There are two places where buttons can appear:
Now, you are freely able to choose which buttons appear in each area and their ordering.
Slider Color
The slider color can be customized using the new default iOS color picker.
iOS - Slider Color Picker
Slider Type
With the introduction of a new slider type,
Capsule
, the more familiarThumb
type is also available. These two types contain different behaviors, whereCapsule
allows the whole slider to be dragged whereThumb
only receives input on the thumb.iOS - Slider Type
Subtitles
8-24
instead of a list of static values.An additional note has been added to Settings to clarify that these settings may not take effect on all subtitle types.
Timestamp
The timestamp can even be configured:
Native Player
The native player was previously known as the "experimental player" and was, frankly, only implemented to appease a few people who requested it. Now it is being provided as an explicit option for clarity. It may be removed when the MPV rendering layer has been implemented.
Closed Issues
JellyfinAPI
With the new async/await generated JellyfinAPI, the entire networking stack has been rewritten and is now up to date with new features in Swift. This update fixes a few outstanding issues, like crashes due to force unwrapped optionals, and allows a few other architectural changes to take place, like session dependency injection.
Logs
The entire logging layer has been replaced by Pulse, an amazing framework for network and general logging. Logs can now be viewed inside the app (iOS, iPadOS, and tvOS) for troubleshooting and exporting. All of the UI for logging is provided by PulseUI and fits comfortably in the design of Swiftfin. Lastly, sensitive information like IPs, access tokens, and passwords used in network calls can be redacted so that logs can be safely shared when reporting an Issue.
The issue template will be updated to provide instructions exporting and sharing logs.
iOS Logs
tvOS Logs
Other UX Improvements
Many UX improvements have also been incorporated. I would work on these to take my mind of off the refactor as they give me little wins to keep up motivation.
Below are some highlights.
App Accent Color
The accent color used throughout the app can be changed from the default purple used by Swiftfin. Some views that contain text use this accent color and will dynamically update the text color for the best contrast.
iOS - Color Picker
iOS - Blue Play Button
App Icon
The app icon is now customizable in a few different colors and styles. More app icons can be added in the future by the community and guidelines for what designs will be accepted will be made in the future.
iOS - App Icon Selection
iOS - Home Screen
iOS - Cinematic Item Image
When using the
Cinematic
item view type, currently it will use the backdrop along with the logo. The backdrop is a landscape image being used in a portrait context so most posters won't be framed nicely. So, an option was added when using theCinematic
item view type to instead use the portrait photo. This does not bring any tangible benefits, but is an option nonetheless. What should ultimately happen is the server allowing another portrait image with no language tag which would work in portrait design contexts.Extras
Basic functionality for extras have been added. While extras technically have progress user data associated with them, I have deliberately left out indicators/played state handling as I don't see much utility in them. However, this can be added in the future if truly desired.
Haptics
Basic haptics were added for basic feedback such as favoriting, setting played status, and scrubbing over chapters on the slider. Haptics can be disabled in Settings.
Indicators
Indicators on posters were added to indicate whether an item has been favorited, played, unplayed, or is in progress. The presence of these individual indicators is customizable in Settings.
Item Pages
Items contain a lot of fields and the app retrieves a lot of items. Network calls for items will now only retrieve a minimum set of fields to increase network and memory performance. Only when an item is selected will the full information for the item be retrieved.
id
field. However, there may be unforeseen work in the future.Item Video Player Routing
Previously, item pages retrieved playback information in the background, which allowed a quick launch of video playback, however caused more issues as this was a bad UX decision. Now, when launching the video player it will retrieve playback information synchronously and present a loading view.
Library Image
In a previous release, I had made it so that libraries would retrieve a random item to use as a background image. However, I had neglected the fact that library images can be set by the server. You may now decide between the random and server-set option.
Settings
All settings are now in new menus with a consideration for descriptions, organization, and ordering.
Other
BackgroundParallaxHeaderModifier
#558, due to refactortvOS
tvOS didn't receive as much attention as iOS/iPadOS, but some features are highlighted below.
Horizontal Scrolling Lag
The latest tvOS releases have introduced significant lag when scrolling horizontally through items. I tracked this down to the
.focused(...)
modifier that was used to indicate that an item was, well, focused. While performance is fine among just a few items (like user buttons for signing in), lag compounds when used among many items. This issue has been tracked to SwiftUI itself, among many other performance issues.However, knowing what item is focused is essential to views like the cinematic view on the home screen. To mostly fix this the modifier is only set if the focus state is desired, improving performance for all horizontal scrolling views except for the cinematic view. I find this acceptable since users tend to slow down on this view and not rapidly scroll.
Overall I find this saddening, as it would have been beneficial to know the focus state to set the title color between white/grey, better mirroring the UIKit (but unusable) views.
Cinematic Library Background
Libraries now have a background that will change to the background of the selected item. Currently, the tab bar is still shown as a limitation of SwiftUI, but I have some ideas to work around it.
tvOS Cinematic LIbrary
Other
Just to list a few:
video player refactor
poster indicators
settings refactor
Closes tvOS - Subtitle Font #584
Future Work
Currently, this PR does break some stuff and will live in TestFlight while fixes and localizations are implemented.
My Thoughts
I worked way too long on this and wanted this done forever ago. However, life happens and gets in the way sometimes. Nothing we can do but keep moving forward.