From d47d16e23520da29b4e731812a712db05d4697ca Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Fri, 8 Apr 2022 22:29:50 +0100 Subject: [PATCH] Implement play with playlists. --- src/components/PlaylistPage.vue | 6 +++- src/components/PlaylistVideos.vue | 57 +++++++++++++++++++++++++++++++ src/components/VideoItem.vue | 21 ++++++++++-- src/components/VideoPlayer.vue | 24 ++++++++++++- src/components/VideoRedirect.vue | 2 +- src/components/WatchVideo.vue | 48 ++++++++++++++++++++++++++ 6 files changed, 153 insertions(+), 5 deletions(-) create mode 100644 src/components/PlaylistVideos.vue diff --git a/src/components/PlaylistPage.vue b/src/components/PlaylistPage.vue index 8c854bfb..d2f97513 100644 --- a/src/components/PlaylistPage.vue +++ b/src/components/PlaylistPage.vue @@ -75,6 +75,7 @@ export default { }, activated() { window.addEventListener("scroll", this.handleScroll); + if (this.playlist) this.updateTitle(); }, deactivated() { window.removeEventListener("scroll", this.handleScroll); @@ -86,7 +87,10 @@ export default { async getPlaylistData() { this.fetchPlaylist() .then(data => (this.playlist = data)) - .then(() => (document.title = this.playlist.name + " - Piped")); + .then(() => this.updateTitle()); + }, + async updateTitle() { + document.title = this.playlist.name + " - Piped"; }, handleScroll() { if (this.loading || !this.playlist || !this.playlist.nextpage) return; diff --git a/src/components/PlaylistVideos.vue b/src/components/PlaylistVideos.vue new file mode 100644 index 00000000..c8374e4d --- /dev/null +++ b/src/components/PlaylistVideos.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/components/VideoItem.vue b/src/components/VideoItem.vue index 37f7a26c..56e8b499 100644 --- a/src/components/VideoItem.vue +++ b/src/components/VideoItem.vue @@ -1,6 +1,15 @@