194 Commits

Author SHA1 Message Date
tonihei
b9a6a40539 Add listener callback for shuffle mode changes.
The listener implementations do not do anything yet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166056933
2017-08-22 16:23:27 +01:00
olly
34960ad891 Tweak and add READMEs + remove refs to V1
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165578518
2017-08-17 22:59:34 +01:00
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
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
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
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
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
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
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
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
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
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
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
andrewlewis
ef56c9fe39 Move ad playback state into ImaAdsLoader
Once background and resuming is supported, the ads loader will be kept when the
player is destroyed and recreated. Move the state relating to the structure of
ads and what ads have been loaded/played out of the media source and into the
loader so the information is not lost when the source is released, in
preparation for supporting background and resuming.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161503571
2017-07-12 18:11:39 +01:00
andrewlewis
b3a7f8774f Upgrade IMA dependencies and README
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160632943
2017-06-30 16:51:06 +01:00
andrewlewis
1f815db367 Switch the IMA extension to use in-period ads
This also adds support for seeking in periods with midroll ads.

Remove Timeline.Period.isAd.

Issue: #2617

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160510702
2017-06-30 16:35:14 +01:00
olly
d5c2cf79f4 Update READMEs with new local build instructions
Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160290097
2017-06-28 22:26:05 +01:00
olly
4a59c7cf40 Make it easier to use ExoPlayer modules in other projects II
With this change, it becomes possible to depend on ExoPlayer
locally in settings.gradle by doing:

gradle.ext.exoplayerRoot = 'path/to/exoplayer/root'
apply from: new File(gradle.ext.exoplayerRoot, 'core_settings.gradle')

You can optionally add a prefix onto ExoPlayer's module names
by adding:

gradle.ext.exoplayerModulePrefix = 'prefix'

Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160277967
2017-06-28 22:26:05 +01:00
olly
2a8eb5a2a1 Make it easier to use ExoPlayer modules in other projects
It's currently difficult to use ExoPlayer modules in other gradle
projects because they rely on constants and dependencies defined
in our own top level gradle file. This change moves the constants
into a separate file referenced directly from each module. It also
removes the need for the top level gradle file to declare a
dependency on com.novoda:bintray-release. This is now only needed
if "exoplayerPublishEnabled = true" is specified.

Issue: #2851
Issue: #2974

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160272072
2017-06-28 22:26:05 +01:00
andrewlewis
675756d32d Create MediaPeriods based on an identifier not an index
This will allow MediaSources to provide MediaPeriods that correspond to ad
breaks in a timeline period rather than content for a timeline period, in a
future change.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160267841
2017-06-28 22:26:05 +01:00
andrewlewis
d9ea8f7143 Allow disabling the initial discontinuity on ClippingMediaSource
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159227077
2017-06-22 19:57:23 +01:00
andrewlewis
58280f979e Fix continueLoading in IMA deferred periods
continueLoading may be called during preparation, but this is not
handled correctly in the case where a deferred period doesn't
have a source yet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158696539
2017-06-13 13:10:26 +01:00
andrewlewis
4e006a9616 Move positionUs parameter from createPeriod to prepare
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158494794
2017-06-12 10:25:49 +01:00
andrewlewis
3daa7a084f Shorten the player type
The string is truncated to 20 character in IMA.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157122929
2017-05-31 11:26:55 +01:00
ojw28
60ebe15c4b Update README.md 2017-05-17 13:55:24 -07:00
ojw28
6fdfdce19c Update README.md 2017-05-17 13:53:29 -07:00
ojw28
d496621e4b Update README.md 2017-05-17 13:52:19 -07:00
ojw28
27698496fe Update README.md 2017-05-17 13:51:36 -07:00
ojw28
a6c088050a Update IMA readme 2017-05-17 13:46:20 -07:00
ojw28
16445356dc Fix broken link 2017-05-17 13:37:09 -07:00
andrewlewis
cdac347f8f Open source IMA extension
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=156312761
2017-05-17 21:24:44 +01:00