3383 Commits

Author SHA1 Message Date
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
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
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
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
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
olly
adc77fd0b1 Simplify & clean up offline support in demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193938140
2018-05-07 05:58:59 +01:00
bachinger
e0af050163 add notification priority for lower API levels
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193934212
2018-05-07 05:57:53 +01:00
olly
7d6b0e1fda Move renderer flags, overrides and tunneling ID into Parameters
- This is needed to make DefaultTrackSelector properly thread
  safe, and enable atomic changes to the selector that, for
  example, disable a renderer and enable another one at the same
  time.

- This change also saves/restores parameters and the start
  position in PlayerActivity, resolving the ref'd issue.

Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193913350
2018-05-07 05:56:48 +01:00
andrewlewis
5926e20105 Use the codec MIME type for configuration
This may differ from the format MIME type for audio/eac3-joc.

Issue: #4165

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193906521
2018-05-07 05:55:43 +01:00
olly
d3cdf52591 Sanitize MappedTrackInfo API
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193897041
2018-05-07 05:53:05 +01:00
falhassen
c116391fe2 Override RangedUri#toString.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193710604
2018-05-07 05:51:53 +01:00
andrewlewis
30e040a48d Add @DrawableRes for player notification manager icon
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193670840
2018-05-07 05:50:50 +01:00
andrewlewis
9de4e5d7ac Make MediaDescriptionAdapter the last argument
If the caller wants to pass an anonymous inner class for the media description
adapter, this results in slightly more readable code.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193666444
2018-05-07 05:49:45 +01:00
aquilescanta
400619c1c6 Preemptively declare an ID3 track for HLS chunkless preparation
Issue:#3149
Issue:#4016

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193664294
2018-05-07 05:48:42 +01:00
olly
a1b8aa1514 Adding useful track selection strings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193663850
2018-05-07 05:47:33 +01:00
eguven
53a003bae2 Start downloads on DownloadService creation if there are no requirements
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193662396
2018-05-07 05:46:02 +01:00
andrewlewis
b125d79ed6 Add a convenience constructor for a notification manager + channel
Also fix duplicate action strings when using a custom stop action, and do some
misc no-op cleanup.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193652377
2018-05-07 05:44:57 +01:00
eguven
80c28f14b3 Re enable single SimpleCache instance assertion and add helper methods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193637830
2018-05-07 05:42:40 +01:00
falhassen
0666e4f306 Override ChunkIndex#toString.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193600860
2018-05-07 05:41:36 +01:00
andrewlewis
117dd6f33f Mark optional parameters @Nullable
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193530582
2018-05-07 05:39:18 +01:00
andrewlewis
2b367759cf Allow overriding skipping/scaling with custom AudioProcessors
Issue: #3142

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193519029
2018-05-07 05:38:10 +01:00
aquilescanta
d2c6871ce6 Fix HLS encryption method detection
Issue:#4145

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193494319
2018-05-07 05:37:04 +01:00
olly
cdb13dd548 Make SelectionOverride parcelable
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193494016
2018-05-07 05:35:55 +01:00