Browse Source

Made EditSong not autoplay, and made station pause/resume based on the EditSong player being paused or not

Kristian Vos 3 years ago
parent
commit
e4578d53dd

+ 1 - 8
frontend/src/components/modals/EditSong.vue

@@ -683,7 +683,6 @@ export default {
 				// if (this.song.discogs === undefined)
 				// 	this.song.discogs = null;
 				this.editSong(song);
-				console.log(song);
 
 				this.songDataLoaded = true;
 
@@ -731,7 +730,7 @@ export default {
 						iv_load_policy: 3,
 						rel: 0,
 						showinfo: 0,
-						autoplay: 1
+						autoplay: 0
 					},
 					startSeconds: this.song.skipDuration,
 					events: {
@@ -740,7 +739,6 @@ export default {
 								localStorage.getItem("volume")
 							);
 							volume = typeof volume === "number" ? volume : 20;
-							this.video.player.seekTo(this.song.skipDuration);
 							this.video.player.setVolume(volume);
 							if (volume > 0) this.video.player.unMute();
 
@@ -765,11 +763,6 @@ export default {
 							}
 
 							if (event.data === 1 && !skipToLast10SecsPressed) {
-								if (!this.video.autoPlayed) {
-									this.video.autoPlayed = true;
-									return this.video.player.stopVideo();
-								}
-
 								this.video.paused = false;
 								let youtubeDuration = this.video.player.getDuration();
 								const newYoutubeVideoDuration = youtubeDuration.toFixed(

+ 2 - 2
frontend/src/pages/Admin/tabs/VerifiedSongs.vue

@@ -224,9 +224,9 @@
 					<div>
 						<span class="bigger"><b>Modal control</b></span>
 						<span><b>Ctrl + S</b> - Save</span>
-						<span><b>Ctrl + Shift + S</b> - Save and close</span>
+						<span><b>Ctrl + Alt + S</b> - Save and close</span>
 						<span
-							><b>Ctrl + Shift + V</b> - Save, verify and
+							><b>Ctrl + Alt + V</b> - Save, verify and
 							close</span
 						>
 						<span><b>F4</b> - Close without saving</span>

+ 9 - 5
frontend/src/pages/Station/index.vue

@@ -701,6 +701,9 @@ export default {
 		...mapState("modalVisibility", {
 			modals: state => state.modals
 		}),
+		...mapState("modals/editSong", {
+			video: state => state.video
+		}),
 		...mapState("station", {
 			station: state => state.station,
 			currentSong: state => state.currentSong,
@@ -730,13 +733,14 @@ export default {
 		});
 
 		this.editSongModalWatcher = this.$store.watch(
-			state => state.modalVisibility.modals.editSong,
-			newValue => {
-				if (newValue === true) {
+			state => state.modals.editSong.video.paused,
+			paused => {
+				if (paused && !this.beforeEditSongModalLocalPaused) {
+					this.resumeLocalStation();
+				} else if (!paused) {
 					this.beforeEditSongModalLocalPaused = this.localPaused;
 					this.pauseLocalStation();
-				} else if (!this.beforeEditSongModalLocalPaused)
-					this.resumeLocalStation();
+				}
 			}
 		);