114 Commits

Author SHA1 Message Date
bachinger
68398b708e remove pitch field from PlaybackParameters
PiperOrigin-RevId: 294936851
2020-02-17 17:12:19 +00:00
bachinger
016bacd178 remove deprecated usage of onPlayerStateChanged
PiperOrigin-RevId: 294181886
2020-02-11 17:10:56 +00:00
bachinger
c02933ac0a rename getPlaybackError
PiperOrigin-RevId: 294074348
2020-02-11 17:10:41 +00:00
bachinger
e1c48515eb add next, previous, fastForward and rewind to ControlDispatcher
Issue: #6926, #6934
PiperOrigin-RevId: 293315532
2020-02-11 17:07:52 +00:00
bachinger
2adec8d984 annotate nullabilty of CommandReceiver
Issue: #6938
PiperOrigin-RevId: 292415853
2020-01-31 17:52:08 +00:00
ibaker
4c4cabdfac (partial) Rollback of 880b879e8c
*** Original commit ***

Suppress warnings emitted by Checker Framework version 2.11.1

More information:
https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

Tested:
    TAP train for global presubmit queue
    http://test/OCL:278152710:BASE:278144052:1572760370662:22459c12

***

PiperOrigin-RevId: 284738438
2019-12-10 12:37:26 +00:00
bachinger
6c10c94f94 MediaSessionConnector: Support ACTION_SET_CAPTIONING_ENABLED
PiperOrigin-RevId: 283546707
2019-12-04 10:00:04 +00:00
bachinger
734b4ad9c8 document media button handling prior to API level 21
ISSUE: #6545
PiperOrigin-RevId: 281032120
2019-11-18 17:54:07 +00:00
olly
46d58b5eda Add missing IntDef case in switch
PiperOrigin-RevId: 278332276
2019-11-05 16:17:54 +00:00
olly
880b879e8c Suppress warnings emitted by Checker Framework version 2.11.1
More information:
https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

Tested:
    TAP train for global presubmit queue
    http://test/OCL:278152710:BASE:278144052:1572760370662:22459c12
PiperOrigin-RevId: 278241536
2019-11-05 16:17:39 +00:00
olly
c5c50078d7 Reset MediaSession shuffle/repeat modes if player is null
- This is for consistency with PlayerControlView.

- Also update PlayerNotificationManager notification if shuffle
  mode changes. This is for consistency with what happens when
  the repeat mode changes. By default the notification will be
  unchanged, but custom implementations can extend and then
  override createNotification, and given these modes change
  infrequently it feels like we can just do this. The alternative
  for achieving consistency would be to remove handling of repeat
  mode changes.

Issue: #6582
PiperOrigin-RevId: 277925094
2019-11-05 16:16:45 +00:00
aquilescanta
0f312561e5 Add shuffle and repeat modes to media session playback state invalidation
Which ensures both get updated when the MediaSessionConnector player
changes.

Issue:#6582
PiperOrigin-RevId: 277254889
2019-10-30 08:51:35 +00:00
ibaker
7277df3547 Remove @NonNull where it's implied by @NonNullApi
Also remove it from all tests, these aren't covered by the null-checker

Covered by the following package-info.java files:
- j/c/g/a/exoplayer2/ext/mediasession/package-info.java
- j/c/g/a/exoplayer2/package-info.java
- j/c/g/a/exoplayer2/offline/package-info.java
- j/c/g/a/exoplayer2/video/package-info.java
- j/c/g/a/exoplayer2/ui/package-info.java

PiperOrigin-RevId: 277038916
2019-10-30 08:50:42 +00:00
olly
efe6e6408a Cleanup: Only clamp seek positions for FFWD/RWND
It's confusing that seekTo(player, windowIndex, positionMs) does
clamping, because it only makes sense if windowIndex is the current
window.

