611 Commits

Author SHA1 Message Date
ibaker
41ce635a42 Fix docs on MediaItem.Builder#setDrmUuid
The docs on setLicenseUri say it's optional, and it has been since
379cd8a04f
(which should have changed this javadoc too)

#minor-release

PiperOrigin-RevId: 376139158
2021-05-27 16:02:56 +01:00
claincly
4f59394f51 Use factory method to create ParserException.
ParserException's constructor methods are deprecated.

#minor-release

PiperOrigin-RevId: 376127494
2021-05-27 16:01:38 +01:00
aquilescanta
c353151288 Add errorCode to the EventLogger
PiperOrigin-RevId: 376126959
2021-05-27 16:00:32 +01:00
olly
ee2af43a54 Fix file formatting
PiperOrigin-RevId: 375919564
2021-05-27 10:40:54 +01:00
gyumin
beb13f62a7 Add FOLDER_TYPE_NONE to MediaMetadata
PiperOrigin-RevId: 375883879
2021-05-26 11:33:41 +01:00
klhyun
2e5c95e80a Remove obsolte TODO
PiperOrigin-RevId: 375830765
2021-05-26 11:33:04 +01:00
aquilescanta
2e8d4c9110 Extract function for mapping ColorInfo-related constants
PiperOrigin-RevId: 375705247
2021-05-26 11:31:52 +01:00
aquilescanta
4e5e654eff Add convenience method for getting the name of an error code
PiperOrigin-RevId: 375686596
2021-05-26 11:31:12 +01:00
samrobinson
6b7a0d8c11 Add year to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375674759
2021-05-26 11:30:36 +01:00
ibaker
926df59081 Defensively copy potentially mutable text in Cue constructor
Without this the Cue isn't deeply immutable, which can be a bit
surprising.

PiperOrigin-RevId: 375477571
2021-05-26 11:27:59 +01:00
ibaker
2081f4b466 Annotate Cue.Builder getters with @Pure
This reduces the null-checking required in a follow-up change.

PiperOrigin-RevId: 375468504
2021-05-26 11:27:22 +01:00
samrobinson
8d550bf05b Add an extras bundle to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375435339
2021-05-26 11:25:27 +01:00
samrobinson
e793a9031b Add a mediaType field to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375097412
2021-05-21 18:25:49 +01:00
aquilescanta
1c4294175f Add contentIsMalformed and dataType to ParserException
PiperOrigin-RevId: 374874272
2021-05-21 12:02:29 +01:00
klhyun
9e4315f48d Implement MediaController#getCurrentCues
It only covers MediaSession - MediaController
(Does not consider cases that either a legacy session or a legacy controller is involved)

Add PlayerInfo#Builder to clean it up.

PiperOrigin-RevId: 374785779
2021-05-20 15:39:34 +01:00
christosts
65d8ff80db ForwardingPlayer only forwards Player operations
PiperOrigin-RevId: 374621615
2021-05-19 20:24:53 +01:00
krocard
41afb6ac4e Add guarantied invalid command to allow niche optimisations
This allows users to use `int` to store an optional command.

PiperOrigin-RevId: 374600127
2021-05-19 20:24:29 +01:00
aquilescanta
66c1aedeb3 Assign ERROR_CODE_BEHIND_LIVE_WINDOW to BehindLiveWindowExceptions
PiperOrigin-RevId: 374425179
2021-05-19 20:23:38 +01:00
aquilescanta
227795964b Add an IntDef for DATA_TYPE_* constants
PiperOrigin-RevId: 374418502
2021-05-19 20:22:48 +01:00
aquilescanta
6c06b4efd1 Re-order error codes for symmetry
PiperOrigin-RevId: 374416794
2021-05-19 20:22:23 +01:00
aquilescanta
61c92007b7 Bubble up the errorCode argument in preparation for new factory methods
Notes:
- The only functional change is that createForRemote now assings ERROR_CODE_REMOTE_ERROR.
- createForSource still uses ERROR_CODE_UNSPECIFIED, even though it expects an
  IOException. The reason for not using ERROR_CODE_IO_UNSPECIFIED is that the reason for
  the error might not be IO. For example, malformed media, or BehindLiveWindowException,
  which have non-IO error codes. So using UNSPECIFIED saves a later change in category.
