Added some settings

This commit is contained in:
booploops 2021-12-24 23:46:39 -08:00
parent cbb6824ff4
commit 489340f237
8 changed files with 114 additions and 103 deletions

View file

@ -9,10 +9,27 @@
<script>
Vue.component('animatedartwork-view', {
template: '#animatedartwork-view',
props: ['video', 'hls'],
props: {
video: {
type: String,
required: true
},
hls: {
type: Object,
default: ''
},
priority: {
type: Boolean,
default: false
}
},
async mounted() {
if(!this.priority && app.cfg.visual.animated_artwork == "limited") {
return
}else if(app.cfg.visual.animated_artwork == "disabled") {
return
}
if (this.video) {
this.$nextTick(function () {
var config = {
backBufferLength: 0,
@ -21,7 +38,6 @@
emeEnabled: false,
abrEwmaDefaultEstimate: 10000,
testBandwidth: false,
capLevelToPlayerSize: true
};
if (this.hls) {
this.hls.detachMedia();

View file

@ -12,8 +12,8 @@
<img :src="app.getMediaItemArtwork(url, size, width)"
decoding="async"
class="mediaitem-artwork--img">
<div v-if="video && isVisible" class="animatedartwork-view-box">
<animatedartwork-view :video="video"></animatedartwork-view>
<div v-if="video && isVisible && getVideoPriority()" class="animatedartwork-view-box">
<animatedartwork-view :priority="getVideoPriority()" :video="video"></animatedartwork-view>
</div>
</div>
</template>
@ -43,6 +43,10 @@
type: String,
required: false
},
videoPriority: {
type: Boolean,
required: false
},
shadow: {
type: String,
default: 'none'
@ -57,16 +61,26 @@
}
},
methods: {
getVideoPriority() {
if(app.cfg.visual.animated_artwork == "always") {
return true;
}else if (this.videoPriority && app.cfg.visual.animated_artwork == "limited") {
return true
} else if (app.cfg.visual.animated_artwork == "disabled") {
return false
}
return this.videoPriority
},
getStyle() {
switch(this.shadow) {
switch (this.shadow) {
case "large":
this.style["box-shadow"] = "var(--mediaItemShadow-Shadow)"
break;
break;
case "subtle":
this.style["box-shadow"] = "var(--mediaItemShadow-ShadowSubtle)"
break;
break;
default:
break;
break;
}
return this.style;
},