13302 Commits

Author SHA1 Message Date
Ian Baker
72a4fb082d
Merge pull request #52 from androidx/release-1.0
r1.0.0-alpha03
1.0.0-alpha03
2022-03-15 15:37:28 +00:00
ibaker
583249345a Version bump to exoplayer:2.17.1 and media3:1.0.0-alpha03
#minor-release

PiperOrigin-RevId: 433467068
(cherry picked from commit af6f6bb40666d5c27fd4274ad5e3479cf593ce04)
2022-03-09 16:38:20 +00:00
bachinger
dc83fae19d Ignore MetadataRenderer when evaluating SSAI period transitions
This makes the reading period advance early as expected at the end of an ad
period. Before this change the reading position of the metadata renderer
prevented advancing the period until metadata arrived after the start position of
the following period. Only then the reading position of the metadata renderer
is updated and beyond the start position of the following period which is a
condition to advance the reading period.

Because transitioning to the next period is a virtual transition and the
SharedMediaPeriod keeps reading from the same underlying sample streams, the
metadata renderer can safely be ignored for this check.

#minor-release

PiperOrigin-RevId: 432646037
(cherry picked from commit c7c75173224057defd031aa30bbf8346442700a6)
2022-03-08 17:11:59 +00:00
christosts
c56c6a2ea4 Start playback from notification
This change fixes two bugs where MediaSessionServe shows a notification
with the Play icon but tapping it will not start playback:
1. After playback ends: we need to seek to the beginning of the media
   item.
2. After adding media items to the player but not starting playback:
   We need to call Player.prepare() too.

PiperOrigin-RevId: 432469953
(cherry picked from commit 1023b9d55efe8f0470c5f3b75cd84e40860f79be)
2022-03-08 17:11:55 +00:00
christosts
4456a865cc Misc cleanup in session tests
PiperOrigin-RevId: 432430345
(cherry picked from commit 8e98187a1e08167cbef08c94e632c8d84a4667f1)
2022-03-08 16:58:05 +00:00
ibaker
50550ab191 Remove media3 PlayerView javadoc references to overriding layouts
These should have been removed as part of 1391b7c65d, since we no
longer officially support overriding the layout file for this class.

This class is known as StyledPlayerView in exoplayer2.

#minor-release

PiperOrigin-RevId: 432411322
(cherry picked from commit a353b3332abefc798d9751f037e7ef7a78ecbeae)
2022-03-08 16:58:05 +00:00
christosts
25004f8988 Remove CountDownLatch from MockPlayer
The MockPlayer has a single CountDownLatch field and multiple boolean
flags that track if a player method was called. Upon calling the methods
the latch count. Tests set the latch count to match exactly with the
number of expected player interactions then block the test thread until
the latch reaches zero and assert the respective method flags are true.

This is subject to false positives. If the underneath implementation
changes and call more player method, then the test thread will unblock
as soon as a certain number of interactions is performed, which may be
less than what the test expected originally. However, the test may stil
pass if the player thread had enough time to update the expected method
flag.

This change removes the single CountDownLatch and the boolean flags and
instead it adds APIs to query the MockPlayer if a method has been called
and await until a method is called. Internally, the MockPlayer has a
ConditionVariable per method.

PiperOrigin-RevId: 432399077
(cherry picked from commit 45d512160c7c14eda33785a632a1fc3eebc9769d)
2022-03-08 16:58:05 +00:00
andrewlewis
7afaf97489 Fix E-AC3 output capability check without sample rate
#minor-release

PiperOrigin-RevId: 432189509
(cherry picked from commit a73a9e9ca5e1a93518443e3e20953727a4189e9a)
2022-03-08 16:58:05 +00:00
ibaker
d20160d751 Deprecate SingleSampleMediaSource.Factory#setTrackId
This method is no longer needed since we added SubtitleConfiguration#id
in 59d98b9a4e.

Issue: google/ExoPlayer#10016

#minor-release

PiperOrigin-RevId: 432169262
(cherry picked from commit 232f2d815d4bf306bddca033b8b5a1454af8601f)
2022-03-08 16:58:05 +00:00
ibaker
8e386ef21c More 2.17.0 release note fixes
#minor-release

