188 Commits

Author SHA1 Message Date
tonihei
f8a3c135e5 Use overflow-save add operation for blacklisting duration.
This allows to specify open-ended blacklisting with Long.MAX_VALUE.

PiperOrigin-RevId: 222550939
2018-11-23 12:31:12 +00:00
olly
6ebb6124bb Offline refactor step 1a - Make DownloadAction concrete
1. Pull up all subclasses of DownloadAction into DownloadAction
2. Add DownloaderFactory for Downloader instantiation, and DefaultDownloaderFactory
   to replace the instantiation logic being removed from the DownloadAction
   subclasses.

This change will upgrade existing action files gracefully (i.e. it does not
lose compatibility with the existing offline implementation, other than some
minor breaking changes to the API).

TODOs:

1. Move test methods from the XDownloadActionTest classes into DownloadActionTest.
   This will be done in a subsequent CL. There's a lot of consolidation that can
   be done here, including de-duplicating some of the test code added in this CL.
2. Look at merging DownloaderConstructorHelper into DefaultDownloaderFactory.
3. Use customCacheKey in DASH/HLS/SS Downloaders, for completeness.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=222258983
2018-11-22 12:39:37 +00:00
andrewlewis
bc5e12013b Remove executable bit from some resources
Copybara propagates this bit on the files, so removing it avoids some
unnecessary changes in the first migrated commit.

Also losslessly optimize two PNG files.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220268951
2018-11-07 17:57:42 +00:00
aquilescanta
80e9c84a9e Remove RemotePlayer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217708323
2018-10-18 23:39:51 +01:00
tonihei
0a7745bc03 Fix some random Android Studio warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215904019
2018-10-15 09:26:36 +01:00
aquilescanta
34c286682e Extract PlayerManager interface in the Cast demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=215389291
2018-10-03 22:04:20 +01:00
aquilescanta
2a50621118 Use media item in the cast demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214750185
2018-09-27 17:46:27 +01:00
aquilescanta
776ad20a50 Add a MediaQueue abstraction to the cast extension
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214598078
2018-09-27 17:41:10 +01:00
tonihei
e25b7d2148 Add wrapper for Log messages to allow settig the log level.
Currently there is no way to disable (or reduce) the logcat output generated
by ExoPlayer.

Issue:#4665

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213421072
2018-09-20 12:12:21 +01:00
olly
62532f9a2e Revert accidental change to media.exolist.json
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212790665
2018-09-13 18:41:51 +01:00
olly
a5a7e988e3 Clip DASH periods to their durations
Issue: #4185

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=212619419
2018-09-12 15:30:47 +01:00
aquilescanta
da88b34687 Fix HLS advanced TS and fMP4 sample streams
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211976724
2018-09-12 15:01:29 +01:00
olly
924a76d532 Clean up use of deprecated APIs
- Add @Deprecated on overrides of deprecated method.
- Suppress deprecation warnings where appropriate.
- Use non-deprecated alternatives where appropriate.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=210092434
2018-08-24 16:12:44 +01:00
eguven
14c7c2995c Add android.permission.FOREGROUND_SERVICE
Apps targeting P or later now must request this permission in order to
use foreground services.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209762160
2018-08-24 15:51:58 +01:00
eguven
02a8964fe2 Support VR180 videos
If available parse and use spherical metadata:
https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md

RELNOTES=true

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209754080
2018-08-24 15:44:24 +01:00
aquilescanta
8927993b03 Prevent a Demo app NPE on Android TV
The options menu is not available on Android TV, which triggers a
null pointer exception whenever a sample is chosen.

This CL is a temporary fix until we rework the UI to not use
an options menu.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209742076
2018-08-24 15:38:17 +01:00
aquilescanta
f64ec43acd Remove usage of deprecated method from the Demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209390036
2018-08-24 15:22:40 +01:00
olly
bd8a956d53 Use lamdas everywhere
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=209162373
2018-08-24 15:19:30 +01:00
olly
ab72dd44ed Move decoder and ABR preferences to overflow menu
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208977806
2018-08-16 16:43:26 +01:00
andrewlewis
5f75d6ea13 Target API 28
Apps targeting API 28 by default do not grant permission for cleartext traffic,
so update the demo app to show a warning if loading an HTTP URI will fail. See
https://developer.android.com/about/versions/pie/android-9.0-changes-28 for
information on behavior changes in API 28.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208204937
2018-08-13 14:04:14 +01:00
olly
bac597cb07 Update dependencies + misc fixes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208195761
2018-08-13 14:02:51 +01:00
andrewlewis
93f591be3e Release ads loader on new intent in the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208056265
2018-08-13 13:56:28 +01:00
eguven
fc9c851601 Fix media.exolist.json format
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=208006056
2018-08-13 13:47:05 +01:00
andrewlewis
9eff531c08 Use only HTTPS for external demo app media
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207881679
2018-08-13 13:44:29 +01:00
olly
4558eb4e99 Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207556225
2018-08-06 17:26:23 +01:00
hoangtc
b3d52f5d80 Add MetadataRetriever demo.
Add a demo app that shows case how to use APIs from MetadataRetriever to
retriever track groups and frames from some media.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=207269221
2018-08-06 11:29:27 +01:00
eguven
45c1e9eef3 Add missing Nullable annotation Player.EventListener.onTimelineChanged
Issue: #4593

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206911927
2018-08-01 13:49:21 +01:00
andrewlewis
5715960304 Add Context to SimpleExoPlayer factory methods
This is needed for implementing (optional) support for audio focus handling in a
later change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206899837
2018-08-01 13:49:21 +01:00
eguven
02e9972630 Add 360 video samples to the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=206747144
2018-08-01 13:49:20 +01:00
eguven
9c337c8806 Add monoscopic 360 surface type to PlayerView
Using this surface it's possible to play 360 videos in a non-VR Activity that is
affected by phone and touch input.

