Disable autoplay on embedded viewers
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user