Disable autoplay on embedded viewers

This commit is contained in:
2021-03-11 18:52:55 +01:00
parent bfbea8f591
commit 2d56c9c228
4 changed files with 14 additions and 9 deletions

View File

@@ -1,16 +1,18 @@
function VideoViewer(viewer, file, next) {
this.viewer = viewer
this.file = file
this.next = next
this.file = file
this.next = next
this.vidContainer = document.createElement("div")
this.vidContainer.classList = "image-container"
this.vidElement = document.createElement("video")
this.vidElement.autoplay = "autoplay"
this.vidElement.controls = "controls"
this.vidElement.classList = "center drop_shadow"
this.vidElement.addEventListener("ended", () => { this.next() }, false)
if (!embeddedViewer) {
this.vidElement.autoplay = "autoplay"
}
this.videoSource = document.createElement("source")
this.videoSource.src = this.file.get_href
@@ -19,6 +21,6 @@ function VideoViewer(viewer, file, next) {
this.vidContainer.appendChild(this.vidElement)
}
VideoViewer.prototype.render = function(parent) {
VideoViewer.prototype.render = function (parent) {
parent.appendChild(this.vidContainer)
}