Skip to content

Commit

Permalink
Add button to pause playlist after current video (FreeTubeApp#3938)
Browse files Browse the repository at this point in the history
Rounded playlist buttons to circles
Add pause button for playlists
  • Loading branch information
vdbhb59 authored Sep 30, 2023
1 parent 59619db commit bcd6081
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/renderer/views/Watch/Watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default defineComponent({
hideVideoDescription: function () {
return this.$store.getters.getHideVideoDescription
},
showFamilyFriendlyOnly: function() {
showFamilyFriendlyOnly: function () {
return this.$store.getters.getShowFamilyFriendlyOnly
},
hideChannelSubscriptions: function () {
Expand Down Expand Up @@ -1143,6 +1143,10 @@ export default defineComponent({
},

checkIfPlaylist: function () {
// On the off chance that user selected pause on current video
// Then clicks on another video in the playlist
this.disablePlaylistPauseOnCurrent()

if (typeof (this.$route.query) !== 'undefined') {
this.playlistId = this.$route.query.playlistId

Expand Down Expand Up @@ -1274,6 +1278,11 @@ export default defineComponent({
return
}

if (this.watchingPlaylist && this.getPlaylistPauseOnCurrent()) {
this.disablePlaylistPauseOnCurrent()
return
}

if (this.watchingPlaylist && this.$refs.watchVideoPlaylist.shouldStopDueToPlaylistEnd) {
// Let `watchVideoPlaylist` handle end of playlist, no countdown needed
this.$refs.watchVideoPlaylist.playNextVideo()
Expand Down Expand Up @@ -1458,7 +1467,7 @@ export default defineComponent({
]
},

getAdaptiveFormatsInvidious: async function(existingInfoResult = null) {
getAdaptiveFormatsInvidious: async function (existingInfoResult = null) {
let result
if (existingInfoResult) {
result = existingInfoResult
Expand Down Expand Up @@ -1627,6 +1636,16 @@ export default defineComponent({
return this.$refs.watchVideoPlaylist ? this.$refs.watchVideoPlaylist.loopEnabled : false
},

getPlaylistPauseOnCurrent: function () {
return this.$refs.watchVideoPlaylist ? this.$refs.watchVideoPlaylist.pauseOnCurrentVideo : false
},

disablePlaylistPauseOnCurrent: function () {
if (this.$refs.watchVideoPlaylist) {
this.$refs.watchVideoPlaylist.pauseOnCurrentVideo = false
}
},

updateTitle: function () {
document.title = `${this.videoTitle} - FreeTube`
},
Expand Down

0 comments on commit bcd6081

Please sign in to comment.