diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index d6b667cd0e..b4b203b4a1 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -14,12 +14,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.4.428", - "_release": "1.4.428", + "version": "1.4.431", + "_release": "1.4.431", "_resolution": { "type": "version", - "tag": "1.4.428", - "commit": "9f2fc55522c782561fa0c24b1a70c77868f46622" + "tag": "1.4.431", + "commit": "745cf4df338c6e486eb1ca0480673f8de4bed53d" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.1", diff --git a/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js b/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js index e76aba0171..822624bac1 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js +++ b/dashboard-ui/bower_components/emby-webcomponents/htmlaudioplayer/plugin.js @@ -102,7 +102,10 @@ define(['events', 'browser', 'pluginManager', 'apphost', 'appSettings'], functio self.duration = function (val) { if (mediaElement) { - return mediaElement.duration * 1000; + var duration = mediaElement.duration; + if (duration && !isNaN(duration) && duration !== Number.POSITIVE_INFINITY && duration !== Number.NEGATIVE_INFINITY) { + return duration * 1000; + } } return null; diff --git a/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js b/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js index 09bffcac7b..b23456a9b0 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js +++ b/dashboard-ui/bower_components/emby-webcomponents/htmlvideoplayer/plugin.js @@ -347,7 +347,10 @@ define(['browser', 'pluginManager', 'events', 'apphost', 'loading', 'playbackMan self.duration = function (val) { if (mediaElement) { - return mediaElement.duration * 1000; + var duration = mediaElement.duration; + if (duration && !isNaN(duration) && duration !== Number.POSITIVE_INFINITY && duration !== Number.NEGATIVE_INFINITY) { + return duration * 1000; + } } return null; diff --git a/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js b/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js index 708e690bec..cbb55d8fd8 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js +++ b/dashboard-ui/bower_components/emby-webcomponents/playback/playbackmanager.js @@ -875,8 +875,7 @@ define(['events', 'datetime', 'appSettings', 'pluginManager', 'userSettings', 'g return true; } else { - var duration = player.duration(); - return duration && !isNaN(duration) && duration !== Number.POSITIVE_INFINITY && duration !== Number.NEGATIVE_INFINITY; + return player.duration(); } } @@ -967,16 +966,11 @@ define(['events', 'datetime', 'appSettings', 'pluginManager', 'userSettings', 'g self.seekPercent = function (percent, player) { - var data = getPlayerData(player).streamInfo; - var mediaSource = data.mediaSource; + var ticks = self.duration(player) || 0; - if (mediaSource) { - var ticks = mediaSource.RunTimeTicks || 0; - - percent /= 100; - ticks *= percent; - self.seek(parseInt(ticks)); - } + percent /= 100; + ticks *= percent; + self.seek(parseInt(ticks)); }; self.playTrailers = function (item) { @@ -1211,6 +1205,16 @@ define(['events', 'datetime', 'appSettings', 'pluginManager', 'userSettings', 'g return getCurrentTicks(player); }; + self.duration = function (player) { + + player = player || currentPlayer; + if (player && !enableLocalPlaylistManagement(player)) { + return player.duration(); + } + + return getPlayerData(player).streamInfo.mediaSource.RunTimeTicks || ((player.duration() || 0) * 10000); + }; + function getCurrentTicks(player) { var playerTime = Math.floor(10000 * (player || currentPlayer).currentTime()); @@ -1225,10 +1229,10 @@ define(['events', 'datetime', 'appSettings', 'pluginManager', 'userSettings', 'g if (mediaSource) { nowPlayingItem.RunTimeTicks = mediaSource.RunTimeTicks; - } else { - nowPlayingItem.RunTimeTicks = player.duration() * 10000; } + nowPlayingItem.RunTimeTicks = nowPlayingItem.RunTimeTicks || player.duration() * 10000; + return nowPlayingItem; }