966 Commits

Author SHA1 Message Date
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
andrewlewis
9e122cbaf9 Use non-deprecated AdsMediaSource constructor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195468987
2018-05-07 07:09:41 +01:00
olly
0edc832d67 Get all track key objects into a consistent state
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=195421908
2018-05-07 07:07:27 +01:00
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
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
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
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
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
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
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
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
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
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
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
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
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