diff --git a/dashboard-ui/css/icons.css b/dashboard-ui/css/icons.css index c2fd9d62c2..77e096d2f7 100644 --- a/dashboard-ui/css/icons.css +++ b/dashboard-ui/css/icons.css @@ -92,4 +92,11 @@ /* Fallback */ .ui-nosvg .ui-icon-subtitles:after { background-image: url("images/icons/subtitles.png"); +} +.ui-icon-tv:after { + background-image: url("images/icons/tv.png"); +} +/* Fallback */ +.ui-nosvg .ui-icon-tv:after { + background-image: url("images/icons/tv.png"); } \ No newline at end of file diff --git a/dashboard-ui/css/images/icons/tv.png b/dashboard-ui/css/images/icons/tv.png new file mode 100644 index 0000000000..e8fe67ac7e Binary files /dev/null and b/dashboard-ui/css/images/icons/tv.png differ diff --git a/dashboard-ui/css/images/media/tvflyout.png b/dashboard-ui/css/images/media/tvflyout.png new file mode 100644 index 0000000000..af467a9de8 Binary files /dev/null and b/dashboard-ui/css/images/media/tvflyout.png differ diff --git a/dashboard-ui/dashboard.html b/dashboard-ui/dashboard.html index 304b4d25ff..34b4094a8a 100644 --- a/dashboard-ui/dashboard.html +++ b/dashboard-ui/dashboard.html @@ -24,7 +24,7 @@

A new version of Media Browser Server is available!

