also exit fullscreen when going back to prior video

This commit is contained in:
Ethan 2022-03-23 10:21:02 -05:00
parent 1937edeef7
commit 419f09d098
1 changed files with 3 additions and 1 deletions

View File

@ -189,11 +189,13 @@ export default {
},
watch: {
// Watch for change in the route query string (in this case, ?v=xxxxxxxx to ?v=yyyyyyyy)
// When change is detected, reset and run getVideo function again
$route: {
deep: true,
handler(newRt, oldRt) {
if (newRt.query.v != oldRt.query.v) {
// Exit fullscreen if currently in fullscreen
this.$refs.player.webkitExitFullscreen();
// Reset player and run getVideo function again
this.vidSrc = "";
this.getVideo();
}