5060 Commits

Author SHA1 Message Date
olly
bef4a20c31 Move DownloadManager initialization into the application
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195317847
2018-05-07 06:57:19 +01:00
andrewlewis
a0b3fb4e87 Clarify not using 'and' as the item separator
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195282481
2018-05-07 06:56:11 +01:00
olly
bf88b04380 Bump version to 2.8.0
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195271273
2018-05-07 06:55:06 +01:00
olly
c5bf7f4513 Further clean up DownloadActions + DownloadActivity
- Made parts of DownloadActions public that were previously hidden.
  This is necessary so that when an app is listening to the
  DownloadManager, it can tell something about the tasks.
- Simplified DownloadActivity some more. The helpers may migrate
  into their corresponding modules at some point, and also be
  converted to return structured TrackGroupArrays rather than a
  flat list of Formats.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195269824
2018-05-07 06:53:59 +01:00
tonihei
5a1431c904 Turn on automatic nullness check for DASH.
Also add a build rule to simplify the test setup with a custom blacklist.
In addition, the test path pattern are made less specific to capture all the
static nullness tests in the /main/ directories.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195230334
2018-05-07 06:50:52 +01:00
olly
b23eabd939 Add error and buffering views to PlayerView
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195203362
2018-05-07 06:49:47 +01:00
tonihei
7799e8fd5e Add dependency on nullness annotations and add missing annotations for DASH.
This includes only the (hopefully) non-debatable changes for the DASH module
and all needed changes for call into the core library.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195097791
2018-05-07 06:48:44 +01:00
olly
c466fabb1c Use integers for HLS rendition keys
Currently it's possible to copy a master playlist with a URL
that was never present in the original. This change prevents
this, and also moves the key more in line with DASH/SS.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195065286
2018-05-07 06:47:40 +01:00
olly
d38e4dc8e0 Give actions per-type versioning
A single master version prevents app developers from providing
custom download functionality (because they can't increment the
version). It's also error prone to expect someone modifying the
DASH action to remember to update the ActionFile master version.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194981886
2018-05-07 06:46:33 +01:00
andrewlewis
3f003c517c Remove documentation on calling startDownloads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194961264
2018-05-07 06:45:30 +01:00
tonihei
ddeafa4fef Remove ad events from analytics listener and collector.
Ad load errors will be forwarded as media source load errors in the future
and other ad events are not actually player related to warrant reporting
them as part of playback analytics.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194936656
2018-05-07 06:44:27 +01:00
olly
175a0100d0 Remove ability to query Downloader implementations
This was adding a lot of code, and the multiple use cases
for Downloader was pretty confusing (in particular the
ordering of method calls was unclear). It's also not
performant (e.g. it requires loading/parsing manifest(s)
and initialization segments from disk).

In practice I think apps will need to keep a record of
what's offlined in their app's database (or equivalent),
which they can update by registering as a listener on
DownloadManager. This will be done for the demo app in
a subsequent change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194932876
2018-05-07 06:43:25 +01:00
olly
d4f75963c4 Set content length and redirect uri in a single transaction
NORELNOTES=true
NO_BUG

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194932235
2018-05-07 06:42:16 +01:00
olly
59c620c23c Clean up offline notifications
- It's much cleaner to split completed/error notification methods.
- Make error notification show the content title in the demo app.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194920507
2018-05-07 06:41:12 +01:00
andrewlewis
5d3c080f06 Fix NPE on tapping download notification
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194902748
2018-05-07 06:40:09 +01:00
andrewlewis
880ce3f59a Add content intent for download notifications
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194882787
2018-05-07 06:38:50 +01:00
aquilescanta
d412dc97dc Fix seeking in live HLS streams
Issue:#4187

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194829857
2018-05-07 06:37:47 +01:00
olly
c8ec77ef96 Make MediaSessionConnector use getPlaybackError
It's no longer necessary to stash a reference to the
error yourself. This also correctly handles the case
where setPlayer is called with a player that's already
in an error state.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194828387
2018-05-07 06:36:43 +01:00
olly
fedf8dd5c1 Make download notification more informative when removing downloads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194827787
2018-05-07 06:35:38 +01:00
olly
7723f5bdf1 Clean up offline class names
This change is intended to resolve overloading of "Download",
where a DownloadTask could be an actual download task, or a
remove task.

