Added the ability to limit video quality if using mobile data.

* Added a dropdown to video & audio settings
* Changes to ListHelper:
** Limits resolution when code requests the default video resolution
** Limits audio bitrate when code requests the default audio bitrate
** Removed some dead code and did some cleanup
** Make methods private/protected to help understand what was in use
** The code now chooses one format over an other using a simple raking system defined in array constants. I realized I needed to do this in order to choose the most efficient video stream. I did my best to evaluate the video and audio formats based on quality and efficiency. It's not an exact science.
** Made changes to the tests to support my changes
This commit is contained in:
James Straub 2018-04-21 12:35:04 -04:00
parent 7d427b4cc4
commit d1b0cd74be
7 changed files with 432 additions and 119 deletions

View file

@ -19,6 +19,14 @@
android:summary="%s"
android:title="@string/default_popup_resolution_title"/>
<ListPreference
android:defaultValue="@string/limit_mobile_data_usage_value"
android:entries="@array/limit_data_usage_description_list"
android:entryValues="@array/limit_data_usage_values_list"
android:key="@string/limit_mobile_data_usage_key"
android:summary="%s"
android:title="@string/limit_mobile_data_usage_title" />
<SwitchPreference
android:defaultValue="false"
android:key="@string/show_higher_resolutions_key"
@ -39,7 +47,7 @@
android:entryValues="@array/audio_format_values_list"
android:key="@string/default_audio_format_key"
android:summary="%s"
android:title="@string/default_audio_format_title"/>
android:title="@string/default_audio_format_title" />
<PreferenceCategory
android:layout="@layout/settings_category_header_layout"