PiperOrigin-RevId: 432154626
(cherry picked from commit 986928a89c7291ce997153e1b9351f2b4fb94f69)
2022-03-08 16:58:05 +00:00
Ian Baker
49e6fa805a Merge pull request #10011 from tonykwok:dev-v2
PiperOrigin-RevId: 431395359
(cherry picked from commit c961ea1ca7c119b309456033021434dd38ad0e84)
2022-03-08 16:58:05 +00:00
bachinger
291c95daa0 Accept page index 0 for getChildren() in MediaLibraryServiceLegacyStub
This is consistent with the new MediaSessionStub that accepts page index 0
and the JavaDoc of legacy and new service callbacks.

Issue: androidx/media#32
PiperOrigin-RevId: 431390454
(cherry picked from commit 9821dd282c05dde945d787b8c1d4259fbc22bfef)
2022-03-08 16:58:05 +00:00
ibaker
405795ca98 Cross-reference the corresponding media3 and exoplayer releases
PiperOrigin-RevId: 431376857
(cherry picked from commit 3e9dfaa5865217420c2ac5dc8f103a7c2d9f152d)
2022-03-08 16:58:05 +00:00
bachinger
6f5206cd76 Drop ads for which we don't have metadata when joining a live stream
When a live stream is joined while ads are already playing, the LOADED event is
missed and we don't have ad information for those ads in the ad group that are
before the ad index at which we joined. This way we can clip the duration when we
receive the LOADED event for the last ad in the group. This fixes the problem of
the playback controls being hidden when content resumes after the ad group.

#minor-release

PiperOrigin-RevId: 431269627
(cherry picked from commit 8e8c59031c328e4c64a16193732078568712a632)
2022-03-08 16:58:05 +00:00
ibaker
bc1bcab553 Remove exoplayer-only release note from media3
There's no media3 equivalent to the
`com.google.android.exoplayer:exoplayer` dependency.

PiperOrigin-RevId: 430955037
(cherry picked from commit 8ae74ad873e18cd8510b9a398a264b3359766347)
2022-03-08 16:58:05 +00:00
ibaker
ca50beee6c Remove duplicate media3 release note and fix formatting
PiperOrigin-RevId: 430946606
(cherry picked from commit 5d0c7b91d042970811b5fcc095c4148542b31cf8)
2022-03-08 16:58:04 +00:00
ibaker
a8fd90ec84 Update media3 docs with details of new release branch
PiperOrigin-RevId: 430911179
(cherry picked from commit 7d389361063059656ee54c7297c99a76683b19bd)
2022-03-08 16:58:04 +00:00
ibaker
16819edebd Remove unecessary git checkout command from README
The command is not needed, because the specified branch is already the
default branch on GitHub so will be checked out by clone automatically.

PiperOrigin-RevId: 430910549
(cherry picked from commit d34221519d907f002abce245a3450ccacf988de8)
2022-03-08 16:58:04 +00:00
olly
d10700456d FMP4: Fix output of mixed v0 and v1 emsg samples
Issue: google/ExoPlayer#9996
#minor-release
PiperOrigin-RevId: 430773329
(cherry picked from commit 5a304fdbd9bc8af8229b1a9cddc79f359fe8e215)
2022-03-08 16:58:04 +00:00
ibaker
7125a3361b Update the gradle wrapper scripts
Generated by running:
./gradlew wrapper --gradle-version 7.4 --distribution-type all

#minor-release

PiperOrigin-RevId: 430666317
(cherry picked from commit 92af42bf2588e9f9a102b8f6812e140e077f2d6a)
2022-03-08 16:58:04 +00:00
ibaker
c5b046900d Update gradle wrapper to 7.4
#minor-release

PiperOrigin-RevId: 430454251
(cherry picked from commit e8096f07b9a458310589685b6019d5d79cbde433)
2022-03-08 16:58:04 +00:00
ibaker
850bd69ddd Version bump to exoplayer:2.17.0 and media3:1.0.0-alpha02
#minor-release

