aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdVideoViewer.vue
diff options
context:
space:
mode:
authorZero~Informatique2020-06-19 22:12:03 +0200
committerZero~Informatique2020-06-19 22:12:03 +0200
commit69dc0d20706ed41e5ecdbb77515066d8a7d7703b (patch)
tree8b69fcb1d4a96290134980e75281563f8b4c271e /viewer/src/components/LdVideoViewer.vue
parenta053076d692be5e3698fe1a2c071d077cb4b6b73 (diff)
downloadldgallery-69dc0d20706ed41e5ecdbb77515066d8a7d7703b.tar.gz
viewer: code update (no functional change)
Types { [x: T]: R } updated to Record<T, R> Methods in template updated to getters (computed in VueJS), which are reactive and cached Code formatting
Diffstat (limited to 'viewer/src/components/LdVideoViewer.vue')
-rw-r--r--viewer/src/components/LdVideoViewer.vue20
1 files changed, 12 insertions, 8 deletions
diff --git a/viewer/src/components/LdVideoViewer.vue b/viewer/src/components/LdVideoViewer.vue
index 49f687f..b7a7c35 100644
--- a/viewer/src/components/LdVideoViewer.vue
+++ b/viewer/src/components/LdVideoViewer.vue
@@ -21,7 +21,13 @@
21<template> 21<template>
22 <!-- intermediate container necessary to eliminate the scrollbar --> 22 <!-- intermediate container necessary to eliminate the scrollbar -->
23 <div class="fill no-scroll"> 23 <div class="fill no-scroll">
24 <video class="fill" :src="itemResourceUrl()" :poster="thumbnailResourceUrl()" preload="auto" controls> 24 <video
25 class="fill"
26 :src="itemResourceUrl"
27 :poster="thumbnailResourceUrl"
28 preload="auto"
29 controls
30 >
25 <ld-download :item="videoItem" /> 31 <ld-download :item="videoItem" />
26 </video> 32 </video>
27 </div> 33 </div>
@@ -30,21 +36,19 @@
30<script lang="ts"> 36<script lang="ts">
31import { Component, Prop, Vue } from "vue-property-decorator"; 37import { Component, Prop, Vue } from "vue-property-decorator";
32 38
33@Component export default class LdVideoViewer extends Vue { 39@Component
40export default class LdVideoViewer extends Vue {
34 @Prop({ required: true }) readonly videoItem!: Gallery.Video; 41 @Prop({ required: true }) readonly videoItem!: Gallery.Video;
35 42
36 itemResourceUrl(): string { 43 get itemResourceUrl(): string {
37 return this.$galleryStore.resourceRoot + this.videoItem.properties.resource; 44 return this.$galleryStore.resourceRoot + this.videoItem.properties.resource;
38 } 45 }
39 46
40 thumbnailResourceUrl(): string { 47 get thumbnailResourceUrl(): string {
41 return this.videoItem.thumbnail 48 return this.videoItem.thumbnail ? this.$galleryStore.resourceRoot + this.videoItem.thumbnail.resource : "";
42 ? this.$galleryStore.resourceRoot + this.videoItem.thumbnail.resource
43 : "";
44 } 49 }
45} 50}
46</script> 51</script>
47 52
48<style lang="scss" module> 53<style lang="scss" module>
49
50</style> 54</style>