PiperOrigin-RevId: 374390407
2021-05-19 20:21:57 +01:00
tonihei
378b3f6eb5 Add Util class for server-side inserted ads.
When working with SSAI ads, we need to easily convert positions between
the underlying stream and the media model that exposes ad groups. To
simplify this, we can add util methods (that are testable on their own).

In addition, we need an easy way to build AdPlaybackStates for SSAI
inserted ads. The metadata is obtained out-of-band and usually has the
ad group start and end times in the underlying stream only. Hence, we
also add a util method to add a new ad group based on this information.

PiperOrigin-RevId: 374369360
2021-05-19 20:21:32 +01:00
samrobinson
25b453a5fe Add track number & total to MediaMetadata
#minor-release

PiperOrigin-RevId: 374235979
2021-05-19 20:20:43 +01:00
tonihei
04d6c8ed19 Fix grammar nit
PiperOrigin-RevId: 374186953
2021-05-17 18:20:14 +01:00
krocard
6a30af567f Add Commands.Builder.addAllCommands for easy init
MediaSession default command state contains all
commands.
To avoid having to update MediaSession when a command
is added, allow to create a Commands.Builder that
starts with all commands.

PiperOrigin-RevId: 374183484
2021-05-17 18:19:53 +01:00
aquilescanta
17209ed1ee Use the term equivalent instead of equal in assertion
The assertion doesn't check equality (as in x.equals(y)), but rather
whether a subset of the fields are equal.

PiperOrigin-RevId: 374183338
2021-05-17 18:19:32 +01:00
olly
2566b24642 Remove deprecated Listener.onTimelineChanged
PiperOrigin-RevId: 374171038
2021-05-17 18:19:13 +01:00
christosts
1dfda7ab6e ForwardingPlayer implements Player
Make ForwardingPlayer implement Player and not extend BasePlayer so that
ForwardingPlayer forwards each Player method directly to the wrapped
Player instance.