Note: This doesn't actually fix anything (other than code clarity).
In cases where we were passing other windowIndices, we always
passed 0 as the position and so the clamping logic wouldn't have
had any effect.
PiperOrigin-RevId: 272857104
2019-10-04 13:33:09 +01:00
olly
7fff1dfd9c Remove stray line of code (it's duplicated below)
PiperOrigin-RevId: 270289374
2019-09-20 17:49:03 +01:00
tonihei
c5ceefd609 Fix playback speed in MediaSessionConnector
The playback speed set in MediaSession's PlaybackStateCompat needs to be the
actual speed at which the playback position progresses and not the user-defined
target speed.

This fixed a bug where the position advances although the player lost audio
focus.

Issue:#6203
PiperOrigin-RevId: 269295249
2019-09-16 23:31:41 +01:00
bachinger
f08258e48d disable seekbar in media style notification for live stream
ISSUE: #6416
PiperOrigin-RevId: 268673895
2019-09-13 13:51:04 +01:00
olly
0dc997103b Use constant to define androidx media version
PiperOrigin-RevId: 266802551
2019-09-05 10:45:24 +01:00
olly
a02237de20 Fix imports
PiperOrigin-RevId: 266676413
2019-09-01 22:03:52 +01:00
tonihei
b0330edc0b Fix some Android Studio nullness warning created by new @NonNullApi.
PiperOrigin-RevId: 261888086
2019-08-06 15:53:52 +01:00
tonihei
6f2e24915d Add @NonNullApi and annotate two packages with it.
This new annotation declares everything as non-null by default and can be
used as a package annotation in package-info.java.

In this change the core lib offline package and the mediasession extension is
annotated that way as initial example usage.

PiperOrigin-RevId: 260894548
2019-08-01 20:35:06 +01:00
bachinger
49a2e5a5cb add manifest to Timeline.Window
- Remove manifest argument from callbacks of Player.EventListener and
  SourceInfoRefreshListener. Instead make it accessible through
  Player.getCurrentManifest() and Timeline.Window.manifest.
- Fix all MediaSource implementation to include the manifest in the
  Timeline instead of passing it to the SourceInfoRefreshListener.
- Refactor ExoPlayerTestRunner, FakeTimeline, FakeMediaSource to
  reflect these changes and make tests pass.

PiperOrigin-RevId: 257359662
2019-07-14 16:20:45 +01:00
bachinger
259bea1652 MediaSessionConnector: Document how to provide metadata asynchronously
Issue: #6047
PiperOrigin-RevId: 255992898
2019-07-02 17:48:41 +01:00
bachinger
ae0aeb046b call setPlayWhenReady in any case
ISSUE: #6093
PiperOrigin-RevId: 255471282
2019-07-02 17:47:07 +01:00
olly
f74d2294be Remove media-session extension nullness blacklist
PiperOrigin-RevId: 249431620
2019-05-23 13:29:19 +01:00
bachinger
128ded5ba0 add playWhenReady to prepareXyz methods of PlaybackPreparer.
Issue: #5891
PiperOrigin-RevId: 248541827
2019-05-20 15:13:17 +01:00
bachinger
59b2dd2701 don't call stop before preparing the player
Issue: #5891
PiperOrigin-RevId: 248369509
2019-05-15 20:14:18 +01:00
tonihei
c480818249 Fix some random AndroidStudio warnings.
PiperOrigin-RevId: 245956915
2019-04-30 22:08:07 +01:00
tonihei
0bb32a8f09 Add IntDef for Player states.
PiperOrigin-RevId: 245925254
2019-04-30 22:07:47 +01:00
bachinger
44ad47746a Never set null as a session meta data object.
Issue: #5810
PiperOrigin-RevId: 245745646
2019-04-30 22:06:30 +01:00
andrewlewis
b01075f325 Play out remaining data on reconfiguration
Before this change we'd release the audio track and create a new one as soon
as audio processors had drained when reconfiguring.

Fix this behavior by stop()ing the AudioTrack to play out all written data.

Issue: #2446
PiperOrigin-RevId: 244812402
2019-04-26 18:27:53 +01:00
olly
bab7b9e9a1 Fix lint warnings for 2.10
PiperOrigin-RevId: 244268855
2019-04-18 23:24:49 +01:00
borrelli
0be4bee25f Add "setCustomErrorMessage" override that allows including an extras bundle with a custom error.
PiperOrigin-RevId: 243807109
2019-04-16 16:41:49 +01:00
borrelli
9fc3ea79a1 Add ability to register/unregister custom CommandReceivers.
PiperOrigin-RevId: 243799572
2019-04-16 15:28:57 +01:00
tonihei
1ee51518ae Use new exoplayer.dev domain everywhere.
The old domain automatically forwards to the new one. For consistency, change
all doc and code references regardless.

Also adds GitHub CNAME config file which configures our page for the custom
domain.

PiperOrigin-RevId: 243592110
2019-04-16 15:25:27 +01:00
bachinger
e8077fb3f4 honour shuffle order when publishing queue to media session
Issue #5360

PiperOrigin-RevId: 235196177
2019-03-06 16:54:26 +00:00
bachinger
44e23fabe6 let apps intercept/handle media button events by using a MediaButtonEventHandler
Issue #5179

PiperOrigin-RevId: 234571837
2019-02-19 13:23:19 +00:00
olly
0622afe170 Migrate to androidx
Issue: #5489
PiperOrigin-RevId: 234507428

Add missing annotation dependency

Issue: #5489
PiperOrigin-RevId: 234566177
2019-02-19 13:22:54 +00:00
bachinger
f9f55ae4d5 improve documentation on how to update queue when asynchronously loading media item assets
Issue #5494

PiperOrigin-RevId: 234138162
2019-02-18 17:40:48 +00:00
tonihei
edabbd52d0 Update Robolectric and Truth.
PiperOrigin-RevId: 233612344
2019-02-18 15:59:32 +00:00
olly
8401097ead Upgrade gradle plugin and friends
PiperOrigin-RevId: 233390513
2019-02-18 15:57:55 +00:00
olly
d834eeab6f Set MediaSessionConnector components separately
Also support preparation without a player, in line with PlayerView.

PiperOrigin-RevId: 227735260
2019-01-08 07:36:50 +00:00
olly
bbf222854a Remove unused interface method
PiperOrigin-RevId: 225528632
2018-12-14 15:42:45 +00:00
olly
f5af6e8f16 Document need to call MediaSessionCompat.setActive
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221078075
2018-11-14 18:03:15 +00:00
olly
9ca019b8f8 PlaybackNotificationManager should show play button in ENDED state
- This brings it in line with PlayerControlView. The play action is displayed
instead, and pressing it seeks to the default position of the current window.
- Do the same for MediaSessionConnector
- Add support for PlaybackPreparer consistent with PlayerControlView

Issue: #5072

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221076008
2018-11-14 18:01:34 +00:00
olly
afebaed0c5 Make support-media-compat an API dependency
The extension cannot be used without also using support-media-compat
(e.g. to instantiate a MediaSessionCompat). So it may as well be an
API dependency.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221072128
2018-11-14 17:58:18 +00:00
olly
eb6859e436 Align navigation implementation across UI components
This change also paves the way for splitting out functionality into a utility class.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=221070262
2018-11-14 17:56:39 +00:00
olly
063f5704cd Simplify MediaSessionConnector
- Make MediaSessionConnector use a ControlDispatcher and add setControlDispatcher,
  setFastForwardIncrementMs and setRewindIncrementMs methods. This brings it in line
  with our other UI components, including PlayerControlView and
  PlayerNotificationManager.
- Collapsed DefaultPlaybackController into MediaSessionConnector, since I'm not
  sure there's a legitimate alternative implementation (note ControlDispatcher does
  provide some equivalent functionality e.g. to modify calls being made on the
  player).
- Pass the Player and ControlDispatcher to command receivers and custom actions,
  so they don't need their own references.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220822082
2018-11-14 17:53:18 +00:00
olly
8ec757ad2b Some MediaSessionConnector simplifications
- Simplify logic for dispatching to the rating callback
- Simplify CommandReceiver by removing getCommands. Simply calling
  receivers is simpler, and more flexible because it doesn't force
  implementations to define a static set of things that they handle
  up front.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220788423
2018-11-14 17:51:37 +00:00
olly
15dda17905 Make TimelineQueueNavigator shuffle aware
Issue: #5065

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=220468285
2018-11-07 17:57:42 +00:00