From 22fc6f746fbfe687bb86eb1494a31f5882f8cb62 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Thu, 6 Dec 2018 21:26:35 +0100 Subject: [PATCH] Fix images --- openlp/core/display/html/display.js | 8 ++++---- openlp/core/display/window.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openlp/core/display/html/display.js b/openlp/core/display/html/display.js index af7f08453..aafdf7cb3 100644 --- a/openlp/core/display/html/display.js +++ b/openlp/core/display/html/display.js @@ -425,7 +425,7 @@ var Display = { }, /** * Set image slides - * @param {Object[]} slides - A list of images to add as JS objects [{"filename": "url/to/file"}] + * @param {Object[]} slides - A list of images to add as JS objects [{"path": "url/to/file"}] */ setImageSlides: function (slides) { Display.clearSlides(); @@ -435,7 +435,7 @@ var Display = { section.setAttribute("id", index); section.setAttribute("data-background", "#000"); var img = document.createElement('img'); - img.src = slide["filename"]; + img.src = slide["path"]; img.setAttribute("style", "height: 100%; width: 100%;"); section.appendChild(img); slidesDiv.appendChild(section); @@ -445,14 +445,14 @@ var Display = { }, /** * Set a video - * @param {Object} video - The video to show as a JS object: {"filename": "url/to/file"} + * @param {Object} video - The video to show as a JS object: {"path": "url/to/file"} */ setVideo: function (video) { this.clearSlides(); var section = document.createElement("section"); section.setAttribute("data-background", "#000"); var videoElement = document.createElement("video"); - videoElement.src = video["filename"]; + videoElement.src = video["path"]; videoElement.preload = "auto"; videoElement.setAttribute("id", "video"); videoElement.setAttribute("style", "height: 100%; width: 100%;"); diff --git a/openlp/core/display/window.py b/openlp/core/display/window.py index 84ec7418e..e8545968d 100644 --- a/openlp/core/display/window.py +++ b/openlp/core/display/window.py @@ -250,8 +250,8 @@ class DisplayWindow(QtWidgets.QWidget): Set images in the display """ for image in images: - if not image['filename'].startswith('file://'): - image['filename'] = 'file://' + image['filename'] + if not image['path'].startswith('file://'): + image['path'] = 'file://' + image['path'] json_images = json.dumps(images) self.run_javascript('Display.setImageSlides({images});'.format(images=json_images)) @@ -259,8 +259,8 @@ class DisplayWindow(QtWidgets.QWidget): """ Load video in the display """ - if not video['filename'].startswith('file://'): - video['filename'] = 'file://' + video['filename'] + if not video['path'].startswith('file://'): + video['path'] = 'file://' + video['path'] json_video = json.dumps(video) self.run_javascript('Display.setVideo({video});'.format(video=json_video))