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
5aa8a7a5
authored
Jun 09, 2020
by
olly
Committed by
Oliver Woodman
Jun 11, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Prevent shutter closing for within-window seeks to unprepared periods
Issue: #5507 PiperOrigin-RevId: 315512207
parent
9ef9b56b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
RELEASENOTES.md
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
RELEASENOTES.md
View file @
5aa8a7a5
...
@@ -191,6 +191,10 @@
...
@@ -191,6 +191,10 @@
(
[
#6926
](
https://github.com/google/ExoPlayer/issues/6926
)
).
(
[
#6926
](
https://github.com/google/ExoPlayer/issues/6926
)
).
*
Update
`TrackSelectionDialogBuilder`
to use AndroidX Compat Dialog
*
Update
`TrackSelectionDialogBuilder`
to use AndroidX Compat Dialog
(
[
#7357
](
https://github.com/google/ExoPlayer/issues/7357
)
).
(
[
#7357
](
https://github.com/google/ExoPlayer/issues/7357
)
).
*
Prevent the video surface going black when seeking to an unprepared
period within the current window. For example when seeking over an ad
group, or to the next period in a multi-period DASH stream
(
[
#5507
](
https://github.com/google/ExoPlayer/issues/5507
)
).
*
Metadata: Add minimal DVB Application Information Table (AIT) support
*
Metadata: Add minimal DVB Application Information Table (AIT) support
(
[
#6922
](
https://github.com/google/ExoPlayer/pull/6922
)
).
(
[
#6922
](
https://github.com/google/ExoPlayer/pull/6922
)
).
*
Cast extension: Implement playlist API and deprecate the old queue
*
Cast extension: Implement playlist API and deprecate the old queue
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
5aa8a7a5
...
@@ -48,6 +48,8 @@ import com.google.android.exoplayer2.ExoPlaybackException;
...
@@ -48,6 +48,8 @@ import com.google.android.exoplayer2.ExoPlaybackException;
import
com.google.android.exoplayer2.PlaybackPreparer
;
import
com.google.android.exoplayer2.PlaybackPreparer
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
import
com.google.android.exoplayer2.Player.DiscontinuityReason
;
import
com.google.android.exoplayer2.Timeline
;
import
com.google.android.exoplayer2.Timeline.Period
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.Metadata
;
import
com.google.android.exoplayer2.metadata.flac.PictureFrame
;
import
com.google.android.exoplayer2.metadata.flac.PictureFrame
;
import
com.google.android.exoplayer2.metadata.id3.ApicFrame
;
import
com.google.android.exoplayer2.metadata.id3.ApicFrame
;
...
@@ -1554,6 +1556,13 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
...
@@ -1554,6 +1556,13 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
SingleTapListener
,
SingleTapListener
,
PlayerControlView
.
VisibilityListener
{
PlayerControlView
.
VisibilityListener
{
private
final
Period
period
;
private
@Nullable
Object
lastPeriodUidWithTracks
;
public
ComponentListener
()
{
period
=
new
Period
();
}
// TextOutput implementation
// TextOutput implementation
@Override
@Override
...
@@ -1602,6 +1611,29 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
...
@@ -1602,6 +1611,29 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
@Override
@Override
public
void
onTracksChanged
(
TrackGroupArray
tracks
,
TrackSelectionArray
selections
)
{
public
void
onTracksChanged
(
TrackGroupArray
tracks
,
TrackSelectionArray
selections
)
{
// Suppress the update if transitioning to an unprepared period within the same window. This
// is necessary to avoid closing the shutter when such a transition occurs. See:
// https://github.com/google/ExoPlayer/issues/5507.
Player
player
=
Assertions
.
checkNotNull
(
PlayerView
.
this
.
player
);
Timeline
timeline
=
player
.
getCurrentTimeline
();
if
(
timeline
.
isEmpty
())
{
lastPeriodUidWithTracks
=
null
;
}
else
if
(!
player
.
getCurrentTrackGroups
().
isEmpty
())
{
lastPeriodUidWithTracks
=
timeline
.
getPeriod
(
player
.
getCurrentPeriodIndex
(),
period
,
/* setIds= */
true
).
uid
;
}
else
if
(
lastPeriodUidWithTracks
!=
null
)
{
int
lastPeriodIndexWithTracks
=
timeline
.
getIndexOfPeriod
(
lastPeriodUidWithTracks
);
if
(
lastPeriodIndexWithTracks
!=
C
.
INDEX_UNSET
)
{
int
lastWindowIndexWithTracks
=
timeline
.
getPeriod
(
lastPeriodIndexWithTracks
,
period
).
windowIndex
;
if
(
player
.
getCurrentWindowIndex
()
==
lastWindowIndexWithTracks
)
{
// We're in the same window. Suppress the update.
return
;
}
}
lastPeriodUidWithTracks
=
null
;
}
updateForCurrentTrackSelections
(
/* isNewPlayer= */
false
);
updateForCurrentTrackSelections
(
/* isNewPlayer= */
false
);
}
}
...
...
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