Also cleaned up some documentation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194815058
2018-05-07 06:34:16 +01:00
olly
c68e00e28f Fix crash in CronetEngineWrapper
Cronet now returns an unmodifiable list, so we need to copy it

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194790506
2018-05-07 06:32:59 +01:00
olly
c6bedc6a85 Improve scheduling
- Redefine Scheduler interface to better describe what implementations
  do. The previous version was too general, in that it allowed concrete
  DownloadService implementations to pass different Requirements to
  the base class and to the Scheduler. It's also difficult to see how
  that version could ever support dynamic updates to Requirements, which
  is probably a feature we'll need to add quite soon.
- Fix a (probably theoretical) problem where static fields in
  DownloadService assumed only a single concrete implementation.
- Stop using PlatformScheduler pre-API-21 in demo app, because it will
  fail.
- Define default Requirements that require network.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194785751
2018-05-07 06:31:28 +01:00
tonihei
c1e3cb767e Don't forward main looper messages to custom looper.
Our current custom looper implementation tries to handle all messages
including those sent to the main looper. However, the main looper does not
use our doLoop implementation and thus messages never get executed.

This adds a check whether the target looper is the main looper and if so,
uses the default message forwarding implementation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194779214
2018-05-07 06:29:56 +01:00
olly
410264954f Don't open DataSink if resolved length is 0
- It's wasted effort
- DataSpec reconstruction fails because creating a DataSpec with 0
  length isn't allowed.
