diff --git a/dashboard-ui/css/mediaplayer-video.css b/dashboard-ui/css/mediaplayer-video.css index 07f4df2cd5..a576ccd523 100644 --- a/dashboard-ui/css/mediaplayer-video.css +++ b/dashboard-ui/css/mediaplayer-video.css @@ -357,10 +357,6 @@ } } -.cursor-active { - cursor: default; -} - .cursor-inactive { cursor: none; } diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 3121e13caf..7b77f84180 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -870,7 +870,7 @@ progress { left: 0; right: 0; bottom: 0; - border-radius: 3px; + border-radius: 2px; } .sessionNowPlayingInnerContent { @@ -882,7 +882,7 @@ progress { bottom: 0; color: #fff; font-weight: 400; - border-radius: 3px; + border-radius: 2px; } .sessionAppInfo { @@ -931,6 +931,7 @@ progress { height: 7px; width: 100%; opacity: .95; + z-index: 1000; } .notPlayingSession .sessionNowPlayingContent { diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js index cd9dbf813c..6dad826191 100644 --- a/dashboard-ui/scripts/dashboardpage.js +++ b/dashboard-ui/scripts/dashboardpage.js @@ -211,7 +211,7 @@ var className = nowPlayingItem ? 'activeSession' : 'notPlayingSession activeSession'; - html += ''; + html += '
'; html += '
'; + html += '
' + DashboardPage.getAppSecondaryText(connection) + '
'; html += '
'; html += '
'; @@ -256,9 +257,14 @@ html += ''; - html += '
'; if (nowPlayingItem) { - html += DashboardPage.getNowPlayingName(connection); + + var nowPlayingName = DashboardPage.getNowPlayingName(connection); + + html += '
'; + html += nowPlayingName.html; + } else { + html += '
'; } html += '
'; @@ -273,35 +279,39 @@ } html += '
'; - html += '
'; + + html += '
'; + + html += '
'; } - parentElement.append(html).trigger('create'); + parentElement.append(html).createSessionItemMenus().trigger('create'); $('.deadSession', parentElement).remove(); }, + getAppSecondaryText: function (session) { + + return session.ApplicationVersion; + }, + getNowPlayingName: function (session) { + var imgUrl = ''; + var nowPlayingItem = session.NowPlayingItem; if (!nowPlayingItem) { - return 'Last seen ' + humane_date(session.LastActivityDate); + return { + html: 'Last seen ' + humane_date(session.LastActivityDate), + image: imgUrl + }; } var topText = nowPlayingItem.Name; - if (nowPlayingItem.MediaType == 'Video') { - if (nowPlayingItem.IndexNumber != null) { - topText = nowPlayingItem.IndexNumber + " - " + topText; - } - if (nowPlayingItem.ParentIndexNumber != null) { - topText = nowPlayingItem.ParentIndexNumber + "." + topText; - } - } - var bottomText = ''; if (nowPlayingItem.Artists && nowPlayingItem.Artists.length) { @@ -316,8 +326,40 @@ bottomText = nowPlayingItem.ProductionYear; } - return bottomText ? topText + '
' + bottomText : topText; + if (nowPlayingItem.LogoItemId) { + imgUrl = ApiClient.getImageUrl(nowPlayingItem.LogoItemId, { + + tag: session.LogoImageTag, + height: 48, + type: 'Logo' + + }); + + topText = ''; + } + + var text = bottomText ? topText + '
' + bottomText : topText; + + return { + html: text, + image: imgUrl + }; + + //var playstate = session.PlayState; + + //if (playstate) { + + // if (playstate.PlayMethod == 'DirectPlay') { + // return 'Direct playing'; + // } + // if (playstate.PlayMethod == 'DirectStream') { + // return 'Direct streaming'; + // } + // if (playstate.PlayMethod == 'Transcode') { + // text = text + '
Transcoding
'; + // } + //} }, getUsersHtml: function (session) { @@ -365,8 +407,16 @@ $('.sessionUserName', row).html(DashboardPage.getUsersHtml(session)); - $('.sessionNowPlayingInfo', row).html(DashboardPage.getNowPlayingName(session)); + $('.sessionAppSecondaryText', row).html(DashboardPage.getAppSecondaryText(session)); + var nowPlayingName = DashboardPage.getNowPlayingName(session); + var nowPlayingInfoElem = $('.sessionNowPlayingInfo', row); + + if (!nowPlayingName.image || nowPlayingName.image != nowPlayingInfoElem.attr('data-imgsrc')) { + nowPlayingInfoElem.html(nowPlayingName.html); + nowPlayingInfoElem.attr('data-imgsrc', nowPlayingName.image || ''); + } + if (nowPlayingItem && nowPlayingItem.RunTimeTicks) { var position = session.PlayState.PositionTicks || 0; @@ -754,4 +804,81 @@ } }; -$(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pagehide', "#dashboardPage", DashboardPage.onPageHide); \ No newline at end of file +$(document).on('pageshow', "#dashboardPage", DashboardPage.onPageShow).on('pagehide', "#dashboardPage", DashboardPage.onPageHide); + +(function ($, document, window) { + + var showOverlayTimeout; + + function onHoverOut() { + + if (showOverlayTimeout) { + clearTimeout(showOverlayTimeout); + showOverlayTimeout = null; + } + + $('.posterItemOverlayTarget:visible', this).each(function () { + + var elem = this; + + $(this).animate({ "height": "0" }, "fast", function () { + + $(elem).hide(); + + }); + + }); + + $('.posterItemOverlayTarget:visible', this).stop().animate({ "height": "0" }, function () { + + $(this).hide(); + + }); + } + + $.fn.createSessionItemMenus = function () { + + function onShowTimerExpired(elem) { + + if ($('.itemSelectionPanel:visible', elem).length) { + return; + } + + var innerElem = $('.posterItemOverlayTarget', elem); + + innerElem.show().each(function () { + + this.style.height = 0; + + }).animate({ "height": "100%" }, "fast"); + } + + function onHoverIn() { + + if (showOverlayTimeout) { + clearTimeout(showOverlayTimeout); + showOverlayTimeout = null; + } + + var elem = this; + + showOverlayTimeout = setTimeout(function () { + + onShowTimerExpired(elem); + + }, 1000); + } + + // https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/ + + if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) { + /* browser with either Touch Events of Pointer Events + running on touch-capable device */ + return this; + } + + return this.off('.sessionItemMenu').on('mouseenter.sessionItemMenu', '.activeSession', onHoverIn) + .on('mouseleave.sessionItemMenu', '.activeSession', onHoverOut); + }; + +})(jQuery, document, window); \ No newline at end of file diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index e6099f26fd..ec41940069 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -905,15 +905,15 @@ $('#criticReviewsContent', page).html(html).trigger('create'); } - + function renderThemeMedia(page, item) { - + ApiClient.getThemeMedia(Dashboard.getCurrentUserId(), item.Id, true).done(function (result) { var themeSongs = result.ThemeSongsResult.OwnerId == item.Id ? result.ThemeSongsResult.Items : []; - + var themeVideos = result.ThemeVideosResult.OwnerId == item.Id ? result.ThemeVideosResult.Items : []; @@ -1062,7 +1062,7 @@ var html = ''; if (version.Name && item.MediaSources.length > 1) { - html += '' + version.Name + '
'; + html += '
' + version.Name + '

'; } for (var i = 0, length = version.MediaStreams.length; i < length; i++) { @@ -1150,8 +1150,23 @@ html += ''; } + if (version.Container) { + html += '
Container' + version.Container + '
'; + } + + if (version.Formats && version.Formats.length) { + html += '
Format' + version.Formats.join(',') + '
'; + } + + if (version.Size) { + + var size = (version.Size / (1024 * 1024)).toFixed(0); + + html += '
Size' + size + ' MB
'; + } + if (version.Path) { - html += '
Path' + version.Path + ''; + html += '
Path' + version.Path + '
'; } return html; diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index 5fab7b43cf..93ecc9c6ca 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -279,8 +279,8 @@ }); } - return this.on('mouseenter', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn) - .on('mouseleave', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut); + return this.off('.posterItemHoverMenu').on('mouseenter.posterItemHoverMenu', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverIn) + .on('mouseleave.posterItemHoverMenu', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut); }; function toggleSelections(page) { diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 0db3dea06e..1ceb19fd7e 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -290,7 +290,7 @@ } if (idleState == true) { - video.removeClass("cursor-inactive").addClass("cursor-active"); + video.removeClass("cursor-inactive"); videoControls.removeClass("inactive").addClass("active"); } @@ -298,7 +298,7 @@ timeout = window.setTimeout(function () { idleState = true; - video.removeClass("cursor-active").addClass("cursor-inactive"); + video.addClass("cursor-inactive"); videoControls.removeClass("active").addClass("inactive"); }, 4000); } diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index a7503a7047..644c159477 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -1202,7 +1202,7 @@ if (stream.Type == "Audio") { // Stream statically when possible - if (stream.BitRate <= 256000) { + if (stream.BitRate <= 320000) { isStatic = true; } break;