Skip to content

Commit 000f3f2

Browse files
authored
Merge pull request #4219 from google/dev-v2-r2.8.0
r2.8.0
2 parents 4b531dc + 5912707 commit 000f3f2

File tree

725 files changed

+33975
-13386
lines changed

Some content is hidden

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

725 files changed

+33975
-13386
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ cmake-build-debug
4343
dist
4444
tmp
4545

46+
# External native builds
47+
.externalNativeBuild
48+
4649
# VP9 extension
4750
extensions/vp9/src/main/jni/libvpx
4851
extensions/vp9/src/main/jni/libvpx_android_configs
@@ -62,3 +65,4 @@ extensions/cronet/jniLibs/*
6265
!extensions/cronet/jniLibs/README.md
6366
extensions/cronet/libs/*
6467
!extensions/cronet/libs/README.md
68+

ISSUE_TEMPLATE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ devices and Android versions.
3838
Capture a full bug report using "adb bugreport". Output from "adb logcat" or a
3939
log snippet is NOT sufficient. Please attach the captured bug report as a file.
4040
If you don't wish to post it publicly, please submit the issue, then email the
41-
bug report to dev.exoplayer@gmail.com using a subject in the format "Issue #1234".
41+
bug report to dev.exoplayer@gmail.com using a subject in the format
42+
"Issue #1234".
43+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ repositories {
3838
}
3939
```
4040

41-
Next add a gradle compile dependency to the `build.gradle` file of your app
42-
module. The following will add a dependency to the full library:
41+
Next add a dependency in the `build.gradle` file of your app module. The
42+
following will add a dependency to the full library:
4343

4444
```gradle
4545
implementation 'com.google.android.exoplayer:exoplayer:2.X.X'

RELEASENOTES.md

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,119 @@
11
# Release notes #
22

3+
### 2.8.0 ###
4+
5+
* Downloading:
6+
* Add `DownloadService`, `DownloadManager` and related classes
7+
([#2643](https://github.com/google/ExoPlayer/issues/2643)). Information on
8+
using these components to download progressive formats can be found
9+
[here](https://medium.com/google-exoplayer/downloading-streams-6d259eec7f95).
10+
To see how to download DASH, HLS and SmoothStreaming media, take a look at
11+
the app.
12+
* Updated main demo app to support downloading DASH, HLS, SmoothStreaming and
13+
progressive media.
14+
* MediaSources:
15+
* Allow reusing media sources after they have been released and
16+
also in parallel to allow adding them multiple times to a concatenation.
17+
([#3498](https://github.com/google/ExoPlayer/issues/3498)).
18+
* Merged `DynamicConcatenatingMediaSource` into `ConcatenatingMediaSource` and
19+
deprecated `DynamicConcatenatingMediaSource`.
20+
* Allow clipping of child media sources where the period and window have a
21+
non-zero offset with `ClippingMediaSource`.
22+
* Allow adding and removing `MediaSourceEventListener`s to MediaSources after
23+
they have been created. Listening to events is now supported for all
24+
media sources including composite sources.
25+
* Added callbacks to `MediaSourceEventListener` to get notified when media
26+
periods are created, released and being read from.
27+
* Support live stream clipping with `ClippingMediaSource`.
28+
* Allow setting tags for all media sources in their factories. The tag of the
29+
current window can be retrieved with `ExoPlayer.getCurrentTag`.
30+
* UI components:
31+
* Add support for displaying error messages and a buffering spinner in
32+
`PlayerView`.
33+
* Add support for listening to `AspectRatioFrameLayout`'s aspect ratio update
34+
([#3736](https://github.com/google/ExoPlayer/issues/3736)).
35+
* Add `PlayerNotificationManager` for displaying notifications reflecting the
36+
player state.
37+
* Add `TrackSelectionView` for selecting tracks with `DefaultTrackSelector`.
38+
* Add `TrackNameProvider` for converting track `Format`s to textual
39+
descriptions, and `DefaultTrackNameProvider` as a default implementation.
40+
* Track selection:
41+
* Reworked `MappingTrackSelector` and `DefaultTrackSelector`.
42+
* `DefaultTrackSelector.Parameters` now implements `Parcelable`.
43+
* Added UI components for track selection (see above).
44+
* Audio:
45+
* Support extracting data from AMR container formats, including both narrow
46+
and wide band ([#2527](https://github.com/google/ExoPlayer/issues/2527)).
47+
* FLAC:
48+
* Sniff FLAC files correctly if they have ID3 headers
49+
([#4055](https://github.com/google/ExoPlayer/issues/4055)).
50+
* Supports FLAC files with high sample rate (176400 and 192000)
51+
([#3769](https://github.com/google/ExoPlayer/issues/3769)).
52+
* Factor out `AudioTrack` position tracking from `DefaultAudioSink`.
53+
* Fix an issue where the playback position would pause just after playback
54+
begins, and poll the audio timestamp less frequently once it starts
55+
advancing ([#3841](https://github.com/google/ExoPlayer/issues/3841)).
56+
* Add an option to skip silent audio in `PlaybackParameters`
57+
((#2635)[https://github.com/google/ExoPlayer/issues/2635]).
58+
* Fix an issue where playback of TrueHD streams would get stuck after seeking
59+
due to not finding a syncframe
60+
((#3845)[https://github.com/google/ExoPlayer/issues/3845]).
61+
* Fix an issue with eac3-joc playback where a codec would fail to configure
62+
((#4165)[https://github.com/google/ExoPlayer/issues/4165]).
63+
* Handle non-empty end-of-stream buffers, to fix gapless playback of streams
64+
with encoder padding when the decoder returns a non-empty final buffer.
65+
* Allow trimming more than one sample when applying an elst audio edit via
66+
gapless playback info.
67+
* Allow overriding skipping/scaling with custom `AudioProcessor`s
68+
((#3142)[https://github.com/google/ExoPlayer/issues/3142]).
69+
* Caching:
70+
* Add release method to the `Cache` interface, and prevent multiple instances
71+
of `SimpleCache` using the same folder at the same time.
72+
* Cache redirect URLs
73+
([#2360](https://github.com/google/ExoPlayer/issues/2360)).
74+
* DRM:
75+
* Allow multiple listeners for `DefaultDrmSessionManager`.
76+
* Pass `DrmSessionManager` to `ExoPlayerFactory` instead of `RendererFactory`.
77+
* Change minimum API requirement for CBC and pattern encryption from 24 to 25
78+
([#4022][https://github.com/google/ExoPlayer/issues/4022]).
79+
* Fix handling of 307/308 redirects when making license requests
80+
([#4108](https://github.com/google/ExoPlayer/issues/4108)).
81+
* HLS:
82+
* Fix playlist loading error propagation when the current selection does
83+
not include all of the playlist's variants.
84+
* Fix SAMPLE-AES-CENC and SAMPLE-AES-CTR EXT-X-KEY methods
85+
([#4145](https://github.com/google/ExoPlayer/issues/4145)).
86+
* Preeptively declare an ID3 track in chunkless preparation
87+
([#4016](https://github.com/google/ExoPlayer/issues/4016)).
88+
* Add support for multiple #EXT-X-MAP tags in a media playlist
89+
([#4164](https://github.com/google/ExoPlayer/issues/4182)).
90+
* Fix seeking in live streams
91+
([#4187](https://github.com/google/ExoPlayer/issues/4187)).
92+
* IMA:
93+
* Allow setting the ad media load timeout
94+
([#3691](https://github.com/google/ExoPlayer/issues/3691)).
95+
* Expose ad load errors via `MediaSourceEventListener` on `AdsMediaSource`,
96+
and allow setting an ad event listener on `ImaAdsLoader`. Deprecate the
97+
`AdsMediaSource.EventListener`.
98+
* Add `AnalyticsListener` interface which can be registered in
99+
`SimpleExoPlayer` to receive detailed metadata for each ExoPlayer event.
100+
* Optimize seeking in FMP4 by enabling seeking to the nearest sync sample within
101+
a fragment. This benefits standalone FMP4 playbacks, DASH and SmoothStreaming.
102+
* Updated default max buffer length in `DefaultLoadControl`.
103+
* Fix ClearKey decryption error if the key contains a forward slash
104+
([#4075](https://github.com/google/ExoPlayer/issues/4075)).
105+
* Fix crash when switching surface on Huawei P9 Lite
106+
([#4084](https://github.com/google/ExoPlayer/issues/4084)), and Philips QM163E
107+
([#4104](https://github.com/google/ExoPlayer/issues/4104)).
108+
* Support ZLIB compressed PGS subtitles.
109+
* Added `getPlaybackError` to `Player` interface.
110+
* Moved initial bitrate estimate from `AdaptiveTrackSelection` to
111+
`DefaultBandwidthMeter`.
112+
* Removed default renderer time offset of 60000000 from internal player. The
113+
actual renderer timestamp offset can be obtained by listening to
114+
`BaseRenderer.onStreamChanged`.
115+
* Added dependencies on checkerframework annotations for static code analysis.
116+
3117
### 2.7.3 ###
4118

5119
* Fix ProGuard configuration for Cast, IMA and OkHttp extensions.
@@ -93,7 +207,7 @@
93207
([#3630](https://github.com/google/ExoPlayer/issues/3630)).
94208
* DASH:
95209
* Support in-band Emsg events targeting the player with scheme id
96-
"urn:mpeg:dash:event:2012" and scheme values "1", "2" and "3".
210+
`urn:mpeg:dash:event:2012` and scheme values "1", "2" and "3".
97211
* Support EventStream elements in DASH manifests.
98212
* HLS:
99213
* Add opt-in support for chunkless preparation in HLS. This allows an
@@ -163,6 +277,7 @@
163277
([#3792](https://github.com/google/ExoPlayer/issues/3792).
164278
* Support 14-bit mode and little endianness in DTS PES packets
165279
([#3340](https://github.com/google/ExoPlayer/issues/3340)).
280+
* Demo app: Add ability to download not DRM protected content.
166281

167282
### 2.6.1 ###
168283

extensions/mediasession/src/main/res/values-ms-rMY/strings.xml renamed to checker-framework-lint.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<?xml version="1.0"?>
2-
<!--
3-
Copyright (C) 2016 The Android Open Source Project
1+
<!-- Copyright (C) 2018 The Android Open Source Project
42
53
Licensed under the Apache License, Version 2.0 (the "License");
64
you may not use this file except in compliance with the License.
@@ -14,8 +12,8 @@
1412
See the License for the specific language governing permissions and
1513
limitations under the License.
1614
-->
17-
<resources>
18-
<string name="exo_media_action_repeat_all_description">"Ulang semua"</string>
19-
<string name="exo_media_action_repeat_off_description">"Tiada ulangan"</string>
20-
<string name="exo_media_action_repeat_one_description">"Ulangan"</string>
21-
</resources>
15+
<lint>
16+
<issue id="InvalidPackage">
17+
<ignore path="**/checker-qual-*.jar"/>
18+
</issue>
19+
</lint>

