Address suggestions from #27

This commit is contained in:
dragongoose 2023-09-08 22:23:33 -04:00
parent cab9113509
commit dc58e60add
No known key found for this signature in database
GPG Key ID: 01397EEC371CDAA5
6 changed files with 23 additions and 10 deletions

View File

@ -6,6 +6,7 @@
<script lang="ts"> <script lang="ts">
// Importing video-js // Importing video-js
import Hls from 'hls.js' import Hls from 'hls.js'
import { getSetting } from '@/settingsManager'
export default { export default {
name: 'VideoJsPlayer', name: 'VideoJsPlayer',
@ -52,7 +53,9 @@ export default {
hls.loadSource(this.audioOnlyManifest || ""); hls.loadSource(this.audioOnlyManifest || "");
hls.attachMedia(video); hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, () => { hls.on(Hls.Events.MANIFEST_PARSED, () => {
video.play(); if(getSetting("autoplay")) {
video.play();
}
}); });
} }
} }

@ -1 +1 @@
Subproject commit 898c2d31e71f1962e8be067287055b50c960ec34 Subproject commit 7327c0e819101f55885acde77512a5bf8eee2761

View File

@ -42,6 +42,11 @@ export function getDefaultSettings() {
name: 'streamerAboutSectionVisible', name: 'streamerAboutSectionVisible',
selected: true, selected: true,
type: 'checkbox' type: 'checkbox'
},
autoplay: {
name: 'autoplay',
selected: false,
type: 'checkbox'
} }
} }
} }

View File

@ -22,7 +22,9 @@ export default {
const settings = JSON.stringify(this.settings) const settings = JSON.stringify(this.settings)
localStorage.setItem('settings', settings) localStorage.setItem('settings', settings)
setLanguage(this.settings.language.selected, this.$i18n) setLanguage(this.settings.language.selected, this.$i18n)
window.location.reload()
// Reload needed
location.href = "/"
} }
// download() { // download() {
// var hiddenElement = document.createElement('a'); // var hiddenElement = document.createElement('a');

View File

@ -23,7 +23,7 @@ export default {
const status = ref<'ok' | 'error'>() const status = ref<'ok' | 'error'>()
const rootBackendUrl = inject('rootBackendUrl') const rootBackendUrl = inject('rootBackendUrl')
const videoOptions = { const videoOptions = {
autoplay: true, autoplay: getSetting("autoplay"),
controls: true, controls: true,
sources: [ sources: [
{ {
@ -71,7 +71,8 @@ export default {
methods: { methods: {
truncate, truncate,
abbreviate, abbreviate,
chatVisible chatVisible,
getSetting
} }
} }
</script> </script>
@ -144,6 +145,7 @@ export default {
<div v-else class="w-full"> <div v-else class="w-full">
<ul <ul
class="text-xs font-bold text-left md:text-right space-x-1 space-y-1 overflow-y-auto" class="text-xs font-bold text-left md:text-right space-x-1 space-y-1 overflow-y-auto"
v-if="getSetting('streamTagsVisible')"
> >
<li <li
v-for="tag in data.stream!.tags" v-for="tag in data.stream!.tags"
@ -168,7 +170,7 @@ export default {
<video-tab class="mb-4"></video-tab> <video-tab class="mb-4"></video-tab>
<!-- ABOUT TAB --> <!-- ABOUT TAB -->
<div class="bg-ctp-mantle mt-1 p-5 pt-3 rounded-lg w-full space-y-3"> <div v-if="getSetting('streamerAboutSectionVisible')" class="bg-ctp-mantle mt-1 p-5 pt-3 rounded-lg w-full space-y-3">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<span class="pr-3 font-bold text-3xl">{{ $t('streamer.about') }}</span> <span class="pr-3 font-bold text-3xl">{{ $t('streamer.about') }}</span>
</div> </div>

View File

@ -10,7 +10,7 @@ import LoadingScreen from '@/components/LoadingScreen.vue'
import type { Video } from '@/types' import type { Video } from '@/types'
import { truncate, abbreviate, getEndpoint } from '@/mixins' import { truncate, abbreviate, getEndpoint } from '@/mixins'
import { chatVisible } from '@/settingsManager' import { chatVisible, getSetting } from '@/settingsManager'
interface ChatComponent { interface ChatComponent {
updateVodComments: (time: number) => void updateVodComments: (time: number) => void
@ -68,7 +68,8 @@ export default {
const chat = this.$refs.chat as ChatComponent const chat = this.$refs.chat as ChatComponent
chat.updateVodComments(time) chat.updateVodComments(time)
}, },
chatVisible chatVisible,
getSetting
} }
} }
</script> </script>
@ -118,7 +119,7 @@ export default {
</div> </div>
<!-- ABOUT TAB --> <!-- ABOUT TAB -->
<div class="bg-ctp-mantle mt-1 p-5 pt-3 rounded-lg w-full space-y-3"> <div v-if="getSetting('streamerAboutSectionVisible')" class="bg-ctp-mantle mt-1 p-5 pt-3 rounded-lg w-full space-y-3">
<div class="inline-flex w-full"> <div class="inline-flex w-full">
<span class="pr-3 font-bold text-3xl">{{ $t('streamer.about') }}</span> <span class="pr-3 font-bold text-3xl">{{ $t('streamer.about') }}</span>
</div> </div>
@ -139,7 +140,7 @@ export default {
</div> </div>
<twitch-chat <twitch-chat
v-if="chatVisible()" v-if="getSetting('chatVisible')"
:isVod="true" :isVod="true"
:channelName="data.streamer.login" :channelName="data.streamer.login"
ref="chat" ref="chat"