PiperOrigin-RevId: 374161084
2021-05-17 18:18:14 +01:00
tonihei
795210d7bc Update player logic to handle server-side inserted ads.
There are two main changes that need to be made:
 1. Whenever we determine the next ad to play, we need to select a
    server-side inserted ad even if it has been played already (because
    it's part of the stream).
 2. When the Timeline is updated in the player, we need to avoid changes
    that would unnecessarily reset the renderers. Whenever a Timeline
    change replaces content with a server-side inserted ad at the same
    position we can just keep the existing MediaPeriod and also if the
    duration of the current MediaPeriod is reduced but it is followed by
    a MediaPeriod in the same SSAI stream, we can don't need to reset
    the renderers as we keep playing the same stream.

PiperOrigin-RevId: 373745031
2021-05-14 11:24:46 +01:00
aquilescanta
a8675673da Add backward compatibility tests for PlaybackException
PiperOrigin-RevId: 373542819
2021-05-13 10:52:59 +01:00
tonihei
954a6730d5 Allow ad groups to be marked as server-side inserted.
This helps both player the logic and clients like UI or analytics to
detect SSAI ads.

PiperOrigin-RevId: 373540754
2021-05-13 10:52:37 +01:00
klhyun
bec7b0041e Make Cue implement Bundleable
In order to deliver Cue objects between different processes
(e.g. in Player#getCurrentCues), this CL makes it Bundleable.

PiperOrigin-RevId: 373524501
2021-05-13 10:52:12 +01:00
samrobinson
46c5f030ce Add an artwork field to MediaMetadata
#minor-release

PiperOrigin-RevId: 373410795
2021-05-13 10:51:02 +01:00
tonihei
ef5a0b6c4d Allow ad groups to specify a resume offset.
Content after ad groups currently always resumes at the ad break position (unless
overridden by a seek or similar).  In some cases, media inserting ads wants to
specify an offset after the ad group at which playback should resume. A common
example is a live stream that inserts an ad and then wants to continue streaming
at the current live edge.

Support this use case by allowing ad groups to specify a content resume offset
and making sure that the content start position after the ad group uses this offset.

PiperOrigin-RevId: 373393807
2021-05-12 18:57:45 +01:00
jaewan
43da862780 Add copy constructor and remove APIs for Commands builder
It helps to change allowed commands from session.

PiperOrigin-RevId: 373302990
2021-05-12 11:52:49 +01:00
jaewan
b2b6e0ecb5 Implements Player.Events#equals()
It's convenient for testing.

PiperOrigin-RevId: 373280130
2021-05-12 11:52:25 +01:00
aquilescanta
ad46b90918 Use Truth convenience methods for Exception-related assertions
PiperOrigin-RevId: 373180764
2021-05-12 11:51:40 +01:00
aquilescanta
094f4a8436 Add notice about backwards compatibility in PlaybackException
PiperOrigin-RevId: 373172693
2021-05-11 17:47:26 +01:00
aquilescanta
d54168ae30 Make ExoPlaybackException extend PlaybackException
PiperOrigin-RevId: 373170792
2021-05-11 17:39:52 +01:00
olly
0c19506d7d Remove deprecated Format.create methods
PiperOrigin-RevId: 373144415
2021-05-11 16:02:08 +01:00
kim-vde
eb93e5c0b5 Merge pull request #8860 from KeiMurayamaS:dev-v2-add-mpegh-parser
PiperOrigin-RevId: 373142159
2021-05-11 16:01:46 +01:00
tonihei
08fb7bd65f Support changing ad break positions.
The player already supports changing durations of periods and ads.
The only thing not yet supported is a change in ad break positions
which changes the duration of clipped content ending in an ad break.

Adding support for this requires updating the end position in
MediaPeriodInfo and changing the clip end position of the respective
ClippingMediaPeriod.

Issue: #5067
PiperOrigin-RevId: 373139724
2021-05-11 16:01:25 +01:00
olly
b95fba2cb7 Remove deprecated Timeline.getWindow method
PiperOrigin-RevId: 373126944
2021-05-11 16:00:40 +01:00
aquilescanta
508c6652ba Add test for PlaybackException
PiperOrigin-RevId: 373026239
2021-05-10 23:42:51 +01:00
olly
89cfa4df32 Remove some deprecated Player methods
PiperOrigin-RevId: 372981744
2021-05-10 23:42:10 +01:00
aquilescanta
763ef2b911 Avoid type-ambiguous overloads in ExoPlaybackExceptionTest
PiperOrigin-RevId: 372942778
2021-05-10 23:41:09 +01:00
tonihei
8a5d21adef Remove reference to deprecated Player.EventListener.
#minor-release

PiperOrigin-RevId: 372925409
2021-05-10 23:40:26 +01:00
olly
3c64bc1b49 Fix Javadoc references to deprecated EventListener
#minor-release

PiperOrigin-RevId: 372919342
2021-05-10 23:40:05 +01:00
olly
e908750336 Bump version to 2.14.0 and tidy release notes
#minor-release

PiperOrigin-RevId: 372910834
2021-05-10 23:39:25 +01:00
Kei Murayama
f05197c4d5 Support parsing MPEG-H 3D Audio
First intention to support parsing MPEG-H 3D Audio in ExoPlayer is to
take advantage of parsing capability from MediaParser API in AOSP.
Just with this change ExoPlayer does't support decoding MPEG-H 3D Audio
but can support decoding either by adding decoder with an extension or
by using Android OS which has decoder capability with MediaCodec API.
2021-05-10 17:55:03 +09:00