Skip to content

Commit 3c01488

Browse files
authored
Merge pull request #336 from androidx/release-1.0.1-stable
1.0.1
2 parents 2ca9050 + 4f0b30b commit 3c01488

File tree

77 files changed

+1994
-517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1994
-517
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ body:
2020
label: Media3 Version
2121
description: What version of Media3 (or ExoPlayer) are you using?
2222
options:
23+
- Media3 1.0.1
2324
- Media3 1.0.0
2425
- Media3 1.0.0-rc02
2526
- Media3 1.0.0-rc01
@@ -29,6 +30,7 @@ body:
2930
- Media3 1.0.0-alpha03
3031
- Media3 1.0.0-alpha02
3132
- Media3 1.0.0-alpha01
33+
- ExoPlayer 2.18.6
3234
- ExoPlayer 2.18.5
3335
- ExoPlayer 2.18.4
3436
- ExoPlayer 2.18.3

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ In case your question is related to a piece of media:
3636
- Authentication HTTP headers
3737

3838
Don't forget to check ExoPlayer's supported formats and devices, if applicable
39-
(https://exoplayer.dev/supported-formats.html).
39+
(https://developer.android.com/guide/topics/media/exoplayer/supported-formats).
4040

4141
If there's something you don't want to post publicly, please submit the issue,
4242
then email the link/bug report to [email protected] using a subject in the

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@ We will also consider high quality pull requests. These should merge
2323
into the `main` branch. Before a pull request can be accepted you must submit
2424
a Contributor License Agreement, as described below.
2525

26+
### Code style
27+
28+
We follow the
29+
[Google Java Style Guide](https://google.github.io/styleguide/javaguide.html)
30+
and use [`google-java-format`](https://github.com/google/google-java-format) to
31+
automatically reformat the code. Please consider auto-formatting your changes
32+
before opening a PR (we will otherwise do this ourselves before merging). You
33+
can use the various IDE integrations available, or bulk-reformat all the changes
34+
you made on top of `main` using
35+
[`google-java-format-diff.py`](https://github.com/google/google-java-format/blob/master/scripts/google-java-format-diff.py):
36+
37+
```shell
38+
$ git diff -U0 main... | google-java-format-diff.py -p1 -i
39+
```
40+
2641
## Contributor license agreement
2742

2843
Contributions to any Google project must be accompanied by a Contributor

RELEASENOTES.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# Release notes
22

3+
### 1.0.1 (2023-04-18)
4+
5+
This release corresponds to the
6+
[ExoPlayer 2.18.6 release](https://github.com/google/ExoPlayer/releases/tag/r2.18.6).
7+
8+
* Core library:
9+
* Reset target live stream override when seeking to default position
10+
([#11051](https://github.com/google/ExoPlayer/pull/11051)).
11+
* Fix bug where empty sample streams in the media could cause playback to
12+
be stuck.
13+
* Session:
14+
* Fix bug where multiple identical queue items published by a legacy
15+
`MediaSessionCompat` result in an exception in `MediaController`
16+
([#290](https://github.com/androidx/media/issues/290)).
17+
* Add missing forwarding of `MediaSession.broadcastCustomCommand` to the
18+
legacy `MediaControllerCompat.Callback.onSessionEvent`
19+
([#293](https://github.com/androidx/media/issues/293)).
20+
* Fix bug where calling `MediaSession.setPlayer` doesn't update the
21+
available commands.
22+
* Fix issue that `TrackSelectionOverride` instances sent from a
23+
`MediaController` are ignored if they reference a group with
24+
`Format.metadata`
25+
([#296](https://github.com/androidx/media/issues/296)).
26+
* Fix issue where `Player.COMMAND_GET_CURRENT_MEDIA_ITEM` needs to be
27+
available to access metadata via the legacy `MediaSessionCompat`.
28+
* Fix issue where `MediaSession` instances on a background thread cause
29+
crashes when used in `MediaSessionService`
30+
([#318](https://github.com/androidx/media/issues/318)).
31+
* Fix issue where a media button receiver was declared by the library
32+
without the app having intended this
33+
([#314](https://github.com/androidx/media/issues/314)).
34+
* DASH:
35+
* Fix handling of empty segment timelines
36+
([#11014](https://github.com/google/ExoPlayer/issues/11014)).
37+
* RTSP:
38+
* Retry with TCP if RTSP Setup with UDP fails with RTSP Error 461
39+
UnsupportedTransport
40+
([#11069](https://github.com/google/ExoPlayer/issues/11069)).
41+
342
### 1.0.0 (2023-03-22)
443

544
This release corresponds to the

constants.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414
project.ext {
15-
releaseVersion = '1.0.0'
16-
releaseVersionCode = 1_000_000_3_00
15+
releaseVersion = '1.0.1'
16+
releaseVersionCode = 1_000_001_3_00
1717
minSdkVersion = 16
1818
appTargetSdkVersion = 33
1919
// API version before restricting local file access.

demos/gl/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ android {
2727
versionCode project.ext.releaseVersionCode
2828
minSdkVersion project.ext.minSdkVersion
2929
targetSdkVersion project.ext.appTargetSdkVersion
30+
multiDexEnabled true
3031
}
3132

3233
buildTypes {

demos/main/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<string name="unexpected_intent_action">Unexpected intent action: <xliff:g id="action">%1$s</xliff:g></string>
2323

24-
<string name="error_cleartext_not_permitted">Cleartext HTTP traffic not permitted. See https://exoplayer.dev/issues/cleartext-not-permitted</string>
24+
<string name="error_cleartext_not_permitted">Cleartext HTTP traffic not permitted. See https://developer.android.com/guide/topics/media/issues/cleartext-not-permitted</string>
2525

2626
<string name="error_generic">Playback failed</string>
2727

demos/session/src/main/java/androidx/media3/demo/session/MainActivity.kt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import android.view.ViewGroup
2626
import android.widget.ArrayAdapter
2727
import android.widget.ListView
2828
import android.widget.TextView
29+
import androidx.activity.OnBackPressedCallback
2930
import androidx.appcompat.app.AppCompatActivity
3031
import androidx.core.content.ContextCompat
3132
import androidx.media3.common.MediaItem
@@ -73,20 +74,24 @@ class MainActivity : AppCompatActivity() {
7374
val intent = Intent(this, PlayerActivity::class.java)
7475
startActivity(intent)
7576
}
77+
78+
onBackPressedDispatcher.addCallback(
79+
object : OnBackPressedCallback(/* enabled= */ true) {
80+
override fun handleOnBackPressed() {
81+
popPathStack()
82+
}
83+
}
84+
)
7685
}
7786

7887
override fun onOptionsItemSelected(item: MenuItem): Boolean {
7988
if (item.itemId == android.R.id.home) {
80-
onBackPressed()
89+
onBackPressedDispatcher.onBackPressed()
8190
return true
8291
}
8392
return super.onOptionsItemSelected(item)
8493
}
8594

86-
override fun onBackPressed() {
87-
popPathStack()
88-
}
89-
9095
override fun onStart() {
9196
super.onStart()
9297
initializeBrowser()

demos/session/src/main/java/androidx/media3/demo/session/PlayerActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class PlayerActivity : AppCompatActivity() {
135135
updateMediaMetadataUI(controller.mediaMetadata)
136136
updateShuffleSwitchUI(controller.shuffleModeEnabled)
137137
updateRepeatSwitchUI(controller.repeatMode)
138+
playerView.setShowSubtitleButton(controller.currentTracks.isTypeSupported(TRACK_TYPE_TEXT))
138139

139140
controller.addListener(
140141
object : Player.Listener {

demos/transformer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ manual steps.
6161
(this will only appear if the AAR is present), then build and run the demo
6262
app and select a MediaPipe-based effect.
6363
64-
[Transformer]: https://exoplayer.dev/transforming-media.html
64+
[Transformer]: https://developer.android.com/guide/topics/media/transforming-media
6565
[MediaPipe]: https://google.github.io/mediapipe/
6666
[build an AAR]: https://google.github.io/mediapipe/getting_started/android_archive_library.html

demos/transformer/src/main/java/androidx/media3/demo/transformer/MatrixTransformationFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
/* package */ final class MatrixTransformationFactory {
3030
/**
31-
* Returns a {@link MatrixTransformation} that rescales the frames over the first {@value
31+
* Returns a {@link MatrixTransformation} that rescales the frames over the first {@link
3232
* #ZOOM_DURATION_SECONDS} seconds, such that the rectangle filled with the input frame increases
3333
* linearly in size from a single point to filling the full output frame.
3434
*/

libraries/common/src/main/java/androidx/media3/common/AuxEffectInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ public final class AuxEffectInfo {
5252
* Creates an instance with the given effect identifier and send level.
5353
*
5454
* @param effectId The effect identifier. This is the value returned by {@link
55-
* AudioEffect#getId()} on the effect, or {@value #NO_AUX_EFFECT_ID} which represents no
55+
* AudioEffect#getId()} on the effect, or {@link #NO_AUX_EFFECT_ID} which represents no
5656
* effect. This value is passed to {@link AudioTrack#attachAuxEffect(int)} on the underlying
5757
* audio track.
5858
* @param sendLevel The send level for the effect, where 0 represents no effect and a value of 1
59-
* is full send. If {@code effectId} is not {@value #NO_AUX_EFFECT_ID}, this value is passed
60-
* to {@link AudioTrack#setAuxEffectSendLevel(float)} on the underlying audio track.
59+
* is full send. If {@code effectId} is not {@link #NO_AUX_EFFECT_ID}, this value is passed to
60+
* {@link AudioTrack#setAuxEffectSendLevel(float)} on the underlying audio track.
6161
*/
6262
public AuxEffectInfo(int effectId, float sendLevel) {
6363
this.effectId = effectId;

libraries/common/src/main/java/androidx/media3/common/Format.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
*
3636
* <p>When building formats, populate all fields whose values are known and relevant to the type of
3737
* format being constructed. For information about different types of format, see ExoPlayer's <a
38-
* href="https://exoplayer.dev/supported-formats.html">Supported formats page</a>.
38+
* href="https://developer.android.com/guide/topics/media/exoplayer/supported-formats">Supported
39+
* formats page</a>.
3940
*
4041
* <h2>Fields commonly relevant to all formats</h2>
4142
*

libraries/common/src/main/java/androidx/media3/common/ForwardingPlayer.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import android.view.SurfaceHolder;
2121
import android.view.SurfaceView;
2222
import android.view.TextureView;
23+
import androidx.annotation.CallSuper;
2324
import androidx.annotation.Nullable;
2425
import androidx.media3.common.text.Cue;
2526
import androidx.media3.common.text.CueGroup;
@@ -47,14 +48,29 @@ public Looper getApplicationLooper() {
4748
return player.getApplicationLooper();
4849
}
4950

50-
/** Calls {@link Player#addListener(Listener)} on the delegate. */
51+
/**
52+
* Calls {@link Player#addListener(Listener)} on the delegate.
53+
*
54+
* <p>Overrides of this method must delegate to {@code super.addListener} and not {@code
55+
* delegate.addListener}, in order to ensure the correct {@link Player} instance is passed to
56+
* {@link Player.Listener#onEvents(Player, Events)} (i.e. this forwarding instance, and not the
57+
* underlying {@code delegate} instance).
58+
*/
5159
@Override
60+
@CallSuper
5261
public void addListener(Listener listener) {
5362
player.addListener(new ForwardingListener(this, listener));
5463
}
5564

56-
/** Calls {@link Player#removeListener(Listener)} on the delegate. */
65+
/**
66+
* Calls {@link Player#removeListener(Listener)} on the delegate.
67+
*
68+
* <p>Overrides of this method must delegate to {@code super.removeListener} and not {@code
69+
* delegate.removeListener}, in order to ensure the listener 'matches' the listener added via
70+
* {@link #addListener} (otherwise the listener registered on the delegate won't be removed).
71+
*/
5772
@Override
73+
@CallSuper
5874
public void removeListener(Listener listener) {
5975
player.removeListener(new ForwardingListener(this, listener));
6076
}

libraries/common/src/main/java/androidx/media3/common/MediaLibraryInfo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public final class MediaLibraryInfo {
2929

3030
/** The version of the library expressed as a string, for example "1.2.3" or "1.2.3-beta01". */
3131
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION_INT) or vice versa.
32-
public static final String VERSION = "1.0.0";
32+
public static final String VERSION = "1.0.1";
3333

3434
/** The version of the library expressed as {@code TAG + "/" + VERSION}. */
3535
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa.
36-
public static final String VERSION_SLASHY = "AndroidXMedia3/1.0.0";
36+
public static final String VERSION_SLASHY = "AndroidXMedia3/1.0.1";
3737

3838
/**
3939
* The version of the library expressed as an integer, for example 1002003300.
@@ -47,7 +47,7 @@ public final class MediaLibraryInfo {
4747
* (123-045-006-3-00).
4848
*/
4949
// Intentionally hardcoded. Do not derive from other constants (e.g. VERSION) or vice versa.
50-
public static final int VERSION_INT = 1_000_000_3_00;
50+
public static final int VERSION_INT = 1_000_001_3_00;
5151

5252
/** Whether the library was compiled with {@link Assertions} checks enabled. */
5353
public static final boolean ASSERTIONS_ENABLED = true;

libraries/common/src/main/java/androidx/media3/common/PlaybackException.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,9 @@ public class PlaybackException extends Exception implements Bundleable {
152152
* Caused by the player trying to access cleartext HTTP traffic (meaning http:// rather than
153153
* https://) when the app's Network Security Configuration does not permit it.
154154
*
155-
* <p>See <a href="https://exoplayer.dev/issues/cleartext-not-permitted">this corresponding
156-
* troubleshooting topic</a>.
155+
* <p>See <a
156+
* href="https://developer.android.com/guide/topics/media/issues/cleartext-not-permitted">this
157+
* corresponding troubleshooting topic</a>.
157158
*/
158159
public static final int ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED = 2007;
159160
/** Caused by reading data out of the data bound. */

libraries/common/src/main/java/androidx/media3/common/SimpleBasePlayer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3355,7 +3355,8 @@ private void verifyApplicationThreadAndInitState() {
33553355
"Player is accessed on the wrong thread.\n"
33563356
+ "Current thread: '%s'\n"
33573357
+ "Expected thread: '%s'\n"
3358-
+ "See https://exoplayer.dev/issues/player-accessed-on-wrong-thread",
3358+
+ "See https://developer.android.com/guide/topics/media/issues/"
3359+
+ "player-accessed-on-wrong-thread",
33593360
Thread.currentThread().getName(), applicationLooper.getThread().getName());
33603361
throw new IllegalStateException(message);
33613362
}

libraries/common/src/main/java/androidx/media3/common/Timeline.java

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@
6161
*
6262
* <h2 id="single-file">Single media file or on-demand stream</h2>
6363
*
64-
* <p style="align:center"><img src="doc-files/timeline-single-file.svg" alt="Example timeline for a
65-
* single file">
64+
* <p style="align:center"><img
65+
* src="https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/doc-files/timeline-single-file.svg"
66+
* alt="Example timeline for a single file">
6667
*
6768
* <p>A timeline for a single media file or on-demand stream consists of a single period and window.
6869
* The window spans the whole period, indicating that all parts of the media are available for
@@ -71,8 +72,9 @@
7172
*
7273
* <h2>Playlist of media files or on-demand streams</h2>
7374
*
74-
* <p style="align:center"><img src="doc-files/timeline-playlist.svg" alt="Example timeline for a
75-
* playlist of files">
75+
* <p style="align:center"><img
76+
* src="https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/doc-files/timeline-playlist.svg"
77+
* alt="Example timeline for a playlist of files">
7678
*
7779
* <p>A timeline for a playlist of media files or on-demand streams consists of multiple periods,
7880
* each with its own window. Each window spans the whole of the corresponding period, and typically
@@ -82,8 +84,9 @@
8284
*
8385
* <h2 id="live-limited">Live stream with limited availability</h2>
8486
*
85-
* <p style="align:center"><img src="doc-files/timeline-live-limited.svg" alt="Example timeline for
86-
* a live stream with limited availability">
87+
* <p style="align:center"><img
88+
* src="https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/doc-files/timeline-live-limited.svg"
89+
* alt="Example timeline for a live stream with limited availability">
8790
*
8891
* <p>A timeline for a live stream consists of a period whose duration is unknown, since it's
8992
* continually extending as more content is broadcast. If content only remains available for a
@@ -95,8 +98,9 @@
9598
*
9699
* <h2>Live stream with indefinite availability</h2>
97100
*
98-
* <p style="align:center"><img src="doc-files/timeline-live-indefinite.svg" alt="Example timeline
99-
* for a live stream with indefinite availability">
101+
* <p style="align:center"><img
102+
* src="https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/doc-files/timeline-live-indefinite.svg"
103+
* alt="Example timeline for a live stream with indefinite availability">
100104
*
101105
* <p>A timeline for a live stream with indefinite availability is similar to the <a
102106
* href="#live-limited">Live stream with limited availability</a> case, except that the window
@@ -105,8 +109,9 @@
105109
*
106110
* <h2 id="live-multi-period">Live stream with multiple periods</h2>
107111
*
108-
* <p style="align:center"><img src="doc-files/timeline-live-multi-period.svg" alt="Example timeline
109-
* for a live stream with multiple periods">
112+
* <p style="align:center"><img
113+
* src="https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/doc-files/timeline-live-multi-period.svg"
114+
* alt="Example timeline for a live stream with multiple periods">
110115
*
111116
* <p>This case arises when a live stream is explicitly divided into separate periods, for example
112117
* at content boundaries. This case is similar to the <a href="#live-limited">Live stream with
@@ -115,8 +120,9 @@
115120
*
116121
* <h2>On-demand stream followed by live stream</h2>
117122
*
118-
* <p style="align:center"><img src="doc-files/timeline-advanced.svg" alt="Example timeline for an
119-
* on-demand stream followed by a live stream">
123+
* <p style="align:center"><img
124+
* src="https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/doc-files/timeline-advanced.svg"
125+
* alt="Example timeline for an on-demand stream followed by a live stream">
120126
*
121127
* <p>This case is the concatenation of the <a href="#single-file">Single media file or on-demand
122128
* stream</a> and <a href="#multi-period">Live stream with multiple periods</a> cases. When playback
@@ -125,12 +131,15 @@
125131
*
126132
* <h2 id="single-file-midrolls">On-demand stream with mid-roll ads</h2>
127133
*
128-
* <p style="align:center"><img src="doc-files/timeline-single-file-midrolls.svg" alt="Example
129-
* timeline for an on-demand stream with mid-roll ad groups">
134+
* <p style="align:center"><img
135+
* src="https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/doc-files/timeline-single-file-midrolls.svg"
136+
* alt="Example timeline for an on-demand stream with mid-roll ad groups">
130137
*
131138
* <p>This case includes mid-roll ad groups, which are defined as part of the timeline's single
132139
* period. The period can be queried for information about the ad groups and the ads they contain.
133140
*/
141+
// TODO(b/276289331): Revert to media3-hosted SVG links above once they're available on
142+
// developer.android.com.
134143
public abstract class Timeline implements Bundleable {
135144

136145
/**

0 commit comments

Comments
 (0)