diff --git a/public/app.js b/public/app.js index 5fbac36..b58c891 100644 --- a/public/app.js +++ b/public/app.js @@ -5,7 +5,8 @@ new Vue({ index: 0, interval: null, carouselTimeout: 20000, - carouselActive: true + carouselActive: true, + videoSrc: null, }, methods: { next: function () { @@ -14,6 +15,13 @@ new Vue({ } else { this.index = 0; } + // force video src reload + this.videoSrc = null; + setTimeout(() => { + if (this.files[this.index].mime.includes('video')) { + this.videoSrc = '/files/'+this.files[this.index].basename; + } + }, 100) }, nextClick: function () { this.next(); @@ -25,6 +33,12 @@ new Vue({ } else { this.index = this.files.length - 1; } + // force video src reload + setTimeout(() => { + if (this.files[this.index].mime.includes('video')) { + this.videoSrc = '/files/'+this.files[this.index].basename; + } + }, 100) }, prevClick: function () { this.next(); diff --git a/public/index.html b/public/index.html index 1bfb0fc..a791bdb 100644 --- a/public/index.html +++ b/public/index.html @@ -23,8 +23,8 @@ -