- Also better document DataSink open/close, to be like DataSource.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194778132
2018-05-07 06:28:53 +01:00
tonihei
d1fdc518fb Use AnalyticsListener in EventLogger.
This replaces the existing listeners and provides some additional meta data
for each event.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194770421
2018-05-07 06:27:52 +01:00
olly
c0fdbde903 Fix permissions lint errors.
- Add ACCESS_NETWORK_STATE to core library. It seems fairly fundamental. We should
  also be using it elsewhere (e.g. to fail fast if there's no network).
- Add annotation to force apps using PlatformScheduler to declare RECEIVE_BOOT_PERMISSION

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194763051
2018-05-07 06:26:46 +01:00
olly
9c15c63d4e Add util method for starting foreground services
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194761771
2018-05-07 06:25:40 +01:00
olly
85384cf45b Add extra context to strings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194691625
2018-05-07 06:24:29 +01:00
olly
159979e69e Remove spurious TargetApi annotation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194535300
2018-05-07 06:23:06 +01:00
hoangtc
ed994517b2 Changes MetadataRetrieverTest to use a TestRunner.
Add a TestRunner for MetadataRetriever that roughly follow the test runner for
ExoPlayer. The TestRunner supports scheduling test steps in a sequence, compare
expected callbacks with actual callbacks, and block the test until it is done.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194518738
2018-05-07 06:22:03 +01:00
olly
3e76464666 Fix download percentage reporting
- When calculating the downloaded percentage in DASH, there was no
  way to disambiguate between 0 of 0 segments being downloaded because
  there are no cached indexes (i.e. 0% downloaded) and 0 of 0 segments
  being downloaded because the index defines 0 segments (i.e. 100%
  downloaded).
- Also replace use of NaN with a named constant.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194453202
2018-05-07 06:20:59 +01:00
hoangtc
fe32401792 Supports extracting from AMR container format.
Supports extracting data from AMR container format for both narrow and wide
band formats. Also added AmrExtractor as one of the default extractor to be
used in DefaultExtractorsFactory.

GitHub: #2527.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194407507
2018-05-07 06:19:55 +01:00
olly
59f01ec333 Use manifest filtering when downloading.
When we play downloaded content, we rely on the manifest filters
to produce a manifest that contains only the content that was
downloaded. It makes sense just to use the same filters during
download too, so we don't have to worry about any implementation
differences.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194380704
2018-05-07 06:18:51 +01:00
olly
6ac252843e Move TrackSelectionHelper to UI module
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194373357
2018-05-07 06:17:46 +01:00
aquilescanta
ddef32c9e2 Support multiple EXT-X-MAP tags
Issue:#4182

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194223312
2018-05-07 06:16:32 +01:00
olly
dcff063709 Fix DefaultTrackSelector bug + improve equals check
- clone() wasn't performing a deep enough copy
- Sort tracks in overrides to improve equals check

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194220596
2018-05-07 06:15:29 +01:00
olly
0d9d1998f4 Centralize manifest filtering.
The generic type for track key will go away soon.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194220450
2018-05-07 06:14:25 +01:00
olly
b77d6c4ef4 Remove Downloader.ProgressListener
ProgressiveDownloader never implemented this properly, and we
don't use it in DownloadManager/DownloadService, both of which
use a polling model. A polling model is also what's used elsewhere,
for example to query the current playback position.

This is effectively doing the TODO in ProgressiveDownloader.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194214579
2018-05-07 06:13:24 +01:00
olly
b6f646ed96 Clean up DownloadAction instances
This removes a fair chunk of code. The line delta would
be more negative if it not for adding all the /* x= */
comments in DashDownloadActionTest!

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194136689
2018-05-07 06:11:49 +01:00
olly
c9bb102f93 Use Uri rather than string for ProgressiveDownloadAction
This makes it consistent with the other download types.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194089486
2018-05-07 06:10:44 +01:00
tonihei
f320d9e0ab Deprecate add/remove video/audio debug listener in SimpleExoPlayer.
Using addAnalyticsListener provides the same functionality with additional
information.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194071893
2018-05-07 06:09:40 +01:00
olly
1f3adacac3 Use parcelable keys for HLS downloads to remove special casing
This removes the need for separate String/Parcelable filter paths in
the demo app. Hopefully this is a temporary measure as we work
toward using track groups + consistent keys for all media types.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194065499
2018-05-07 06:08:34 +01:00
tonihei
874dc202f8 Prevent timeline access in AnalyticsCollector for future windows and periods.
Some of the events are emitted by the media periods itself and their index may
not be available in the publicly accessible timeline yet.

To prevent this, we currently check for timeline.isEmpty() only. But this may
also happen for dynamic changes, e.g. when new sources are added in fast
succession and a manifest for one of the new sources starts loading before the
updated timeline is reported.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=194057401
2018-05-07 06:07:29 +01:00
olly
f96f053f2e Reinstate non-static useExtensionRenderers method
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193970940
2018-05-07 06:06:19 +01:00
bachinger
301bb3ada4 add flag to hide play/pause button
exoghi/4056

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193960004
2018-05-07 06:05:16 +01:00
olly
f7c5e475a7 Prevent native crash in raw decoder
Playback will still fail if an input sample is larger
than 32K, but will now fail gracefully.

Issue: #4057

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193951955
2018-05-07 06:04:13 +01:00
olly
895ac660a8 Default playClearSamplesWithoutKeys consistently to false
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193942368
2018-05-07 06:03:12 +01:00
andrewlewis
ddd603a1ee Add DownloadService constructor for notification channel
Also move NotificationUtil from the UI module to the core module.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193941401
2018-05-07 06:02:07 +01:00
olly
79c105be59 Clean up naming of demo app download components
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193940323
2018-05-07 06:01:05 +01:00
andrewlewis
f6d5cb9934 Add a convenience constructor for DownloadManagers
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193940183
2018-05-07 05:59:59 +01:00