PiperOrigin-RevId: 430456963
1.0.0-alpha02
2022-02-23 16:46:17 +00:00
ibaker
3ac831be3a Suppress @VisibleForTesting violation in Transformer
#minor-release

PiperOrigin-RevId: 430200331
2022-02-23 09:56:26 +00:00
andrewlewis
c0d0c0a834 Suppress framework muxer lint warning
We need to access internal state to work around resources not being released on
old API versions. Add a reference to the bug about this and suppress the lint
warning.

#minor-release

PiperOrigin-RevId: 430190794
2022-02-23 09:56:09 +00:00
ibaker
00a5b33d24 Fix DefaultAnalyticsCollectorTest failure when run with JaCoCo
#minor-release

PiperOrigin-RevId: 430189385
2022-02-23 09:56:03 +00:00
ibaker
760fe78fbd Redefine VERSION_INT to include alpha/beta/rc/stable
#minor-release

PiperOrigin-RevId: 429596966
2022-02-22 11:25:51 +00:00
aquilescanta
9bc717da31 Depend on llvm-xy bin utils instead of GNU's binutils
NDK 23 removes GNU's bin utils. More info in
https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#binutils.

LLVM bin utils are available in all modern NDK versions.

#minor-release
Issue: google/ExoPlayer#9933
PiperOrigin-RevId: 429299806
2022-02-22 11:25:51 +00:00
olly
cbcf7cd69a Make sure native library loads use correct class loader
Merge of https://github.com/google/ExoPlayer/pull/9934

PiperOrigin-RevId: 429259055
2022-02-22 11:25:44 +00:00
bachinger
bb7ee69870 Use service context in DefaultActionFactory
We need to use a Service to create the pending intents in the
`DefaultActionFactory`.

PiperOrigin-RevId: 429115746
2022-02-22 10:25:07 +00:00
bachinger
00f93ac035 Clear ad playback state map when AdsLoader is released
#minor-release

PiperOrigin-RevId: 429067634
2022-02-22 10:21:40 +00:00
bachinger
49bb768323 Integrate IMA SSAI samples in main demo app
PiperOrigin-RevId: 429059793
2022-02-22 10:21:40 +00:00
bachinger
899d458c7b Make AdsLoader.State implement Bundleable
This allows the AdsLoader.State to be stored in savedInstanceState

#minor-release

PiperOrigin-RevId: 429057697
2022-02-22 10:21:40 +00:00
bachinger
ccfb126b8a Copy playback configuration when creating the content media item
#minor-release

PiperOrigin-RevId: 429006934
2022-02-22 10:21:40 +00:00
kimvde
5ed7523158 Handle player release timing out in transformer
- The resources were released twice before, which is not necessary since
  the MSG_RELEASE message is already in the internal player queue.
- The demo app was failing because the stop watch was stopped in
  onTransformationError after being reset.

#minor-release
#mse-bug-week

PiperOrigin-RevId: 428794426
2022-02-22 10:21:40 +00:00
bachinger
b9b1be4f3e Store ad playback state in AdsLoader for resume after backgrounding
#minor-release

PiperOrigin-RevId: 428763656
2022-02-22 10:21:40 +00:00
hschlueter
33afc4760b Track presentation timestamps in FrameEditor.
PiperOrigin-RevId: 428763554
2022-02-22 10:21:37 +00:00
bachinger
238d9ca57b Disable IMA SSAI DASH live streams for now
#minor-release

PiperOrigin-RevId: 428761508
2022-02-21 17:11:39 +00:00
bachinger
b5d5f492e7 Prevent adding multiple IMA SSAI media source instances to the playlist
Currently only a single instance of ImaServerSideAdInsertionMediaSource is
supported at the same time in a playlist. This change makes sure that an
attempt to add multiple instances is prevented by throwing a an exception.

#minor-release

PiperOrigin-RevId: 428743140
2022-02-21 17:11:38 +00:00
bachinger
fe55d982f1 Skip played server side inserted ads in a single period window
This change makes sure played server side ads are skipped in a single period
timeline. It avoids creating an ad-MediaPeriodInfo for played postrolls and
creates a content info instead. It also sets the end position for content infos
that terminate the stream before the stream is actually finished. This prevents
the player from continue playing the remaining media delivered by the
MediaPeriod.

