333 Commits

Author SHA1 Message Date
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
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
Oliver Woodman
78e0545774 Re-add RTMP extension classes 2017-07-10 12:16:20 +01:00
tonihei
68827878e9 Fix RTMP library gradle file.
(GitHub issue #3038)

Module prefix was missing for library-core module.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161366375
2017-07-10 12:09:56 +01:00
olly
a0aa9a3803 Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160955809
2017-07-10 12:06:23 +01:00
Oliver Woodman
7524228160 Clean up rtmp extension 2017-07-05 15:08:00 +01:00
ojw28
0ecbe5dc04 Merge branch 'dev-v2' into rtmp_client 2017-07-05 15:04:49 +01:00
tonihei
05a77eef5d Move Extractor test assertion methods to ExtractorAsserts class.
This cleans up test the TestUtil class that in large parts consisted of
assertions for Extractor tests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160829066
2017-07-05 15:02: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
olly
ba0e5246d6 Properly handle replacement of the DRM session in LibvpxVideoRenderer
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160537100
2017-06-30 16:43:09 +01:00
olly
db177db6d9 DrmSession cleanup
These changes are in part related to handling playback of mixed clear
and encrypted content, where we might want to use a secure decoder
throughout, but only have drm init data and only care about the state
of the DrmSession during playback of encrypted parts.

- requiresSecureDecoderComponent became unnecessary when we added
  ExoMediaCrypto, which provides a layer in which requiresSecureDecoderComponent
  can be overridden.
- Relaxed requirements for obtaining the MediaCrypto. It's helpful
  to allow retrieval in the error state, since it can be used to
  instantiate a decoder and play clear samples.
- Deferred throwing of errors in renderer implementations. As long as
  we can get a MediaCrypto, we should init the codec. We can also
  play clear samples without failing if playClearSamplesWithoutKeys is
  true, regardless of the errors state.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160536365
2017-06-30 16:42:01 +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
eguven
a7ed199622 Fix FLAC extension native part compilation
In the latest NDK version (r15) compilation fails because 'memset' isn't defined. Included cstring header.

Issue: #2977

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160139022
2017-06-26 17:07:56 +01:00
Oliver Woodman
b0a873df25 Clean up okhttp datasource. 2017-06-25 15:16:11 +01:00
Alex Birkett
0572d190fe Make OkHttpDataSource userAgent parameter optional 2017-06-23 18:56:40 +02:00
olly
86f06faa8d Move clearing of joining deadline back to onStopped
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=159421000
2017-06-22 20:01:03 +01:00