- +
Please shutdown the server and update manually. diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 19410ce272..b308e6a145 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -564,6 +564,9 @@ if (item.Type == "Channel") { return "livetvchannel.html?id=" + id; } + if (item.Type == "Program") { + return "livetvprogram.html?id=" + id; + } if (item.Type == "Series") { return "itemdetails.html?id=" + id; } @@ -599,9 +602,7 @@ } if (item.Type == "MusicArtist") { - if (itemByNameContext == "music") { - return "itembynamedetails.html?musicartist=" + ApiClient.encodeName(item.Name) + "&context=" + (itemByNameContext || "music"); - } + return "itembynamedetails.html?musicartist=" + ApiClient.encodeName(item.Name) + "&context=" + (itemByNameContext || "music"); } return item.IsFolder ? (id ? "itemlist.html?parentId=" + id : "#") : "itemdetails.html?id=" + id; diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 268c460eac..d5ac238e38 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -24,6 +24,7 @@ self.playlist = []; var currentPlaylistIndex = 0; + var channelsList; function requestFullScreen(element) { // Supports most browsers and their versions. @@ -35,7 +36,7 @@ $('.itemVideo').addClass('fullscreenVideo'); } } - + function exitFullScreen() { if (document.exitFullscreen) { document.exitFullscreen(); @@ -283,6 +284,16 @@ hideFlyout($('#qualityFlyout')); }); + + $('#channelsFlyout').on('click', '.mediaFlyoutOption', function () { + + if (!$(this).hasClass('selectedMediaFlyoutOption')) { + var channelId = this.getAttribute('data-channelid'); + self.playById(channelId, 'Channel'); + } + + hideFlyout($('#channelsFlyout')); + }); }); function endsWith(text, pattern) { @@ -312,7 +323,7 @@ positionSlider.val(percent).slider('enable').slider('refresh'); } } else { - positionSlider.slider('disable'); + positionSlider.slider('disable').slider('refresh'); } currentTimeElement.html(timeText); @@ -389,6 +400,7 @@ $('#audioTracksButton', nowPlayingBar).hide(); $('#subtitleButton', nowPlayingBar).hide(); $('#chaptersButton', nowPlayingBar).hide(); + $('#channelsButton', nowPlayingBar).hide(); $('#mediaElement', nowPlayingBar).html(html); var audioElement = $("audio", nowPlayingBar); @@ -485,7 +497,7 @@ else if (videoStream.Width >= 720) { baseParams.videoBitrate = 700000; } - + if ((videoStream.Codec || '').toLowerCase().indexOf('h264') != -1) { } @@ -583,6 +595,8 @@ $('#fullscreenButton', nowPlayingBar).show(); } + var channelsButton = $('#channelsButton', nowPlayingBar).hide(); + var videoElement = $("video", nowPlayingBar); var initialVolume = localStorage.getItem("volume") || 0.5; @@ -641,6 +655,22 @@ currentItem = item; curentDurationTicks = item.RunTimeTicks; + if (!channelsList) { + + ApiClient.getLiveTvChannels({ + + userId: Dashboard.getCurrentUserId() + + }).done(function (result) { + + channelsList = result.Items; + + if (result.Items.length) { + channelsButton.show(); + } + }); + } + return videoElement[0]; }; @@ -919,13 +949,24 @@ tag: item.ImageTags.Thumb }); - } else { + } + else if (item.Type == "Channel" || item.Type == "Recording") { + url = "css/images/items/detail/tv.png"; + } + else if (item.MediaType == "Audio") { + url = "css/images/items/detail/audio.png"; + } + else { url = "css/images/items/detail/video.png"; } var name = item.Name; var seriesName = ''; + // Channel number + if (item.Number) { + name = item.Number + ' ' + name; + } if (item.IndexNumber != null) { name = item.IndexNumber + " - " + name; } @@ -935,10 +976,15 @@ if (item.SeriesName || item.Album || item.ProductionYear) { seriesName = item.SeriesName || item.Album || item.ProductionYear; } + if (item.CurrentProgram) { + seriesName = item.CurrentProgram.Name; + } - html += "
"; + var href = LibraryBrowser.getHref(item.CurrentProgram || item); - if (item.SeriesName || item.Album) { + html += "
"; + + if (item.SeriesName || item.Album || item.CurrentProgram) { html += '
' + seriesName + '
' + name + '
'; } else { html += '
' + name + '
' + seriesName + '
'; @@ -1340,7 +1386,9 @@ }; function hideFlyout(flyout) { + flyout.hide().empty(); + $(document.body).off("mousedown.hidesearchhints"); } @@ -1579,8 +1627,8 @@ var html = ''; - var videoStream = item.MediaStreams.filter(function (i) { - return i.Type == "Video"; + var videoStream = (item.MediaStreams || []).filter(function (stream) { + return stream.Type == "Video"; })[0]; var currentVideoBitrate = getParameterByName('videoBitrate', currentMediaElement.currentSrc); @@ -1607,7 +1655,7 @@ } if (maxAllowedWidth >= 480) { - options.push({ name: '480p+', maxWidth: 720, videoBitrate: 700000 }); + options.push({ name: '480p+', maxWidth: 720, videoBitrate: 700000 }); options.push({ name: '480p', maxWidth: 720, videoBitrate: 420000 }); } if (maxAllowedWidth >= 360) { @@ -1641,6 +1689,58 @@ return html; } + function getChannelsFlyoutHtml(channels) { + + var html = ''; + + for (var i = 0, length = channels.length; i < length; i++) { + + var channel = channels[i]; + + html += '
'; + + var imgUrl; + + if (channel.ImageTags.Primary) { + + imgUrl = ApiClient.getUrl("LiveTV/Channels/" + channel.Id + "/Images/Primary", { + maxwidth: 200, + tag: channel.ImageTags.Primary, + type: "Primary" + }); + } + else { + imgUrl = "css/images/media/tvflyout.png"; + } + + html += ''; + + html += '
'; + + var name = channel.Number + ' ' + channel.Name; + + html += '
' + name + '
'; + html += '
' + channel.CurrentProgram.Name + '
'; + + html += '
'; + + html += "
"; + } + + return html; + } + + self.showChannelsFlyout = function () { + + var flyout = $('#channelsFlyout'); + + var channels = channelsList || []; + + showFlyout(flyout, '#channelsButton'); + + flyout.html(getChannelsFlyoutHtml(channels)).scrollTop(0); + }; + self.showAudioTracksFlyout = function () { var flyout = $('#audioTracksFlyout'); diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 6623ce6481..7e628bc160 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1337,6 +1337,9 @@ $(function () { footerHtml += ''; footerHtml += '
'; + footerHtml += ''; + footerHtml += '
'; + footerHtml += ''; footerHtml += '
';