352 Commits

Author SHA1 Message Date
aquilescanta
04d76fa8fc Allow easier ExoPlayer/Cast integration
This CL adds the fundamental pieces for ExoPlayer/Cast integration and includes a
demo app to showcase this functionality. However, media queues should be supported
in the first release of this extension.

Issue:#2283

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165576892
2017-08-17 22:56:52 +01:00
andrewlewis
1cfd246cd3 Update extension README with usage instructions
Issue: #3162

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165572088
2017-08-17 22:55:37 +01:00
olly
757bcf7c63 Update instructions to include Google Maven repository
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165291982
2017-08-17 22:39:15 +01:00
olly
08d16c55d4 Some Leanback extension + minVersion bump fixes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165219604
2017-08-17 22:36:47 +01:00
susnata
c9393db878 Creating an leanback extension for ExoPlayer. Leanback added support for new
transport control, which allows developers to plug in any media player. This
extension provides the PlayerAdapter implementation for ExoPlayer.

Demo:
https://drive.google.com/open?id=0B1GHUu5ruGULZTJVV1pVNlBuVjQ

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165183497
2017-08-17 22:34:10 +01:00
olly
40f34956a8 Bump minimum and target API levels + support lib version
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164863447
2017-08-11 15:01:43 +01:00
bachinger
ab277675a1 set mediaSession flags properly and keep queue in sync when timeline changes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164774783
2017-08-10 13:21:47 +01:00
olly
b6b84839ed Add ErrorMessageProvider to util package
It's needed in multiple places. MediaSessionConnector uses it
today. Our leanback connector will also use it. Maybe
SimpleExoPlayerView should use one too, to show the message to
the user when an error occurs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164720020
2017-08-10 13:19:12 +01:00
olly
55d1abaa21 Document usage of the RTMP extension
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164706135
2017-08-10 13:17:13 +01:00
olly
98d50c13ef Clean up terminology for MediaSession extension
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164705750
2017-08-10 13:14:27 +01:00
olly
d4c45861f4 Clean up extension READMEs
Issue: #1157

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164434768
2017-08-07 11:54:21 +01:00
andrewlewis
c449bae51a Log IMA LOG AdEvent ad data
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164267555
2017-08-04 18:00:00 +01:00
andrewlewis
287b999723 Fix detection of postroll when seeking to duration
Also mark all ads as played when the postroll plays, in the case the
player is backgrounded then resumed and the user seeks back.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164262738
2017-08-04 17:58:32 +01:00
olly
40f3f1cb78 Decrease number of Vpx input buffers
I think they're excessively sized also, but changing that
is a little more risky. And we should look at investigating
the input buffer size for all our decoder extensions,
rather than just this one.

Issue: #3120

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164234087
2017-08-04 12:38:03 +01:00
tonihei
6f7dc974c9 Add forwarding timeline to prevent repetition of boiler-plate code.
Multiple timelines work as a wrapper around another timeline and forward
most of the method calls to the wrapped timeline. Added a base class meant to
be overridden which handles all the boiler-plate forwarding.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164117264
2017-08-04 12:28:19 +01:00
olly
78cdd08684 Add some missing @param Javadoc to extensions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164105607
2017-08-03 14:45:45 +01:00
olly
147d5bb3b2 Fix targetSdkVersion to be consistent with gradle builds
The manifest value is always overridden in gradle builds,
so this is for internal builds only. The value should be
the same (i.e. 25!).

Also fix IMA build to force the right support library
version, attempt 2!

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164103183
2017-08-03 14:44:26 +01:00
aquilescanta
a5f9f40bf0 Replace README reference to source with reference to javadoc
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164090619
2017-08-03 14:41:48 +01:00
olly
412138b2ea Some extractor fixes
- Fix Ogg extractor to work without sniffing.
- Fix extractors to handle seek() before init().
- Add tests for both issues.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163992343
2017-08-02 17:44:41 +01:00
olly
13513b9c3e Clean up MediaSessionExt documentation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163828712
2017-08-01 16:23:39 +01:00
olly
957158b7ff Fix 2.5.0 lint errors
- Publish IMA extension
- Force IMA to use the correct version of the support library
- Add missing sr translations for repeat mode strings

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163705883
2017-07-31 21:19:42 +01:00
andrewlewis
cdeea27973 Handle release() while initializing the ads manager
Also don't detach any attached player in release() to prevent a possible
NullPointerException if ImaAdsLoader.release() runs first, then the MediaSource
is released and detaches the player. This is safe because if the loader was
attached it's guaranteed to be detached.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163673750
2017-07-31 21:13:00 +01:00
andrewlewis
1f0c85bd73 Allow apps to handle ad clicked/tapped events
Issue: #3106

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163455563
2017-07-31 21:09:00 +01:00
eguven
9936bc6702 Replace iterable foreach loops with indexed for loops
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163193118
2017-07-31 20:55:34 +01:00
eguven
cdb71a80aa Remove empty line after copyright text
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163186057
2017-07-31 20:52:49 +01:00
olly
4436e94ba8 Hardcode libopus output frequency to 48000Hz
Issue: #3080

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162746202
2017-07-21 17:37:56 +01:00
andrewlewis
cdfe57833d Update IMA extension README
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162742982
2017-07-21 17:36:31 +01:00
bachinger
6f600a8fa5 Take care playback preparer and queue navigator can not register overlapping
playback actions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162736210
2017-07-21 16:10:10 +01:00
bachinger
3bc3900dba Do not update queue when the queue did not actually change to avoid
unnecessary updates are broadcasted to all clients.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162728670
2017-07-21 16:08:45 +01:00
andrewlewis
07de4d1b2c Handle ad skipping and content resume
SKIPPED can't be handled as CONTENT_RESUME_REQUESTED because after skipping an
ad there may be further ads to play in its ad group.

