72 Commits

Author SHA1 Message Date
kimvde
01613a2e55 Remove usages of deprecated SimpleExoPlayer.Builder
PiperOrigin-RevId: 390130681
2021-08-11 17:34:19 +01:00
olly
7e8ba03147 Deprecate final non-nested Factory classes in upstream
PiperOrigin-RevId: 389661768
2021-08-09 20:07:24 +01:00
andrewlewis
9c27cfcda7 Fix parameter names on overridden methods
The dokka javadoc generation tool complains when parameter names don't match between a method and its override. This change updates occurrences where there is currently a mismatch.

Notable renamings that might be controversial:
- `onPlaybackStateChanged(int state)` to `onPlaybackStateChanged(int playbackState)` affected a lot of lines but seems more consistent with other '-Changed' methods.
- `handleMessage(int messageType, Object payload)` to `handleMessage(int messageType, Object message)`
- `ExtractorInput` and `DataSource` inherit `DataReader` which had `read(byte[] target, ...`, while data sources normally called the first parameter `buffer`. I have standardized these all to use `buffer` even though it looks out of place in the `ExtractorInput` interface (which has more `read` methods with `target`).

PiperOrigin-RevId: 387290360
2021-07-28 09:15:29 +01:00
kimvde
90113ce013 Deprecate ControlDispatcher in media2
PiperOrigin-RevId: 386185285
2021-07-22 12:05:09 +01:00
kimvde
ae31ebb143 Rename previous/next to seekToPrevious/NextWindow in Player
Also rename hasPrevious/Next to hasPrevious/NextWindow for consistency.

This makes it clearer what the difference between
seekToPrevious/NextWindow and seekToPrevious/Next is.

PiperOrigin-RevId: 384643373
2021-07-14 12:17:15 +01:00
olly
7aaba1ffe5 Migrate usage of Player.EventListener to Player.Listener
PiperOrigin-RevId: 381837274
2021-06-30 13:43:51 +01:00
Charlotte Van Petegem
efc6992e17
Remove useless assertions 2021-06-28 12:06:28 +02:00
Charlotte Van Petegem
13fb0baf0e
Use better builtin ControlDispatcher methods in media2 extension 2021-06-26 12:31:25 +02:00
aquilescanta
fc1d3dd192 Make onPlayerError take a PlaybackException
PiperOrigin-RevId: 380174672
2021-06-21 22:15:01 +01:00
olly
a3dbd61239 Remove obsolete Checker Framework suppression strings
More information: go/checker-3130-lsc

Tested:
    Some test failures are present, but the CL author has decided to mail the change anyway
PiperOrigin-RevId: 379622938
2021-06-21 21:56:37 +01:00
olly
628ebeeb2b Update @SuppressWarnings annotations for go/nullness diagnostics
in preparation for upgrading the version of the Checker Framework in google3.

More information: go/checker-3110-lsc

PiperOrigin-RevId: 378184078
2021-06-09 00:09:16 +01:00
samrobinson
2914e574e6 Rename MediaMetadata trackTitle and trackArtist to title and artist.
#minor-release

PiperOrigin-RevId: 372537414
2021-05-07 14:58:03 +01:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00
bachinger
688fd73d39 Remove AutoClosable implementation of PlayerCommandQueue
PiperOrigin-RevId: 370875532
2021-04-28 12:53:31 +01:00
krocard
4fc4ddbc6a Move AudioComponent to ExoPlayer leaving key methods in Player
PiperOrigin-RevId: 368413660
2021-04-15 10:51:05 +01:00
bachinger
cc26a92e07 Use MediaItem.DEFAULT_MEDIA_ID as default media ID
PiperOrigin-RevId: 368204261
2021-04-13 14:59:40 +01:00
bachinger
dc4148d576 Add positions and new reasons to onPositionDiscontinuity
PiperOrigin-RevId: 364861539
2021-03-24 19:56:25 +00:00
gyumin
01cb6ee3a3 Replace ObjectsCompat.equals to Util.areEquals
It's for consistency throughout libraries.

