diff --git a/static/pdf.js/links.js b/static/pdf.js/links.js index 108269cd9..88944d90a 100644 --- a/static/pdf.js/links.js +++ b/static/pdf.js/links.js @@ -24,21 +24,23 @@ function getEmbedURL(id, videoURL) { + '&in=' + inPoint + '&out=' + outPoint + '&paused=false&showCloseButton=true'; } - function getVideoOverlay(page) { - return (editable || links[page]) ? { + var links = embeds.filter(function(embed) { + return embed.page == page && embed.type =='inline'; + }); + return (editable || links.length) ? { beginLayout: function() { this.counter = 0; - //console.log('lets beging'); }, endLayout: function() { - //console.log('lets end it here'); }, appendImage: function(image) { var id = ++this.counter, - hasVideo = links[page] && links[page][id], + video = links.filter(function(embed) { + return embed.id == id; + })[0], $interface, $playButton, $editButton; - if (editable || hasVideo) { + if (editable || video) { $interface = Ox.$('
') .addClass('interface') .css({ @@ -66,7 +68,7 @@ function getVideoOverlay(page) { if (editable) { $editButton.show(); } - if (hasVideo) { + if (video) { enableVideoUI(); } this.div.appendChild($interface[0]); @@ -78,7 +80,7 @@ function getVideoOverlay(page) { $iframe = Ox.$('