Fixed "previous" button showing when not watching a playlist

pull/3958/head
Poslovitch 2021-04-24 12:04:48 +00:00 committed by Chocobozzz
parent 33d21a9b47
commit dfdcbb948a
1 changed files with 5 additions and 4 deletions

View File

@ -799,10 +799,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
common: {
autoplay: this.isAutoplay(),
nextVideo: () => this.zone.run(() => this.autoplayNext()),
previousVideo: () => this.zone.run(() => {
// FIXME: Only show if this is a playlist
if (this.playlist) this.zone.run(() => this.videoWatchPlaylist.navigateToPreviousPlaylistVideo())
}),
playerElement: this.playerElement,
onPlayerElementChange: (element: HTMLVideoElement) => this.playerElement = element,
@ -851,6 +847,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
}
}
// Only set this if we're in a playlist
if (this.playlist) options.common.previousVideo = () => {
this.zone.run(() => this.videoWatchPlaylist.navigateToPreviousPlaylistVideo())
}
let mode: PlayerMode
if (urlOptions.playerMode) {