124 Commits

Author SHA1 Message Date
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
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
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
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
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
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
olly
503a911a77 Use correct IntDef
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193651020
2018-05-07 05:43:46 +01:00
eguven
f4ade38ae4 Add ability to download not DRM protected content to the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193554024
2018-05-07 05:40:30 +01:00
olly
fec7d32836 Remove TrackSelection.Factory from SelectionOverride
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=193045534
2018-05-07 05:28:06 +01:00
olly
1944ebb463 Move random adaptation to an intent extra.
This will help with removing selection factories from
SelectionOverride. It doesn't seem worth the effort to
have this togglable and in the UI of our demo app.

This change will also:

- Help to move TrackSelectionHelper into the UI module,
  since it removes the part that's obviously debug-only.
- Make it possible to specify the ABR algorithm for each
  sample, which might be nice as we start implementing
  more of them.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192760196
2018-04-16 10:49:12 +01:00
olly
67cde97a70 Move code unrelated to mapping to DefaultTrackSelector
Issue: #3915

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192759210
2018-04-16 10:47:55 +01:00
aquilescanta
7d0067e298 Fix external storage read permissions bug
Fix bug which causes the PlayerActivity to finish whenever the
android.permission.READ_EXTERNAL_STORAGE permission is requested.

A better solution would involve not requesting permissions if a
previous request is still pending. This would involve keeping
extra state in the activity, so this solution is used to keep
the demo app's complexity at a minimum.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=192588821
2018-04-16 10:33:27 +01:00
olly
03a36ce6ba Fix NPE cause by demo app adding null listener to drm manager
Also added an assertion to the DRM event dispatcher to cause
immediate failure when this happens. This is consistent with
the assertion in the equivalent MediaSource class.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191892735
2018-04-08 16:39:57 +01:00
olly
fa1856942b Add proguard configuration for Cast demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191442704
2018-04-03 18:49:21 +01:00
olly
62aea5857c Remove view index adjustment for retry button (which no longer exists)
Issue: #4059

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191414566
2018-04-03 15:33:59 +01:00
danarapagna
6380f26a7f Temp fix for b/77315136: Don't lock or check cache directories in SimpleCache
To be immediately rolled back after submission

Submitting on behalf of cblay.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191128111
2018-04-03 15:27:26 +01:00
eguven
e12f890dee Fix NPE in PlayerActivity while playing a playlist
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190787884
2018-03-29 13:42:14 +01:00
tonihei
db475fea86 Add back accidentally deleted parameter in PlayerActivity.
A merge error in a previous change removed the drmSessionManager from
the player factory call.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190769364
2018-03-29 13:37:14 +01:00
tonihei
e228947831 Check for failure cases in demo app before instantiating player and source.
Doing that in the current order may result in cases where we have a player
instance but a null media source and thus the next call to initializePlayer
will fail.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190765633
2018-03-29 13:33:48 +01:00
tonihei
3cbe91a3b0 Pass DrmSessionManager through SimpleExoPlayer.
This will allow SimpleExoPlayer to auto-register its own listener before the
drm session manager is used to set-up the renderers.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190478174
2018-03-28 00:43:07 +01:00
tonihei
40947d52f0 Support multiple DefaultDrmSessionManager listeners.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=190236842
2018-03-28 00:34:25 +01:00
eguven
522f8c8a99 Make demo app play content from download cache
It's inserted before HttpDataSource as read only.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189815245
2018-03-28 00:22:15 +01:00
eguven
764d18f68f Add ability to play filtered manifests in PlayerActivity
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189796293
2018-03-28 00:20:27 +01:00
tonihei
e3a90a44b7 Support media source events for composite media sources.
This is achieved by automatically registering a listener for child sources in
compositions. The composite media source has the chance to correct the
reported window index and media period id in the MediaLoadData of the events.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189575414
2018-03-28 00:06:58 +01:00
olly
0b182d1849 Remove versions from IMA demo manifest that are now specified via gradle
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=189000217
2018-03-27 23:44:38 +01:00
aquilescanta
18b1ec7a2f Recreate the cast media queue whenever the timeline is cleared
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188871914
2018-03-13 15:42:24 +00:00
olly
0e756b0e71 Centralize version and target sdk constants
We had these specified directly in AndroidManifest.xml due to
our internal build setup. This change makes our internal build
re-write AndroidManifest.xml to dynamically insert the required
values, meaning they no longer need specifying in each manifest.

