Bind mediafile to projector scope (fixes #2706)

This commit is contained in:
Maximilian Krambach 2016-12-29 11:37:56 +01:00
parent 5fe902afed
commit 912dc1af8f

View File

@ -21,15 +21,14 @@ angular.module('OpenSlidesApp.mediafiles.projector', [
'Mediafile', 'Mediafile',
function ($scope, Mediafile) { function ($scope, Mediafile) {
// load mediafile object // load mediafile object
var mediafile = Mediafile.get($scope.element.id); Mediafile.bindOne($scope.element.id, $scope, 'mediafile');
$scope.mediafile = mediafile;
// Allow the elements to render properly // Allow the elements to render properly
setTimeout(function() { setTimeout(function() {
if ($scope.mediafile) { if ($scope.mediafile) {
if ($scope.mediafile.is_pdf) { if ($scope.mediafile.is_pdf) {
$scope.pdfName = mediafile.title; $scope.pdfName = $scope.mediafile.title;
$scope.pdfUrl = mediafile.mediafileUrl; $scope.pdfUrl = $scope.mediafile.mediafileUrl;
} else if ($scope.mediafile.is_video) { } else if ($scope.mediafile.is_video) {
var player = angular.element.find('#video-player')[0]; var player = angular.element.find('#video-player')[0];
if ($scope.element.playing) { if ($scope.element.playing) {