constants.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
// limitations under the License.
1414
project.ext {
1515
// ExoPlayer version and version code.
16-
releaseVersion = '2.7.3'
17-
releaseVersionCode = 2703
16+
releaseVersion = '2.8.0'
17+
releaseVersionCode = 2800
1818
// Important: ExoPlayer specifies a minSdkVersion of 14 because various
1919
// components provided by the library may be of use on older devices.
2020
// However, please note that the core media playback functionality provided
@@ -25,12 +25,14 @@ project.ext {
2525
buildToolsVersion = '27.0.3'
2626
testSupportLibraryVersion = '0.5'
2727
supportLibraryVersion = '27.0.0'
28-
playServicesLibraryVersion = '11.4.2'
28+
playServicesLibraryVersion = '12.0.0'
2929
dexmakerVersion = '1.2'
3030
mockitoVersion = '1.9.5'
3131
junitVersion = '4.12'
3232
truthVersion = '0.39'
3333
robolectricVersion = '3.7.1'
34+
autoValueVersion = '1.6'
35+
checkerframeworkVersion = '2.5.0'
3436
modulePrefix = ':'
3537
if (gradle.ext.has('exoplayerModulePrefix')) {
3638
modulePrefix += gradle.ext.exoplayerModulePrefix

core_settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ include modulePrefix + 'extension-opus'
3636
include modulePrefix + 'extension-vp9'
3737
include modulePrefix + 'extension-rtmp'
3838
include modulePrefix + 'extension-leanback'
39+
include modulePrefix + 'extension-jobdispatcher'
3940

4041
project(modulePrefix + 'library').projectDir = new File(rootDir, 'library/all')
4142
project(modulePrefix + 'library-core').projectDir = new File(rootDir, 'library/core')
@@ -56,6 +57,7 @@ project(modulePrefix + 'extension-opus').projectDir = new File(rootDir, 'extensi
5657
project(modulePrefix + 'extension-vp9').projectDir = new File(rootDir, 'extensions/vp9')
5758
project(modulePrefix + 'extension-rtmp').projectDir = new File(rootDir, 'extensions/rtmp')
5859
project(modulePrefix + 'extension-leanback').projectDir = new File(rootDir, 'extensions/leanback')
60+
project(modulePrefix + 'extension-jobdispatcher').projectDir = new File(rootDir, 'extensions/jobdispatcher')
5961

6062
if (gradle.ext.has('exoplayerIncludeCronetExtension')
6163
&& gradle.ext.exoplayerIncludeCronetExtension) {

demos/cast/src/main/java/com/google/android/exoplayer2/castdemo/PlayerManager.java

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import com.google.android.exoplayer2.Timeline.Period;
3333
import com.google.android.exoplayer2.castdemo.DemoUtil.Sample;
3434
import com.google.android.exoplayer2.ext.cast.CastPlayer;
35-
import com.google.android.exoplayer2.source.DynamicConcatenatingMediaSource;
35+
import com.google.android.exoplayer2.source.ConcatenatingMediaSource;
3636
import com.google.android.exoplayer2.source.ExtractorMediaSource;
3737
import com.google.android.exoplayer2.source.MediaSource;
3838
import com.google.android.exoplayer2.source.dash.DashMediaSource;
@@ -80,8 +80,8 @@ public interface QueuePositionListener {
8080
private final CastPlayer castPlayer;
8181
private final ArrayList<DemoUtil.Sample> mediaQueue;
8282
private final QueuePositionListener queuePositionListener;
83+
private final ConcatenatingMediaSource concatenatingMediaSource;
8384

84-
private DynamicConcatenatingMediaSource dynamicConcatenatingMediaSource;
8585
private boolean castMediaQueueCreationPending;
8686
private int currentItemIndex;
8787
private Player currentPlayer;
@@ -117,9 +117,10 @@ private PlayerManager(
117117
this.castControlView = castControlView;
118118
mediaQueue = new ArrayList<>();
119119
currentItemIndex = C.INDEX_UNSET;
120+
concatenatingMediaSource = new ConcatenatingMediaSource();
120121

121122
DefaultTrackSelector trackSelector = new DefaultTrackSelector(BANDWIDTH_METER);
122-
RenderersFactory renderersFactory = new DefaultRenderersFactory(context, null);
123+
RenderersFactory renderersFactory = new DefaultRenderersFactory(context);
123124
exoPlayer = ExoPlayerFactory.newSimpleInstance(renderersFactory, trackSelector);
124125
exoPlayer.addListener(this);
125126
localPlayerView.setPlayer(exoPlayer);
@@ -155,9 +156,8 @@ public int getCurrentItemIndex() {
155156
*/
156157
public void addItem(Sample sample) {
157158
mediaQueue.add(sample);
158-
if (currentPlayer == exoPlayer) {
159-
dynamicConcatenatingMediaSource.addMediaSource(buildMediaSource(sample));
160-
} else {
159+
concatenatingMediaSource.addMediaSource(buildMediaSource(sample));
160+
if (currentPlayer == castPlayer) {
161161
castPlayer.addItems(buildMediaQueueItem(sample));
162162
}
163163
}
@@ -186,9 +186,8 @@ public Sample getItem(int position) {
186186
* @return Whether the removal was successful.
187187
*/
188188
public boolean removeItem(int itemIndex) {
189-
if (currentPlayer == exoPlayer) {
190-
dynamicConcatenatingMediaSource.removeMediaSource(itemIndex);
191-
} else {
189+
concatenatingMediaSource.removeMediaSource(itemIndex);
190+
if (currentPlayer == castPlayer) {
192191
if (castPlayer.getPlaybackState() != Player.STATE_IDLE) {
193192
Timeline castTimeline = castPlayer.getCurrentTimeline();
194193
if (castTimeline.getPeriodCount() <= itemIndex) {
@@ -215,9 +214,8 @@ public boolean removeItem(int itemIndex) {
215214
*/
216215
public boolean moveItem(int fromIndex, int toIndex) {
217216
// Player update.
218-
if (currentPlayer == exoPlayer) {
219-
dynamicConcatenatingMediaSource.moveMediaSource(fromIndex, toIndex);
220-
} else if (castPlayer.getPlaybackState() != Player.STATE_IDLE) {
217+
concatenatingMediaSource.moveMediaSource(fromIndex, toIndex);
218+
if (currentPlayer == castPlayer && castPlayer.getPlaybackState() != Player.STATE_IDLE) {
221219
Timeline castTimeline = castPlayer.getCurrentTimeline();
222220
int periodCount = castTimeline.getPeriodCount();
223221
if (periodCount <= fromIndex || periodCount <= toIndex) {
@@ -263,6 +261,7 @@ public boolean dispatchKeyEvent(KeyEvent event) {
263261
public void release() {
264262
currentItemIndex = C.INDEX_UNSET;
265263
mediaQueue.clear();
264+
concatenatingMediaSource.clear();
266265
castPlayer.setSessionAvailabilityListener(null);
267266
castPlayer.release();
268267
localPlayerView.setPlayer(null);
@@ -354,11 +353,7 @@ private void setCurrentPlayer(Player currentPlayer) {
354353
// Media queue management.
355354
castMediaQueueCreationPending = currentPlayer == castPlayer;
356355
if (currentPlayer == exoPlayer) {
357-
dynamicConcatenatingMediaSource = new DynamicConcatenatingMediaSource();
358-
for (int i = 0; i < mediaQueue.size(); i++) {
359-
dynamicConcatenatingMediaSource.addMediaSource(buildMediaSource(mediaQueue.get(i)));
360-
}
361-
exoPlayer.prepare(dynamicConcatenatingMediaSource);
356+
exoPlayer.prepare(concatenatingMediaSource);
362357
}
363358

364359
// Playback transition.

demos/ima/src/main/java/com/google/android/exoplayer2/imademo/PlayerManager.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
import android.content.Context;
1919
import android.net.Uri;
20-
import android.os.Handler;
21-
import android.support.annotation.Nullable;
2220
import com.google.android.exoplayer2.C;
2321
import com.google.android.exoplayer2.C.ContentType;
2422
import com.google.android.exoplayer2.ExoPlayer;
@@ -27,7 +25,6 @@
2725
import com.google.android.exoplayer2.ext.ima.ImaAdsLoader;
2826
import com.google.android.exoplayer2.source.ExtractorMediaSource;
2927
import com.google.android.exoplayer2.source.MediaSource;
30-
import com.google.android.exoplayer2.source.MediaSourceEventListener;
3128
import com.google.android.exoplayer2.source.ads.AdsMediaSource;
3229
import com.google.android.exoplayer2.source.dash.DashMediaSource;
3330
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource;
@@ -83,8 +80,7 @@ public void init(Context context, PlayerView playerView) {
8380

8481
// This is the MediaSource representing the content media (i.e. not the ad).
8582
String contentUrl = context.getString(R.string.content_url);
86-
MediaSource contentMediaSource =
87-
buildMediaSource(Uri.parse(contentUrl), /* handler= */ null, /* listener= */ null);
83+
MediaSource contentMediaSource = buildMediaSource(Uri.parse(contentUrl));
8884

8985
// Compose the content media source into a new AdsMediaSource with both ads and content.
9086
MediaSource mediaSourceWithAds =
@@ -121,9 +117,8 @@ public void release() {
121117
// AdsMediaSource.MediaSourceFactory implementation.
122118

123119
@Override
124-
public MediaSource createMediaSource(
125-
Uri uri, @Nullable Handler handler, @Nullable MediaSourceEventListener listener) {
126-
return buildMediaSource(uri, handler, listener);
120+
public MediaSource createMediaSource(Uri uri) {
121+
return buildMediaSource(uri);
127122
}
128123

129124
@Override
@@ -134,25 +129,22 @@ public int[] getSupportedTypes() {
134129

135130
// Internal methods.
136131

137-
private MediaSource buildMediaSource(
138-
Uri uri, @Nullable Handler handler, @Nullable MediaSourceEventListener listener) {
132+
private MediaSource buildMediaSource(Uri uri) {
139133
@ContentType int type = Util.inferContentType(uri);
140134
switch (type) {
141135
case C.TYPE_DASH:
142136
return new DashMediaSource.Factory(
143137
new DefaultDashChunkSource.Factory(mediaDataSourceFactory),
144138
manifestDataSourceFactory)
145-
.createMediaSource(uri, handler, listener);
139+
.createMediaSource(uri);
146140
case C.TYPE_SS:
147141
return new SsMediaSource.Factory(
148142
new DefaultSsChunkSource.Factory(mediaDataSourceFactory), manifestDataSourceFactory)
149-
.createMediaSource(uri, handler, listener);
143+
.createMediaSource(uri);
150144
case C.TYPE_HLS:
151-
return new HlsMediaSource.Factory(mediaDataSourceFactory)
152-
.createMediaSource(uri, handler, listener);
145+
return new HlsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri);
153146
case C.TYPE_OTHER:
154-
return new ExtractorMediaSource.Factory(mediaDataSourceFactory)
155-
.createMediaSource(uri, handler, listener);
147+
return new ExtractorMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri);
156148
default:
157149
throw new IllegalStateException("Unsupported type: " + type);
158150
}

0 commit comments

Comments
 (0)