From aacfb6adf61f8827f6848688f2bab55412802ada Mon Sep 17 00:00:00 2001 From: "T. Adams" Date: Thu, 26 Mar 2015 00:13:35 -0700 Subject: [PATCH 1/2] Add poster image to video player --- dashboard-ui/scripts/mediaplayer-video.js | 29 +++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 0f07dce333..bdd4151c34 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -1102,6 +1102,31 @@ })) + seekParam; + // Get Video Poster (Code from librarybrowser.js) + var screenWidth = Math.max(screen.height, screen.width), + posterUrl; + + if (item.BackdropImageTags && item.BackdropImageTags.length) { + + posterUrl = ApiClient.getScaledImageUrl(item.Id, { + type: "Backdrop", + index: 0, + maxWidth: screenWidth, + tag: item.BackdropImageTags[0] + }); + + } + else if (item.ParentBackdropItemId && item.ParentBackdropImageTags && item.ParentBackdropImageTags.length) { + + posterUrl = ApiClient.getScaledImageUrl(item.ParentBackdropItemId, { + type: 'Backdrop', + index: 0, + maxWidth: screenWidth, + tag: item.ParentBackdropImageTags[0] + }); + + } + //======================================================================================> // Create video player @@ -1111,11 +1136,11 @@ // Can't autoplay in these browsers so we need to use the full controls if (requiresNativeControls) { - html += '