From 77b267a91696f38911f16588402bedf132b73aab Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 14 Jun 2014 22:58:00 -0400 Subject: [PATCH] seek with vtt subs --- dashboard-ui/scripts/favorites.js | 5 +++-- dashboard-ui/scripts/mediaplayer-video.js | 16 ++++++++++++++-- dashboard-ui/scripts/mediaplayer.js | 2 ++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/dashboard-ui/scripts/favorites.js b/dashboard-ui/scripts/favorites.js index c54242f1e7..0a0c454ccc 100644 --- a/dashboard-ui/scripts/favorites.js +++ b/dashboard-ui/scripts/favorites.js @@ -6,7 +6,8 @@ { name: Globalize.translate('HeaderFavoriteMovies'), types: "Movie", id: "favoriteMovies", shape: 'backdrop', preferThumb: true, showTitle: false }, { name: Globalize.translate('HeaderFavoriteShows'), types: "Series", id: "favoriteShows", shape: 'backdrop', preferThumb: true, showTitle: false }, { name: Globalize.translate('HeaderFavoriteEpisodes'), types: "Episode", id: "favoriteEpisode", shape: 'backdrop', preferThumb: false, showTitle: true, showParentTitle: true }, - { name: Globalize.translate('HeaderFavoriteGames'), types: "Game", id: "favoriteGames", shape: 'auto', preferThumb: false, showTitle: true } + { name: Globalize.translate('HeaderFavoriteGames'), types: "Game", id: "favoriteGames", shape: 'auto', preferThumb: false, showTitle: true }, + { name: Globalize.translate('HeaderFavoriteAlbums'), types: "MusicAlbum", id: "favoriteAlbums", shape: 'square', preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true } ]; } @@ -43,7 +44,7 @@ items: result.Items, preferThumb: section.preferThumb, shape: section.shape, - overlayText: screenWidth >= 600, + overlayText: section.overlayText !== false && screenWidth >= 600, context: 'home-favorites', showTitle: section.showTitle, showParentTitle: section.showParentTitle, diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index 3d6f732cd6..1bcebbd573 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -198,7 +198,7 @@ if (newStream.IsTextSubtitleStream) { selectedTrackElementIndex = index; - + if (!currentStream.IsTextSubtitleStream) { self.changeStream(self.getCurrentTicks(), { SubtitleStreamIndex: -1 }); } @@ -233,6 +233,18 @@ } }; + self.updateTextStreamUrls = function (startPositionTicks) { + + $('track', video).each(function () { + + var currentSrc = this.src; + + currentSrc = replaceQueryString(currentSrc, 'startPositionTicks', startPositionTicks); + + this.src = currentSrc; + }); + }; + $(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange', function (e) { var videoControls = $('#videoControls'); @@ -930,7 +942,7 @@ var textStream = textStreams[i]; var textStreamUrl = ApiClient.getUrl('Videos/' + item.Id + '/' + mediaSource.Id + '/Subtitles/' + textStream.Index + '/Stream.vtt', { - startPositionTicks: startPosition + startPositionTicks: (startPosition || 0) }); var defaultAttribute = textStream.Index == mediaSource.DefaultSubtitleStreamIndex ? ' default' : ''; diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 50c4758bce..c575aaf7ac 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -183,6 +183,8 @@ element.src = currentSrc; }); + + self.updateTextStreamUrls(ticks || 0); } else { self.startTimeTicksOffset = ticks; element.src = currentSrc;