RELNOTES=true

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205720776
2018-07-24 14:54:05 +01:00
tonihei
5933d92394 Add simplified Dash and Ss media source factory constructors.
As the manifest and media data sources can be the same now, we can provide
a simplified constructor with just one data source factory.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205658046
2018-07-23 15:55:57 +01:00
tonihei
c24a699b34 Update demo apps to use player-provided default bandwidth meter.
This simplifies the player setup and prevents using deprecated methods in the demo.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205642981
2018-07-23 13:35:08 +01:00
eguven
7b2da629ea Make it possible to disable DownloadService notifications
Issue: #4389

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=204728270
2018-07-17 20:27:30 +01:00
eguven
93cbae5bff Use default Deserializers if non given to DownloadManager
Also moved shared code to SegmentDownloadAction between its subclasses.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=202294880
2018-06-28 16:18:50 +01:00
tonihei
156e2317cc Deprecate Player.DefaultEventListener in favor of default no-ops in interface.
The DefaultEventListener was added for selective overrides. Now that Java 8
support is enabled, these selective listener overrides can be implemented
more easily and more flexible using default methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201695490
2018-06-22 17:49:25 +01:00
eguven
fb00221d7d Fix demo app multi period stream track selection for downloading
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199791722
2018-06-18 11:02:46 +01:00
eguven
a406dc8bee Use TrackKey in place of RepresentetionKey, StreamKey, RenditionKey
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199767518
2018-06-18 10:58:52 +01:00
aquilescanta
645363059b Fix leak in the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199448766
2018-06-06 18:58:37 +01:00
eguven
810e06c338 Fix starting the download service in the background throw exception
This happens when the device screen is locked.

This fixes a previous attempt to fix the problem.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199130325
2018-06-05 12:43:03 +01:00
eguven
536bd68294 Fix starting the download service in the background throw exception
This happens when the device screen is locked.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198875192
2018-06-05 12:37:24 +01:00
tonihei
27f009d239 Enable Java 8 support.
This enables compiler support for Java 8 features.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198709705
2018-06-05 12:29:14 +01:00
tonihei
e162d35689 Fix permissions in demo app.
The ACCESS_NETWORK_STATE permission is only included indirectly which doesn't
work in all build systems.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197399274
2018-05-22 09:11:32 +01:00
olly
94ffbee7e5 Fix demo app playlist playbacks
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195752969
2018-05-08 02:06:39 +01:00
olly
7afdf84a9d Fix DownloadService notification flicker
This type of flicker was visible (at least on my S8) whenever starting
the demo app process (from being properly killed) when other notifications
(e.g. completed download notification) was present.

This change passes whether the service was started as foreground through
the intent, and only applies the show-notification-on-stop hack if it
was. It's only necessary to start as foreground if your app is not already
in the foreground, so it's not necessary to do this from activity/ui
components.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195594930
2018-05-07 07:25:02 +01:00
olly
983fe9cc9f Add DownloadManager.Listener.onInitialized
If an app wants to reconcile its own state with that of a DownloadManager,
it's helpful to know when the DownloadManager has finished restoring any
previously persisted tasks.

Also suppress initial "state changed to paused" listener invocations for
tasks that are immediately started.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195594881
2018-05-07 07:23:58 +01:00
olly
b9aaf1ebab Improve offline support in the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195593235
2018-05-07 07:22:53 +01:00
olly
dbd768fbd7 Fix selection item
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195544030
2018-05-07 07:16:27 +01:00
olly
17b4e020f4 Tweak sample chooser
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195511490
2018-05-07 07:15:21 +01:00
olly
416d6c9eeb Move download helpers into core library
Also convert them to exposing periods and track groups, like
regular MediaSources do. This gets us much closer to being
able to use standard track selection components during offline
initialization. The helper is responsible for reverse mapping
selected tracks onto physical streams when generating the
download action. This is trivial except for the HLS case, which
is a TODO for now.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195500826
2018-05-07 07:12:46 +01:00
andrewlewis
4ee1daef0e Make download action custom data a byte[]
This may be preferable for using custom binary data,
and it's still easy to store Strings if needed.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195486817
2018-05-07 07:10:46 +01:00