PiperOrigin-RevId: 360549525
2021-03-12 10:37:30 +00:00
gyumin
ff269403bf Lower minSdkVersion to 16 for media2 extension
From media2 1.1.0, it supports API level 16 and above.

PiperOrigin-RevId: 358797986
2021-02-23 12:29:27 +00:00
olly
94a4b905c9 Make additional modules depend only on common
ControlDispatcher and DefaultControlDispatcher also need
to move to common for the UI module. As does PlaybackPreparer,
although that will be removed entirely in a future release.

PiperOrigin-RevId: 356467394
2021-02-09 13:59:41 +00:00
olly
2a22b347c4 Suppress SwitchIntDef warning where it makes sense
In both cases it's deliberate that all excluded constants should use
the default branch. Furthermore, there are quite a lot of excluded
constants missing, so it's probably better to suppress the warning
than to include them all.

#minor-release

PiperOrigin-RevId: 355426749
2021-02-04 00:24:04 +00:00
jaewan
77a559640b Remove workaround for media1 session's looper restriction
PiperOrigin-RevId: 351936232
2021-01-15 10:57:57 +00:00
Oliver Woodman
b8b9a6411d Merge pull request #8412 from h6ah4i:media2-move-playlist-item
PiperOrigin-RevId: 351305387
2021-01-12 08:46:25 +00:00
Haruki Hasegawa
d522dbaf44
Add SessionPlayer#movePlaylistItem(int, int) support 2020-12-30 17:22:39 +09:00
olly
cc6638d12e Disable flaky media2 test
PiperOrigin-RevId: 348784475
2020-12-23 22:53:33 +00:00
olly
d01093d711 Rollback of dd7b379dc0
*** Original commit ***

DataSource.open() throws if already opened.

Update DataSource implementations to throw an error if open() is called
when the DataSource is already open.

***

PiperOrigin-RevId: 348783425
2020-12-23 22:53:24 +00:00
christosts
dd7b379dc0 DataSource.open() throws if already opened.
Update DataSource implementations to throw an error if open() is called
when the DataSource is already open.

PiperOrigin-RevId: 348609860
2020-12-23 22:52:21 +00:00
sungsoo
4907cf877a Make media2 extension depend on androidx media2 1.1.0
Issue: #8011
#minor-release
PiperOrigin-RevId: 347288689
2020-12-14 10:19:03 +00:00
andrewlewis
809b8a0679 Removed unneeded activity from media2 extension tests
These tests appear not to need an activity, and removing it means we don't need
to switch away from the deprecated `ActivityTestRule`.

#exofixit

PiperOrigin-RevId: 344037927
2020-11-24 16:03:21 +00:00
andrewlewis
1b1a1a6414 Mark pending TODOs for media2 1.1.0 consistently
#exofixit

PiperOrigin-RevId: 344031062
2020-11-24 16:03:12 +00:00
olly
2ddb5b8d94 Update nullness issue in SilkCastApiImpl.java,SessionCallback.java
Null check warning was reported by //java/com/google/android/apps/gsa/staticplugins/silk/silkcast:silkcast_nullness_checker

//third_party/java_src/android_libs/exoplayer/v2/extensions/media2/src/main:library_nullness_test

PiperOrigin-RevId: 343939763
2020-11-24 16:02:55 +00:00
tonihei
d4e1904604 Rollback of 483a350e84
*** Original commit ***

Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.

LSC: go/checker-lsc

Tested:
    TAP train for global presubmit queue
    http://test/OCL:342788973:BASE:342817196:1605636478036:6c558c0c

***

PiperOrigin-RevId: 343895651
2020-11-24 16:02:45 +00:00
sungsoo
2f1c0a5d0d Allow to remove all playlist items
PiperOrigin-RevId: 343437513
2020-11-20 11:11:08 +00:00
sungsoo
d67b70340e Refactor ComponentListener of PlayerWrapper
PiperOrigin-RevId: 343432873
2020-11-20 11:10:58 +00:00
olly
483a350e84 Suppress warnings in preparation for Checker Framework 3.7.1 upgrade.
PiperOrigin-RevId: 342999390
2020-11-18 18:40:06 +00:00
ibaker
2371b024dd Switch to an 'api' dependency on Guava
The 'implementation' dependency causes problems when resolving
ListenableFuture in contexts that also include the
com.google.guava:listenablefuture:1.0 dependency.

