From 002139addbc96789e2c0db446f0608fceb194c71 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 7 Feb 2015 16:03:09 -0500 Subject: [PATCH] added SupportsExternalStream to MediaStream --- dashboard-ui/css/librarybrowser.css | 49 +++++++++++++++-------- dashboard-ui/scripts/mediaplayer-video.js | 18 +++++---- dashboard-ui/scripts/mediaplayer.js | 2 +- 3 files changed, 44 insertions(+), 25 deletions(-) diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 55e8bc26a..62a35d868 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -383,14 +383,19 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { } .noBackdrop { - height: 220px; - padding: 3em 0 0; + height: auto; + margin: 2.5em 0 0; } .noBackdrop .itemBackdropContent { background-color: transparent; } + .noBackdrop .itemBackdropContent { + position: static; + } + + .lnkSibling { position: fixed; top: 105px; @@ -433,6 +438,16 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { top: -26px; } +.noBackdrop .squareDetailImageContainer { + top: 0; +} + +.noBackdrop .detailImageContainer { + position: static; + display: inline-block; + vertical-align: top; +} + .itemDetailImage { -moz-box-shadow: 0px 0 20px #000; -webkit-box-shadow: 0px 0 20px #000; @@ -473,9 +488,6 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { margin-left: 220px; } -.detailContentEffectedByImage a { -} - .lastDetailContentEffectedByImage.detailContentEffectedByThumbImage { padding: 0 .5em; } @@ -488,6 +500,17 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { min-height: 115px; } +.noBackdrop .detailContentEffectedByImage { + display: inline-block; + margin-left: 10px; +} + +.noBackdrop + .ui-content .lastDetailContentEffectedByImage { + margin-top: 0; + margin-left: 0; + min-height: initial; +} + .parentName { font-size: 14px; display: block; @@ -610,7 +633,7 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { .detailSection { vertical-align: top; - margin-bottom: 2.5em; + margin-bottom: 2em; } .detailCollapsibleSection:not(.hide) + .detailCollapsibleSection { @@ -770,18 +793,10 @@ span.itemCommunityRating:not(:empty) + .userDataIcons { display: none; } - .noBackdrop { - height: auto; - } - - .noBackdrop .detailImageContainer { - display: block; - position: static; - text-align: center; - } - - .noBackdrop .itemBackdropContent { + .noBackdrop .detailImageContainer { + display: block; position: static; + text-align: center; } } diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 5a869f80a..708716f82 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -143,6 +143,10 @@ self.changeStream(self.getCurrentTicks(), { AudioStreamIndex: index }); }; + self.supportsSubtitleStreamExternally = function (stream) { + return stream.Type == 'Subtitle' && stream.IsTextSubtitleStream && stream.SupportsExternalStream; + } + self.setSubtitleStreamIndex = function (index) { if (!self.supportsTextTracks()) { @@ -162,7 +166,7 @@ if (currentStream && !newStream) { - if (!currentStream.IsTextSubtitleStream) { + if (!self.supportsSubtitleStreamExternally(currentStream)) { // Need to change the transcoded stream to remove subs self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: -1 }); @@ -170,7 +174,7 @@ } else if (!currentStream && newStream) { - if (newStream.IsTextSubtitleStream) { + if (self.supportsSubtitleStreamExternally(newStream)) { selectedTrackElementIndex = index; } else { @@ -180,10 +184,10 @@ } else if (currentStream && newStream) { - if (newStream.IsTextSubtitleStream) { + if (self.supportsSubtitleStreamExternally(newStream)) { selectedTrackElementIndex = index; - if (!currentStream.IsTextSubtitleStream) { + if (!self.supportsSubtitleStreamExternally(currentStream)) { self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: -1 }); } } else { @@ -203,7 +207,7 @@ var modes = ['disabled', 'showing', 'hidden']; var textStreams = self.currentMediaSource.MediaStreams.filter(function (s) { - return s.Type == 'Subtitle' && s.IsTextSubtitleStream; + return self.supportsSubtitleStreamExternally(s); }); var newStream = textStreams.filter(function (s) { @@ -1025,7 +1029,7 @@ mediaSourceId: mediaSource.Id }; - if (selectedSubtitleStream && (!selectedSubtitleStream.IsTextSubtitleStream || !self.supportsTextTracks())) { + if (selectedSubtitleStream && (!self.supportsSubtitleStreamExternally(selectedSubtitleStream) || !self.supportsTextTracks())) { baseParams.SubtitleStreamIndex = mediaSource.DefaultSubtitleStreamIndex; } @@ -1136,7 +1140,7 @@ if (self.supportsTextTracks()) { var textStreams = subtitleStreams.filter(function (s) { - return s.IsTextSubtitleStream; + return self.supportsSubtitleStreamExternally(s); }); for (var i = 0, length = textStreams.length; i < length; i++) { diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index f20c5a6e6..911aabecd 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -302,7 +302,7 @@ return false; } - if (subtitleStream && (!subtitleStream.IsTextSubtitleStream || !self.supportsTextTracks())) { + if (subtitleStream && (!subtitleStream.SupportsExternalStream || !subtitleStream.IsTextSubtitleStream || !self.supportsTextTracks())) { console.log('Transcoding because subtitles are required'); return false; }