Remove workaround for handling unexpected playAd without stopAd, as the player
can instead recover when IMA sends CONTENT_RESUME_REQUESTED. This in turn fixes
handling of the case where playAd is called twice but IMA expects only the
first ad to play, when skipping a particular ad. (Add an ad tag where this
occurs to internal samples.)

Check whether a currently playing ad has been marked as played in
ExoPlayerImplInternal, and handle this case as a seek. This ensures that any
loaded ad periods are discarded in the case of CONTENT_RESUME_REQUESTED.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162610621
2017-07-21 11:23:10 +01:00
olly
94b08b27e9 Fix MediaSession gradle file to use modulePrefix
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162610352
2017-07-21 11:21:46 +01:00
andrewlewis
554a399407 Switch to non-deprecated player constants
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162605429
2017-07-21 11:20:07 +01:00
bachinger
8d56f904a0 make MediaSessionConnector depend only to the Player interface
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162604746
2017-07-21 11:18:42 +01:00
olly
19087a7fa0 Fix broken Javadoc
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162601961
2017-07-21 11:16:01 +01:00
olly
e5952d4859 Upgrade RTMP dependency
- Drop minimum version to new RTMP min version
- Publish the extension

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162477200
2017-07-19 19:48:17 +01:00
andrewlewis
4658e619b3 Don't modify playWhenReady in ImaAdsLoader, except for playAd
Store playWhenReady when playAd is called, and restore it if necessary when the
content resumes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162471616
2017-07-19 14:18:26 +01:00
andrewlewis
5e81cf99dc Fix comment typo
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162368534
2017-07-19 14:17:04 +01:00
aquilescanta
4f5ac9e04f Extract Player interface from ExoPlayer
This is the first step towards facilitating Cast integration to ExoPlayer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162366198
2017-07-19 14:15:45 +01:00
andrewlewis
41028fafba Workaround late event delivery from IMA
Remove assertions in pauseAd()/playAd(), which can fail if events are delivered
after detaching the player, and log warnings instead.

Use whether IMA has sent CONTENT_PAUSE_REQUESTED/CONTENT_RESUME_REQUESTED to
determine whether we pause/resume the AdsManager, matching the IMA
documentation.

Also clean up use of player.isPlayingAd vs playingAd.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162364751
2017-07-19 14:14:26 +01:00
tonihei
0717c3502f Extend Clock interface with sleep method and add FakeClock.
The FakeClock allows to simulate timing behaviour including sleep time
for test cases.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162345258
2017-07-19 14:06:18 +01:00
olly
4fd516e35b Make MediaSessionConnector depend only on ExoPlayer
This is possible to do without passing the player instance to
custom action providers through their constructors, given we
no longer have a MuteActionProvider. Passing the player through
the constructors generalizes better to such cases, however, so
feels like the right thing to do.

It's also possible to use generics and keep passing the player
instance via the CustomActionProvider methods, but this adds
some unnecessary complexity.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162333043
2017-07-19 14:03:38 +01:00
bachinger
5be79d4f42 Media session extension to connect ExoPlayer with the MediaSession of the
framework.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162245883
2017-07-17 23:22:41 +01:00
olly
387720d182 Allow module registrations + log player release
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162223981
2017-07-17 23:21:34 +01:00
olly
daa214f82a Reinstate gradle instructions for IMA extension
Note: Wont work quite yet; we need to actually do a
release for the instructions to become effective.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162220939
2017-07-17 23:19:03 +01:00
andrewlewis
6041b0fe9c Handle VAST loading errors by playing content
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162204327
2017-07-17 23:12:34 +01:00
matttt
7b20e130ce Allow a direct executor for Cronet's response handling thread.
We want to experiment with a direct executor to avoid thread hops between the
network thread and the response handling thread. This change is needed to do
so.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161812382
2017-07-15 17:29:41 +01:00
andrewlewis
70c5bf7052 Support resuming ads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161778560
2017-07-15 17:22:52 +01:00
olly
ecc8f6c4fa Upgrade dependencies
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161648060
2017-07-12 18:23:11 +01:00
andrewlewis
6b17e2cf3f Fix handling of postrolls
adsLoader.contentComplete was called twice which led to postrolls not seeing
the STARTED event.

Also make the onPositionDiscontinuity handler easier to follow by renaming
variables, and remove the adGroupIndex field.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161537765
2017-07-12 18:19:41 +01:00
andrewlewis
0b58c33632 Handle detaching and reattaching the ads loader
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161526026
2017-07-12 18:17:13 +01:00