-Fixed skip silence state not maintained by player on new queue.
-Fixed TrackSelector deprecations.
This commit is contained in:
parent
72d1e5131f
commit
3194a2bf2c
3 changed files with 12 additions and 7 deletions
|
@ -236,7 +236,8 @@ public abstract class BasePlayer implements
|
|||
final int repeatMode = intent.getIntExtra(REPEAT_MODE, getRepeatMode());
|
||||
final float playbackSpeed = intent.getFloatExtra(PLAYBACK_SPEED, getPlaybackSpeed());
|
||||
final float playbackPitch = intent.getFloatExtra(PLAYBACK_PITCH, getPlaybackPitch());
|
||||
final boolean playbackSkipSilence = intent.getBooleanExtra(PLAYBACK_SKIP_SILENCE, false);
|
||||
final boolean playbackSkipSilence = intent.getBooleanExtra(PLAYBACK_SKIP_SILENCE,
|
||||
getPlaybackSkipSilence());
|
||||
|
||||
// Good to go...
|
||||
initPlayback(queue, repeatMode, playbackSpeed, playbackPitch, playbackSkipSilence,
|
||||
|
|
|
@ -729,7 +729,8 @@ public final class PopupVideoPlayer extends Service {
|
|||
/*package-private*/ void enableVideoRenderer(final boolean enable) {
|
||||
final int videoRendererIndex = getRendererIndex(C.TRACK_TYPE_VIDEO);
|
||||
if (trackSelector != null && videoRendererIndex != RENDERER_UNAVAILABLE) {
|
||||
trackSelector.setRendererDisabled(videoRendererIndex, !enable);
|
||||
trackSelector.setParameters(trackSelector.buildUponParameters()
|
||||
.setRendererDisabled(videoRendererIndex, !enable));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -241,7 +241,8 @@ public abstract class VideoPlayer extends BasePlayer
|
|||
|
||||
// Setup audio session with onboard equalizer
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
trackSelector.setTunnelingAudioSessionId(C.generateAudioSessionIdV21(context));
|
||||
trackSelector.setParameters(trackSelector.buildUponParameters()
|
||||
.setTunnelingAudioSessionId(C.generateAudioSessionIdV21(context)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -298,7 +299,8 @@ public abstract class VideoPlayer extends BasePlayer
|
|||
captionOffItem.setOnMenuItemClickListener(menuItem -> {
|
||||
final int textRendererIndex = getRendererIndex(C.TRACK_TYPE_TEXT);
|
||||
if (trackSelector != null && textRendererIndex != RENDERER_UNAVAILABLE) {
|
||||
trackSelector.setRendererDisabled(textRendererIndex, true);
|
||||
trackSelector.setParameters(trackSelector.buildUponParameters()
|
||||
.setRendererDisabled(textRendererIndex, true));
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
@ -312,7 +314,8 @@ public abstract class VideoPlayer extends BasePlayer
|
|||
final int textRendererIndex = getRendererIndex(C.TRACK_TYPE_TEXT);
|
||||
if (trackSelector != null && textRendererIndex != RENDERER_UNAVAILABLE) {
|
||||
trackSelector.setPreferredTextLanguage(captionLanguage);
|
||||
trackSelector.setRendererDisabled(textRendererIndex, false);
|
||||
trackSelector.setParameters(trackSelector.buildUponParameters()
|
||||
.setRendererDisabled(textRendererIndex, false));
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
@ -575,8 +578,8 @@ public abstract class VideoPlayer extends BasePlayer
|
|||
|
||||
// Build UI
|
||||
buildCaptionMenu(availableLanguages);
|
||||
if (trackSelector.getRendererDisabled(textRenderer) || preferredLanguage == null ||
|
||||
!availableLanguages.contains(preferredLanguage)) {
|
||||
if (trackSelector.getParameters().getRendererDisabled(textRenderer) ||
|
||||
preferredLanguage == null || !availableLanguages.contains(preferredLanguage)) {
|
||||
captionTextView.setText(R.string.caption_none);
|
||||
} else {
|
||||
captionTextView.setText(preferredLanguage);
|
||||
|
|
Loading…
Reference in a new issue