Disable autoplay on embedded viewers
This commit is contained in:
@@ -50,6 +50,7 @@ maintenance_mode = false
|
||||
|
||||
// Init initializes the Pixeldrain Web UI controllers
|
||||
func Init(r *httprouter.Router, prefix string, setLogLevel bool) {
|
||||
log.Colours = true
|
||||
log.Info("Starting web UI server (PID %v)", os.Getpid())
|
||||
|
||||
// Seed the RNG
|
||||
|
@@ -17,10 +17,12 @@ function AudioViewer(viewer, file, next) {
|
||||
this.container.appendChild(document.createElement("br"))
|
||||
|
||||
this.element = document.createElement("audio")
|
||||
this.element.autoplay = "autoplay"
|
||||
this.element.controls = "controls"
|
||||
this.element.style.width = "90%"
|
||||
this.element.addEventListener("ended", () => { this.next() }, false)
|
||||
if (!embeddedViewer) {
|
||||
this.element.autoplay = "autoplay"
|
||||
}
|
||||
|
||||
this.source = document.createElement("source")
|
||||
this.source.src = this.file.get_href
|
||||
|
@@ -7,10 +7,12 @@ function VideoViewer(viewer, file, next) {
|
||||
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
|
||||
|
@@ -152,7 +152,7 @@ func (wc *WebController) loginForm(td *TemplateData, r *http.Request) (f Form) {
|
||||
f.FieldVal("username"),
|
||||
f.FieldVal("password"),
|
||||
); err != nil {
|
||||
log.Error("Error while logging in: %s", err)
|
||||
log.Debug("Login failed: %s", err)
|
||||
formAPIError(err, &f)
|
||||
} else {
|
||||
// Request was a success
|
||||
|
Reference in New Issue
Block a user