From bc312efbb911b6bd7ba9e291f06bd05f9c07a924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Wed, 30 Nov 2016 22:26:11 +0100 Subject: [PATCH] Fix JS error after project pdf file. --- .../static/js/mediafiles/projector.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/openslides/mediafiles/static/js/mediafiles/projector.js b/openslides/mediafiles/static/js/mediafiles/projector.js index 784c0240b..fc0ce9a91 100644 --- a/openslides/mediafiles/static/js/mediafiles/projector.js +++ b/openslides/mediafiles/static/js/mediafiles/projector.js @@ -23,15 +23,17 @@ angular.module('OpenSlidesApp.mediafiles.projector', ['OpenSlidesApp.mediafiles' // Allow the elements to render properly setTimeout(function() { - if ($scope.mediafile.is_pdf) { - $scope.pdfName = mediafile.title; - $scope.pdfUrl = mediafile.mediafileUrl; - } else if ($scope.mediafile.is_video) { - var player = angular.element.find('#video-player')[0]; - if ($scope.element.playing) { - player.play(); - } else { - player.pause(); + if ($scope.mediafile) { + if ($scope.mediafile.is_pdf) { + $scope.pdfName = mediafile.title; + $scope.pdfUrl = mediafile.mediafileUrl; + } else if ($scope.mediafile.is_video) { + var player = angular.element.find('#video-player')[0]; + if ($scope.element.playing) { + player.play(); + } else { + player.pause(); + } } } }, 0);