mirror of https://github.com/Chocobozzz/PeerTube
Fix playlist start time of element 1
parent
128748e6e4
commit
167d36df63
|
@ -118,6 +118,7 @@ export class VideoWatchPlaylistComponent {
|
||||||
if (position) this.updatePlaylistIndex(position)
|
if (position) this.updatePlaylistIndex(position)
|
||||||
|
|
||||||
if (redirectToFirst) {
|
if (redirectToFirst) {
|
||||||
|
console.log(firstAvailableVideo)
|
||||||
const extras = {
|
const extras = {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
start: firstAvailableVideo.startTimestamp,
|
start: firstAvailableVideo.startTimestamp,
|
||||||
|
|
|
@ -293,7 +293,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
private loadRouteQuery () {
|
private loadRouteQuery () {
|
||||||
this.queryParamsSub = this.route.queryParams.subscribe(queryParams => {
|
this.queryParamsSub = this.route.queryParams.subscribe(queryParams => {
|
||||||
// Handle the ?playlistPosition
|
// Handle the ?playlistPosition
|
||||||
const positionParam = queryParams['playlistPosition'] ?? 1
|
const positionParam = queryParams['playlistPosition']
|
||||||
|
if (!positionParam) return
|
||||||
|
|
||||||
this.playlistPosition = positionParam === 'last'
|
this.playlistPosition = positionParam === 'last'
|
||||||
? -1 // Handle the "last" index
|
? -1 // Handle the "last" index
|
||||||
|
@ -307,7 +308,9 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
this.videoWatchPlaylist.updatePlaylistIndex(this.playlistPosition)
|
this.videoWatchPlaylist.updatePlaylistIndex(this.playlistPosition)
|
||||||
|
|
||||||
const start = queryParams['start']
|
const start = queryParams['start']
|
||||||
if (this.peertubePlayer && start) this.peertubePlayer.getPlayer().currentTime(parseInt(start, 10))
|
if (this.peertubePlayer?.getPlayer() && start) {
|
||||||
|
this.peertubePlayer.getPlayer().currentTime(parseInt(start, 10))
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue