This simplifies the DownloadHelper code in the demo app and is generally
useful for more specific updates with SelectionOverrides.
PiperOrigin-RevId: 238228276
SQLiteException is a runtime exception, which makes it easy to
forget to handle it. This change converts SQLiteExceptions into
a checked exception, which is then handled appropriately.
PiperOrigin-RevId: 237038793
We currrently just inherit the acitivity's alertDialogTheme style (which
is equivalent to ThemeOverlay.AppCompat.Dialog.Alert). Using the theme
overlay directly and also force-enable the title such that the title is
shown even if the activity disabled the title.
PiperOrigin-RevId: 237012601
The release needs to post to the MediaSource thread and also needs to post
back to the DownloadHelper thread to prevent sending updates after release has
been called. The point where we release the downloadHelper also needs to
dismiss the dialog in case the creation has already been queued before the
release.
PiperOrigin-RevId: 236652309
They are currently broken because we ignore downloads without periods.
As the DownloadHelper doesn't create periods for progressive media, we don't
download them. Fixing by starting download automatically without showing
track selection dialog.
PiperOrigin-RevId: 236120202
Horizontal orientation doesn't make sense. I thought about
overriding the setter to throw something, but it's probably
not worth the extra lines.
PiperOrigin-RevId: 234632530
The system may destroy views at any time and may not have created the view
at all. Use the state saved in the fragment to be independant of the existance
of the view.
PiperOrigin-RevId: 234156285
TrackSelectionView requires an initialization with a call to init(...).
That's why we shouldn't let the view retain its view hierarchy automatically
as the views won't be backed by data if restored. Instead add a listener
which lets the containing activity/fragment save and restore the state if
needed.
PiperOrigin-RevId: 234152491
AlertDialog owns its view, which causes problems with TabLayout on API 21
and 22. Now using AppCompatDialog instead so that we can own the view
ourselves.
Also:
- Renamed layout files from download_xyz to track_selection_xyz.
- Added OK and Cancel buttons to the view.
- Applied alert dialog style to the "normal" dialog to get a nicer UI.
PiperOrigin-RevId: 233944647
We need additional initial selection settings and a configurable title.
The update logic for the track selection parameters moved to a static helper
method in TrackSelectionDialog.
PiperOrigin-RevId: 233713788
Switch from passing an ad UI ViewGroup to passing an object that can also
provide information about controls overlays.
Also switch to using a dedicated overlay for ads instead of the overlay frame
layout, which apps have easy access to.
PiperOrigin-RevId: 233393500
Supporting multiple overrides allows to select tracks from multiple groups, if
enabled. As more options are added, the creation of the dialog is moved to a
separate builder class.
PiperOrigin-RevId: 233366282
It better describes what the class does. More importantly, we've had
inconsistent class names since we added offline support, for which we
added ProgressiveDownloader ("ExtractorDownloader" doesn't make any
sense). We could really do with aligning the names for clarity.
(Sorry)
PiperOrigin-RevId: 231387268
This requires to prepare the media source and the periods in a small helper similar
to the metadata retriever. It also gets rid of the need to have abstract protected
methods to load the manifest, to extract the track groups and to convert to stream keys,
as this can now be handled by the media period.
PiperOrigin-RevId: 231385590