Просмотр исходного кода

fix(EditSong): when picking a different YouTube ID, video player should be reloaded

Jonathan Graham 3 лет назад
Родитель
Сommit
04e68cbdee
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      frontend/src/store/modules/modals/editSong.js

+ 2 - 0
frontend/src/store/modules/modals/editSong.js

@@ -37,6 +37,7 @@ export default {
 			commit("resolveReport", reportId),
 		updateYoutubeId: ({ commit }, youtubeId) => {
 			commit("updateYoutubeId", youtubeId);
+			commit("loadVideoById", youtubeId, 0);
 		}
 	},
 	mutations: {
@@ -52,6 +53,7 @@ export default {
 			state.video.player.stopVideo();
 		},
 		loadVideoById(state, id, skipDuration) {
+			state.song.duration = -1;
 			state.video.player.loadVideoById(id, skipDuration);
 		},
 		pauseVideo(state, status) {