Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9778898b
authored
Aug 27, 2020
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'dev-v2' into dev-v2-r2.12.0
parents
db63334f
e1c3da2a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
8 deletions
RELEASENOTES.md
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
library/ui/proguard-rules.txt
library/ui/src/main/java/com/google/android/exoplayer2/ui/TrackSelectionDialogBuilder.java
RELEASENOTES.md
View file @
9778898b
...
...
@@ -8,7 +8,8 @@
(
[
#6161
](
https://github.com/google/ExoPlayer/issues/6161
)
). The
new methods for playlist manipulation are
`setMediaItem(s)`
,
`addMediaItem(s)`
,
`moveMediaItem(s)`
,
`removeMediaItem(s)`
and
`clearMediaItems`
.
`clearMediaItems`
. This API should be used instead of
`ConcatenatingMediaSource`
in most cases.
*
Add
`getCurrentMediaItem`
for getting the currently playing item
in the playlist.
*
Add
`EventListener.onMediaItemTransition`
to report when
...
...
library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java
View file @
9778898b
...
...
@@ -163,6 +163,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
private
final
BandwidthMeter
bandwidthMeter
;
private
final
HandlerWrapper
handler
;
private
final
HandlerThread
internalPlaybackThread
;
private
final
Looper
playbackLooper
;
private
final
Timeline
.
Window
window
;
private
final
Timeline
.
Period
period
;
private
final
long
backBufferDurationUs
;
...
...
@@ -252,7 +253,8 @@ import java.util.concurrent.atomic.AtomicBoolean;
// not normally change to this priority" is incorrect.
internalPlaybackThread
=
new
HandlerThread
(
"ExoPlayer:Playback"
,
Process
.
THREAD_PRIORITY_AUDIO
);
internalPlaybackThread
.
start
();
handler
=
clock
.
createHandler
(
internalPlaybackThread
.
getLooper
(),
this
);
playbackLooper
=
internalPlaybackThread
.
getLooper
();
handler
=
clock
.
createHandler
(
playbackLooper
,
this
);
}
public
void
experimentalSetReleaseTimeoutMs
(
long
releaseTimeoutMs
)
{
...
...
@@ -403,7 +405,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
}
public
Looper
getPlaybackLooper
()
{
return
internalPlaybackThread
.
getLooper
()
;
return
playbackLooper
;
}
// Playlist.PlaylistInfoRefreshListener implementation.
...
...
@@ -1365,7 +1367,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
}
private
void
sendMessageToTarget
(
PlayerMessage
message
)
throws
ExoPlaybackException
{
if
(
message
.
getHandler
().
getLooper
()
==
handler
.
getLooper
()
)
{
if
(
message
.
getHandler
().
getLooper
()
==
playbackLooper
)
{
deliverMessage
(
message
);
if
(
playbackInfo
.
playbackState
==
Player
.
STATE_READY
||
playbackInfo
.
playbackState
==
Player
.
STATE_BUFFERING
)
{
...
...
library/ui/proguard-rules.txt
View file @
9778898b
...
...
@@ -3,7 +3,7 @@
# Constructor method accessed via reflection in TrackSelectionDialogBuilder
-dontnote androidx.appcompat.app.AlertDialog.Builder
-keepclassmembers class androidx.appcompat.app.AlertDialog$Builder {
<init>(android.content.Context);
<init>(android.content.Context
, int
);
public android.content.Context getContext();
public androidx.appcompat.app.AlertDialog$Builder setTitle(java.lang.CharSequence);
public androidx.appcompat.app.AlertDialog$Builder setView(android.view.View);
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/TrackSelectionDialogBuilder.java
View file @
9778898b
...
...
@@ -24,6 +24,7 @@ import android.content.DialogInterface;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.StyleRes
;
import
com.google.android.exoplayer2.source.TrackGroupArray
;
import
com.google.android.exoplayer2.trackselection.DefaultTrackSelector
;
import
com.google.android.exoplayer2.trackselection.DefaultTrackSelector.SelectionOverride
;
...
...
@@ -49,6 +50,7 @@ public final class TrackSelectionDialogBuilder {
}
private
final
Context
context
;
@StyleRes
private
int
themeResId
;
private
final
CharSequence
title
;
private
final
MappedTrackInfo
mappedTrackInfo
;
private
final
int
rendererIndex
;
...
...
@@ -122,6 +124,17 @@ public final class TrackSelectionDialogBuilder {
}
/**
* Sets the resource ID of the theme used to inflate this dialog.
*
* @param themeResId The resource ID of the theme.
* @return This builder, for convenience.
*/
public
TrackSelectionDialogBuilder
setTheme
(
@StyleRes
int
themeResId
)
{
this
.
themeResId
=
themeResId
;
return
this
;
}
/**
* Sets whether the selection is initially shown as disabled.
*
* @param isDisabled Whether the selection is initially shown as disabled.
...
...
@@ -214,7 +227,7 @@ public final class TrackSelectionDialogBuilder {
}
private
Dialog
buildForPlatform
()
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
context
);
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
context
,
themeResId
);
// Inflate with the builder's context to ensure the correct style is used.
LayoutInflater
dialogInflater
=
LayoutInflater
.
from
(
builder
.
getContext
());
...
...
@@ -238,8 +251,8 @@ public final class TrackSelectionDialogBuilder {
// the APK size even with shrinking. See https://issuetracker.google.com/161514204.
// LINT.IfChange
Class
<?>
builderClazz
=
Class
.
forName
(
"androidx.appcompat.app.AlertDialog$Builder"
);
Constructor
<?>
builderConstructor
=
builderClazz
.
getConstructor
(
Context
.
class
);
Object
builder
=
builderConstructor
.
newInstance
(
context
);
Constructor
<?>
builderConstructor
=
builderClazz
.
getConstructor
(
Context
.
class
,
int
.
class
);
Object
builder
=
builderConstructor
.
newInstance
(
context
,
themeResId
);
// Inflate with the builder's context to ensure the correct style is used.
Context
builderContext
=
(
Context
)
builderClazz
.
getMethod
(
"getContext"
).
invoke
(
builder
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment