Swiftfin/Shared
Joe 56bd62db80
App-Wide Bitrate Limit (#1147)
* Creation of bitrate selections that mirror Jellyfin-Web. The goal is to eventually allow for these same selections to be available for usage in the Player itself to set the max bitrate per playback session. This App-Wide setting is for things like preserving data (Mobile) or for areas that have perpetually have low bandwidth (AppleTV). These settings currently default to 'Auto' which is the current limit of 360,000,000 bps / 360 mpbs. I have added a spot in BaseItemDTO+VideoPlayerViewModel to get the smaller amount between 360 Mpbs and the App Maximum Setting. This exists so I can go back and update this to get the Minumum between the Player Session max bitrate and the App Setting max bitrate.

Test on iPhone 10S, AppleTV 3rd Gen, and the iPhone 15 Pro via enumulator.

* Fix Bitrate naming (360p vs 480p) and remove the setting nested in a second section.

* Creation of a Maximum setting with 360mbps and an auto that gets the bitrate at playback.

* Remove comments for code where I want to eventually put it for better clarify

* Linting fixes

* Change the Playback Bitrate to an Int from a String since the Bitrate is valuable but the string isn't. Run the SwiftFormat on the maxBitrate function.

* Migrate the settings to their own menu with both the bitrate and the optional test size when auto is used.

* Creation of an enum filterValues function for Bitrate. This way, the selection on the Player Overlay (eventually) can be filtered to only include bitrates that are less than or equal to the App Setting for Maximum Bitrate. This should help prevent confusion / remove bandwidth conflicts.

The eventual Player Overlay setting should never conflict with the App-Wide Setting and should only offer options that are less than the App-Wide Setting.

* Change the videoPlayerViewModel to take parameters instead of defaults. Move the defaults up one level to be called there. Split the bitrate test from the getMaxBitrate to better guard against dividing against 0 and also split out the logic to be easier to read.

Change the PlaybackBitrate filter to always include Auto and, when auto, include ALL bitrates. This filter is not currently used.

* Remove the PlaybackBitrate FilterValues since this is not needed and will be created ad-hoc.

* Update the bitrateTestDuration verbage to better reflect that you're changing the size of the bitrate test and not just increasing the duration. Re-use the existing largest to smallest labels since there isn't a ton of benefit using "Longest to Shortest" so this should re-use existing localization. Comment the Labels.

No functional changes. Only an update to labels.

* Delete the Bitrate.json file but retain the Resources folder.

* Remove Resource Folder.

---------

Co-authored-by: Joe Kribs <joseph@kribs.net>
2024-07-23 06:18:28 -05:00
..
AppIcons Update 2024 headers (#951) 2024-01-13 15:13:44 -07:00
Components Update watched indicator color (#1107) 2024-06-28 15:21:22 -06:00
Coordinators App-Wide Bitrate Limit (#1147) 2024-07-23 06:18:28 -05:00
Errors User/Server Sign In Redesign (#1045) 2024-05-14 23:42:41 -06:00
Extensions App-Wide Bitrate Limit (#1147) 2024-07-23 06:18:28 -05:00
Objects App-Wide Bitrate Limit (#1147) 2024-07-23 06:18:28 -05:00
ServerDiscovery Migrate to the latest version of Factory (#1097) 2024-07-01 19:58:59 -06:00
Services App-Wide Bitrate Limit (#1147) 2024-07-23 06:18:28 -05:00
Strings App-Wide Bitrate Limit (#1147) 2024-07-23 06:18:28 -05:00
SwiftfinStore Migrate to the latest version of Factory (#1097) 2024-07-01 19:58:59 -06:00
ViewModels Update ConnectToServerViewModel.swift (#1145) 2024-07-04 23:28:24 -06:00