Skip to content

Commit

Permalink
proper var parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
NeloBlivion authored Sep 29, 2023
1 parent ed211c2 commit 00b797a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
6 changes: 6 additions & 0 deletions src/components/media/SongFrame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
modestbranding: 1,
rel: 0,
cc_load_policy: 0,
cc_lang_pref: getLang,
iv_load_policy: 3,
}"
v-on="$listeners"
Expand All @@ -30,6 +31,7 @@

<script lang="ts">
import Youtube from "@/components/player/YoutubePlayer.vue";
import { langConversion } from "@/utils/consts";
export default {
name: "SongFrame",
Expand Down Expand Up @@ -58,6 +60,10 @@ export default {
containerClass() {
return this.isBackground ? "song-player-container-background" : "song-player-container";
},
getLang() {
const lang = this.$store.state.settings.lang;
return langConversion[lang] || lang;
},
},
watch: {
playback: {
Expand Down
6 changes: 6 additions & 0 deletions src/components/multiview/VideoCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
:video-id="cellContent.id"
:player-vars="{
playsinline: 1,
cc_lang_pref: getLang,
}"
:mute="muted"
manual-update
Expand Down Expand Up @@ -58,6 +59,7 @@

<script>
import { mapMutations } from "vuex";
import { langConversion } from "@/utils/consts";
import YoutubePlayer from "../player/YoutubePlayer.vue";
import CellMixin from "./CellMixin";
import CellControl from "./CellControl.vue";
Expand Down Expand Up @@ -123,6 +125,10 @@ export default {
isFastFoward() {
return this.playbackRate !== 1;
},
getLang() {
const lang = this.$store.state.settings.lang;
return langConversion[lang] || lang;
},
},
watch: {
cellContent(nw, old) {
Expand Down
6 changes: 0 additions & 6 deletions src/components/player/YoutubePlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<script>
import player from "youtube-player";
import PlayerMixin from "./PlayerMixin";
import langConversion from "@/utils/consts";
const UNSTARTED = -1;
const ENDED = 0;
Expand Down Expand Up @@ -65,7 +64,6 @@ export default {
videoId: this.videoId,
playerVars: this.playerVars,
origin: window.origin,
"cc_lang_pref": this.getLang(),
});
this.player.on("ready", (e) => this.playerReady(e.target));
Expand Down Expand Up @@ -119,10 +117,6 @@ export default {
isMuted() {
return this.player.isMuted();
},
getLang() {
const lang = this.$store.state.settings.lang;
return langConversion[lang] || lang;
},
seekTo(t) {
this.player.seekTo(t);
},
Expand Down
5 changes: 5 additions & 0 deletions src/views/EditVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
...(timeOffset && { start: timeOffset }),
autoplay: 1,
playsinline: 1,
cc_lang_pref: getLang,
}"
@ready="ready"
/>
Expand Down Expand Up @@ -249,6 +250,10 @@ export default {
role() {
return this.$store.state.userdata?.user?.role;
},
getLang() {
const lang = this.$store.state.settings.lang;
return langConversion[lang] || lang;
},
},
watch: {
// eslint-disable-next-line func-names
Expand Down
6 changes: 6 additions & 0 deletions src/views/Watch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
...(timeOffset && { start: timeOffset }),
autoplay: isPlaylist ? 1 : 0,
playsinline: 1,
cc_lang_pref: getLang,
}"
@ready="ready"
@playing="playing"
Expand Down Expand Up @@ -175,6 +176,7 @@ import WatchHighlights from "@/components/watch/WatchHighlights.vue";
import WatchToolBar from "@/components/watch/WatchToolbar.vue";
import WatchComments from "@/components/watch/WatchComments.vue";
import UploadScript from "@/components/tlscriptmanager/UploadScript.vue";
import { langConversion } from "@/utils/consts";
import { decodeHTMLEntities, syncState } from "@/utils/functions";
import { mapState } from "vuex";
import { mdiOpenInNew, mdiDockLeft, mdiThumbUp } from "@mdi/js";
Expand Down Expand Up @@ -272,6 +274,10 @@ export default {
showUpload() {
return this.$store.state.uploadPanel;
},
getLang() {
const lang = this.$store.state.settings.lang;
return langConversion[lang] || lang;
},
},
watch: {
// eslint-disable-next-line func-names
Expand Down

0 comments on commit 00b797a

Please sign in to comment.