Bonus 1: Internally built demo apps now include the CL number at
which they're built in the version name :).

Bonus 2: Removes lint warning that complains min/target SDK
values in the manifest are redundant.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188489115
2018-03-12 15:20:51 +00:00
tonihei
8f952162ff Allow multiple media source event listeners.
This is achieved by moving the listener registration and the creation of the
event dispatcher into BaseMediaSource.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=188461932
2018-03-12 15:15:34 +00:00
tonihei
c0c11af29f Reuse media sources in demo apps.
Especially the cast demo app benefits from this feature as it can keep its
ConcatenatingMediaSource all the time without having to repopulate it
when switching players.

Issue:#3498

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187866048
2018-03-07 15:12:50 +00:00
hoangtc
fcb796a80c Migrate ExoPlayer Gradle build files.
- Change 'compile' configuration (deprecared) to using 'implementation'
and 'api' configurations instead.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187311778
2018-03-02 09:20:02 +00:00
tonihei
2f4a3d2e5d Replace ConcatenatingMediaSource with DynamicConcatenatingMediaSource.
The non-dynamic media source has a strict subset of features of the dynamic one and
thus can be replaced.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=187299432
2018-03-02 09:16:00 +00:00
ojw28
dc34ff2e6b
Merge pull request #3771 from reudismam/dev-v2
Use the pattern "string literal".equals(something) to prevent NPE …
2018-02-27 11:24:29 +00:00
olly
69496eb17e Bump to 2.7.0 and prepare release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=186200840
2018-02-19 13:24:51 +00:00
andrewlewis
aa63ad3af0 Handle LOG AdEvents for ad group load errors.
If IMA loads an empty VAST document for an ad group it notifies via a LOG
AdEvent. Handle the event by updating the AdPlaybackState accordingly.

The error state will be handled in ExoPlayerImplInternal in a separate change.

Issue: #3584

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184516585
2018-02-08 14:49:00 +00:00
olly
696ebf3ded Suppress proguard notes about unresolved classes
In the case of the components we deliberately access via
reflection, it's normal that they might not be resolved
due to proguarding (i.e. if the app isn't being built to
include them). Don't note their omission.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184120611
2018-02-01 15:24:00 +00:00
olly
a7d4d2d21c Automated g4 rollback of changelist 184056034.
*** Reason for rollback ***

Broke everything

*** Original change description ***

Clean up message naming in EPII

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184061352
2018-02-01 15:13:51 +00:00
olly
2f932bfaf7 Clean up message naming in EPII
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184056034
2018-02-01 15:11:00 +00:00
aquilescanta
e7ba2caf47 Clear the media queue and stop casting on app pause
Simplifies the app and prevents inconsistent states between
both players and the media queue.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183831329
2018-02-01 15:04:54 +00:00
olly
1f6d161d4d Fix proguard configurations
1. When we try and load something via reflection and find the
   class, always throw rather than failing silently if we
   subsequently fail to instantiate an instance. This is
   indicative of a broken proguard setup, and failing silently
   makes it hard to spot.
2. Add library/core proguard configuration to ensure extension
   renderer constructors that we access via reflection are kept.
3. Add demos/main proguard configuration to ensure ImaAdsLoader
   constructor that we access via reflection is kept.
4. Added IMA proguard file to hopefully fix #3723, although I
   wasn't actually able to reproduce the issue.

Issue: #3723

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183648187
2018-02-01 14:52:16 +00:00
reudismam
a3891f6f5a Use the pattern ''string literal''.equals(something) to prevent NPE as it is done in many other locations in the codebase. 2018-01-30 12:50:20 -03:00
olly
5dff21e5de Remove part of DemoUtil from demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183056883
2018-01-24 10:34:56 +00:00
eguven
aa1b41bf2f Generalize parameter type in DemoApplication build methods
Instead of DefaultBandwidthMeter, TransferListener<? super DataSource>
is used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182785785
2018-01-23 19:27:41 +00:00