We also make sure that the discontinuity of played ads are not reported because
there is actually no discontinuity.

#minor-release

PiperOrigin-RevId: 428734387
2022-02-21 17:11:38 +00:00
bachinger
16261967c0 Do not manipulate the duration of SSAI periods in FakeTimeline
#minor-release

PiperOrigin-RevId: 428727560
2022-02-21 17:11:38 +00:00
bachinger
24cd34dd0d Reset stream manager in AdsLoader.release()
This prevents a stack trace that is shown in the logs when the stream manager is
released after the activity was stopped. In this case the call to
`streamManager.destroy()` coming from `releaseSourceInternal()` of the media
source is too late and produces an error saying `Application attempted to call on
a destroyed WebView`. The error has no effect but it's nice to not have this
stack trace in the logs.

PiperOrigin-RevId: 428574231
2022-02-21 17:11:38 +00:00
bachinger
6df893a7cd Make AdsLoader.addMediaSourceResources package private.
#minor-release

PiperOrigin-RevId: 428565444
2022-02-21 17:11:38 +00:00
andrewlewis
d9253c6f51 Fix debug frame showing through player on old devices
PiperOrigin-RevId: 428524300
2022-02-21 17:11:38 +00:00
bachinger
29c0054a0a Seek to start position when reusing the last used shared period
The last used shared media period is reused after all media periods have been
released. In case the sample streams are already filled up, they need to be
reset or they download samples from the current position up to the seek
position. This causes long buffering states or load stuck exceptions.

A seek when reusing the shared period takes care for reseting the period or
internally seeks to the current position in the already available samples.

#minor-release

PiperOrigin-RevId: 428484187
2022-02-21 17:11:38 +00:00
tonihei
418726d04b Make usage of live minDurationForQualityIncrease more consistent
We have two ways to choose the minDurationForQualityIncreaseMs value in
AdaptiveTrackSelection: use the configured value for non-live or when
enough buffered data is available, or use a fraction of the available
duration to allow switching when playing close to the live edge.

The decision point when to use which value isn't quite consistent because
we compare against availableDurationUs before making the adjustments. This
means there is range of values where no up-switching is possible despite
perfect buffering. Fix this by choosing the minimum of both values.

Issue: google/ExoPlayer#9784

#minor-release

PiperOrigin-RevId: 428474332
2022-02-21 17:11:38 +00:00
bachinger
2b817fb6f6 Use content timeline to get ad group index and ad index in ad group
The timeline used to map ad groups to periods needs to report the original content period duration without subtracting the serverside inserted ad duration. When marking played ads in onPositionDiscontinuity, the public timeline has been used which crashed the app when the ads media source is playing on a window index different to zero (in a playlist).

#minor-release

PiperOrigin-RevId: 428465833
2022-02-21 17:11:38 +00:00
andrewlewis
e777bedd40 Improve transformer activity layout
On Samsung S21 with light theme the debug labels weren't showing up because the player view was visible (with a black background) while the transformation was in progress, matching the debug label text color. Hide the player view until the transformation is complete to fix this.

Also tweak the layout slightly to add space between the card border and the labels.

#mse-bug-week

PiperOrigin-RevId: 428455824
2022-02-21 17:11:38 +00:00
krocard
b8c3d97bf9 Do not reference AnalyticsCollector in common constructor
This prevents it to be stripped by R8 if a custom one is
passed.

#minor-release

PiperOrigin-RevId: 428034999
2022-02-21 17:11:38 +00:00
christosts
71f21ccfa6 Create MediaNotification.Provider
Define MediaNotification.Provider so that apps can customize
notification UX. Move MediaNotificationManager's functionality
around notifications on DefaultMediaNotificationProvider

PiperOrigin-RevId: 428024699
2022-02-21 17:11:38 +00:00
bachinger
0367fafa6c Resolve media period ids in multi-period windows
Ignorable ad periods are skipped to resolve the media period id with the
ad playback state of the resulting period. In case of a change in the period
position un-played ad periods are rolled forward to be played.

PiperOrigin-RevId: 428011116
2022-02-21 17:11:38 +00:00