From a2a0afa97099ad7439a7d3ca4f7af6f3f3edddb1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 24 May 2013 21:51:17 -0400 Subject: [PATCH] show messages the first time folder rips are streamed --- dashboard-ui/css/site.css | 12 +++-- dashboard-ui/scripts/mediaplayer.js | 75 ++++++++++++++++++++++++++--- 2 files changed, 77 insertions(+), 10 deletions(-) diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 3565effd01..6a279a8d64 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -707,7 +707,7 @@ progress { } .nowPlayingBarImage { - border: 1px solid #a7a7a7; + border: 1px solid #a7a7a7!important; padding: 1px; vertical-align: bottom; } @@ -736,6 +736,12 @@ progress { display: none; } +.nowPlayingText { + position: relative; + top: -3px; + margin-left: 3px; +} + @media all and (min-width: 650px) { .nowPlayingMediaInfo { display: inline-block; @@ -847,8 +853,8 @@ input[type="range"]::-ms-fill-upper { } -@media all and (max-width: 500px) { - .volumeButton, .volumeSlider, .fullscreenButton { +@media all and (max-width: 600px) { + .volumeButton, .volumeSlider, .fullscreenButton, .nowPlayingText { display: none!important; } diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index b5205c185c..e5dea48bff 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -303,12 +303,19 @@ $('#stopButton', nowPlayingBar).show(); $('#playButton', nowPlayingBar).hide(); $('#pauseButton', nowPlayingBar).show(); - $('#playlistButton', nowPlayingBar).show(); - $('#previousTrackButton', nowPlayingBar).show(); - $('#nextTrackButton', nowPlayingBar).show(); - $('#mediaElement', nowPlayingBar).html(html); $('#fullscreenButton', nowPlayingBar).hide(); + if (requiresControls) { + $('#previousTrackButton', nowPlayingBar).hide(); + $('#nextTrackButton', nowPlayingBar).hide(); + $('#playlistButton', nowPlayingBar).hide(); + } else { + $('#previousTrackButton', nowPlayingBar).show(); + $('#nextTrackButton', nowPlayingBar).show(); + $('#playlistButton', nowPlayingBar).show(); + } + + $('#mediaElement', nowPlayingBar).html(html); var audioElement = $("audio", nowPlayingBar); var initialVolume = localStorage.getItem("volume") || 0.5; @@ -333,7 +340,7 @@ if (!requiresControls) { audioElement.hide(); } - + var duration = this.duration; isStaticStream = duration && !isNaN(duration) && duration != Number.POSITIVE_INFINITY && duration != Number.NEGATIVE_INFINITY; @@ -590,6 +597,60 @@ self.play = function (items, startPosition) { + var item = items[0]; + + var videoType = (item.VideoType || "").toLowerCase(); + + if (videoType == "dvd") { + + self.playWithWarning(items, startPosition, "dvdstreamconfirmed", "Dvd Folder Streaming"); + return; + } + else if (videoType == "bluray") { + + self.playWithWarning(items, startPosition, "bluraystreamconfirmed", "Blu-ray Folder Streaming"); + return; + } + else if (videoType == "iso") { + + var isoType = (item.IsoType || "").toLowerCase(); + + if (isoType == "dvd") { + + self.playWithWarning(items, startPosition, "dvdisostreamconfirmed", "Dvd Iso Streaming"); + return; + } + else if (isoType == "bluray") { + + self.playWithWarning(items, startPosition, "blurayisostreamconfirmed", "Blu-ray Iso Streaming"); + return; + } + } + + self.play(items, startPosition); + }; + + self.playWithWarning = function (items, startPosition, localStorageKeyName, header) { + + if (localStorage.getItem(localStorageKeyName) == "1") { + self.playInternal(items, startPosition); + return; + } + + Dashboard.confirm("This feature is expiremental. It may not work at all with some titles. Do you wish to continue?", header, function(result) { + + if (result) { + + localStorage.setItem(localStorageKeyName, "1"); + self.playInternal(items, startPosition); + } + + }); + + }; + + self.playInternal = function (items, startPosition) { + if (self.isPlaying()) { self.stop(); } @@ -670,9 +731,9 @@ html += "
"; if (item.Type == "Movie") - html += '
' + name + '
' + seriesName + '
'; + html += '
' + name + '
' + seriesName + '
'; else - html += '
' + seriesName + '
' + name + '
'; + html += '
' + seriesName + '
' + name + '
'; $('.nowPlayingMediaInfo', nowPlayingBar).html(html); };