Issue: #7905
Issue: #7997
Issue: #7993
PiperOrigin-RevId: 337093024
2020-10-17 01:34:15 +01:00
andrewlewis
ac782235ca Fix miscellaneous nits/typos
PiperOrigin-RevId: 335642909
2020-10-06 16:57:31 +00:00
olly
bff7ac0dbe Clean up some lint warnings
PiperOrigin-RevId: 331162350
2020-09-11 17:31:03 +01:00
olly
cdcb30ed21 Exclude Guava transitive annotation dependencies
PiperOrigin-RevId: 331148067
2020-09-11 16:01:15 +01:00
olly
b2b08ade99 Make User-Agent optional
PiperOrigin-RevId: 330593247
2020-09-09 09:41:51 +01:00
olly
04f67e4adc Simplify DefaultMediaSourceFactory ad configuration
- Use a setter, which is consistent with how other optional
  components are passed.
- Remove nesting where a provider provides another provider.
  Since AdSupportProvider then only provides one thing, it
  can be renamed to AdsLoaderProvider, which more clearly
  expresses what it provides.

PiperOrigin-RevId: 330396334
2020-09-07 20:43:41 +01:00
olly
b79e2e069f SessionPlayerConnector: Use setter for ControlDispatcher
This brings SessionPlayerConnector in line with other
components that use a ControlDispatcher in the ExoPlayer
library, all of which have a setter.

PiperOrigin-RevId: 329665767
2020-09-07 20:41:00 +01:00
gyumin
d155416c54 Add Util.postOrRun
To avoid repetition, it adds Util.postOrRun and replaces existing
instances with the util method.

PiperOrigin-RevId: 329472769
2020-09-07 20:40:04 +01:00
andrewlewis
74c493f51e Add back support for setting audio pitch
To play slow motion streams where the audio has been recorded at
slower speeds, it is necessary to be able to resample (rather than
time-stretch) the audio. This change undeprecates back the previously
deprecated PlaybackParameters class to allow apps to set pitch.

PiperOrigin-RevId: 328703116
2020-08-27 12:06:41 +01:00
jaewan
25c26cdbb4 Return state masked Player values from SessionPlayerConnector
Before this CL, SessionPlayerConnector getters had returned
UNKNOWN_TIME in idle state. It was because
SessionPlayerConnector had followed AndroidX media2
MediaPlayer's behavior, which was the baseline code of the
SessionPlayerConnector.

With this CL, SessionPlayerConnector getters directly return
underlying Player's value, rather than considering calls
in IDLE state as an exception and fallbacks to the default
UNKNOWN_TIME.

PiperOrigin-RevId: 327420940
2020-08-21 12:50:56 +01:00
jaewan
e965ed92f8 Rename DefaultMediaItemProvider to MediaIdMediaItemProvider
PiperOrigin-RevId: 327307736
2020-08-21 12:50:29 +01:00
olly
8c5af10ab0 Don't pass INDEX_UNSET to ExoPlayer seek methods
It's not valid, and will cause IllegalSeekPositionException to be thrown

PiperOrigin-RevId: 327301325
2020-08-21 12:50:20 +01:00
olly
ee743870d8 Media2 extension: Make DefaultMediaItemConverter more useful
- Remove throwing of IllegalStateException
- Make it non-final so additional metadata can be more easily filled in

PiperOrigin-RevId: 327292208
2020-08-21 12:50:11 +01:00
jaewan
bddb29c431 Ban FileMediaItem and CallbackMediaItem
PiperOrigin-RevId: 327268964
2020-08-21 12:50:01 +01:00
jaewan
2299c4e609 Update SessionPlayerConnector documentation
ExoPlayer is now the trusted source of playlist and can be
used by other components without breaking
SessionPlayerConnector's cached playlist.

PiperOrigin-RevId: 327266929
2020-08-21 12:49:52 +01:00