mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update video osd
This commit is contained in:
parent
afb01571ff
commit
f80fcc874a
16 changed files with 513 additions and 67 deletions
|
@ -1,4 +1,4 @@
|
|||
define(['datetime', 'userdataButtons', 'itemHelper', 'events', 'browser', 'imageLoader', 'playbackManager', 'nowPlayingHelper', 'apphost', 'dom', 'paper-icon-button-light'], function (datetime, userdataButtons, itemHelper, events, browser, imageLoader, playbackManager, nowPlayingHelper, appHost, dom) {
|
||||
define(['datetime', 'userdataButtons', 'itemHelper', 'events', 'browser', 'imageLoader', 'playbackManager', 'nowPlayingHelper', 'apphost', 'dom', 'connectionManager', 'paper-icon-button-light'], function (datetime, userdataButtons, itemHelper, events, browser, imageLoader, playbackManager, nowPlayingHelper, appHost, dom, connectionManager) {
|
||||
'use strict';
|
||||
|
||||
var currentPlayer;
|
||||
|
@ -504,6 +504,66 @@
|
|||
return html;
|
||||
}
|
||||
|
||||
function seriesImageUrl(item, options) {
|
||||
|
||||
if (item.Type !== 'Episode') {
|
||||
return null;
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
options.type = options.type || "Primary";
|
||||
|
||||
if (options.type === 'Primary') {
|
||||
|
||||
if (item.SeriesPrimaryImageTag) {
|
||||
|
||||
options.tag = item.SeriesPrimaryImageTag;
|
||||
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId, options);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.type === 'Thumb') {
|
||||
|
||||
if (item.SeriesThumbImageTag) {
|
||||
|
||||
options.tag = item.SeriesThumbImageTag;
|
||||
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.SeriesId, options);
|
||||
}
|
||||
if (item.ParentThumbImageTag) {
|
||||
|
||||
options.tag = item.ParentThumbImageTag;
|
||||
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.ParentThumbItemId, options);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function imageUrl(item, options) {
|
||||
|
||||
options = options || {};
|
||||
options.type = options.type || "Primary";
|
||||
|
||||
if (item.ImageTags && item.ImageTags[options.type]) {
|
||||
|
||||
options.tag = item.ImageTags[options.type];
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.Id, options);
|
||||
}
|
||||
|
||||
if (options.type === 'Primary') {
|
||||
if (item.AlbumId && item.AlbumPrimaryImageTag) {
|
||||
|
||||
options.tag = item.AlbumPrimaryImageTag;
|
||||
return connectionManager.getApiClient(item.ServerId).getScaledImageUrl(item.AlbumId, options);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
var currentImgUrl;
|
||||
function updateNowPlayingInfo(state) {
|
||||
|
||||
|
@ -517,46 +577,14 @@
|
|||
|
||||
}).join('');
|
||||
|
||||
var url;
|
||||
var imgHeight = 70;
|
||||
|
||||
var nowPlayingItem = state.NowPlayingItem;
|
||||
|
||||
if (nowPlayingItem.PrimaryImageTag) {
|
||||
|
||||
url = ApiClient.getScaledImageUrl(nowPlayingItem.PrimaryImageItemId, {
|
||||
type: "Primary",
|
||||
height: imgHeight,
|
||||
tag: nowPlayingItem.PrimaryImageTag
|
||||
});
|
||||
}
|
||||
else if (nowPlayingItem.BackdropImageTag) {
|
||||
|
||||
url = ApiClient.getScaledImageUrl(nowPlayingItem.BackdropItemId, {
|
||||
type: "Backdrop",
|
||||
height: imgHeight,
|
||||
tag: nowPlayingItem.BackdropImageTag,
|
||||
index: 0
|
||||
});
|
||||
|
||||
} else if (nowPlayingItem.ThumbImageTag) {
|
||||
|
||||
url = ApiClient.getScaledImageUrl(nowPlayingItem.ThumbImageItemId, {
|
||||
type: "Thumb",
|
||||
height: imgHeight,
|
||||
tag: nowPlayingItem.ThumbImageTag
|
||||
});
|
||||
}
|
||||
|
||||
else if (nowPlayingItem.Type == "TvChannel" || nowPlayingItem.Type == "Recording") {
|
||||
url = "css/images/items/detail/tv.png";
|
||||
}
|
||||
else if (nowPlayingItem.MediaType == "Audio") {
|
||||
url = "css/images/items/detail/audio.png";
|
||||
}
|
||||
else {
|
||||
url = "css/images/items/detail/video.png";
|
||||
}
|
||||
var url = seriesImageUrl(nowPlayingItem, {
|
||||
height: imgHeight
|
||||
}) || imageUrl(nowPlayingItem, {
|
||||
height: imgHeight
|
||||
});
|
||||
|
||||
if (url == currentImgUrl) {
|
||||
return;
|
||||
|
|
|
@ -1521,6 +1521,9 @@ var AppInfo = {};
|
|||
Dashboard.navigate('mypreferencesmenu.html');
|
||||
};
|
||||
|
||||
embyRouter.setTitle = function () {
|
||||
};
|
||||
|
||||
function showItem(item, serverId, options) {
|
||||
if (typeof (item) === 'string') {
|
||||
require(['connectionManager'], function (connectionManager) {
|
||||
|
@ -2629,6 +2632,24 @@ var AppInfo = {};
|
|||
});
|
||||
}
|
||||
|
||||
function enableNativeGamepadKeyMapping() {
|
||||
|
||||
// On Windows UWP, this will tell the platform to make the gamepad emit normal keyboard events
|
||||
if (window.navigator && typeof window.navigator.gamepadInputEmulation === "string") {
|
||||
// We want the gamepad to provide gamepad VK keyboard events rather than moving a
|
||||
// mouse like cursor. Set to "keyboard", the gamepad will provide such keyboard events
|
||||
// and provide input to the DOM navigator.getGamepads API.
|
||||
window.navigator.gamepadInputEmulation = "keyboard";
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function isGamepadSupported() {
|
||||
return 'ongamepadconnected' in window || navigator.getGamepads || navigator.webkitGetGamepads;
|
||||
}
|
||||
|
||||
function onAppReady() {
|
||||
|
||||
console.log('Begin onAppReady');
|
||||
|
@ -2676,6 +2697,10 @@ var AppInfo = {};
|
|||
|
||||
var postInitDependencies = [];
|
||||
|
||||
if (!enableNativeGamepadKeyMapping() && isGamepadSupported()) {
|
||||
postInitDependencies.push('bower_components/emby-webcomponents/input/gamepadtokey');
|
||||
}
|
||||
|
||||
postInitDependencies.push('bower_components/emby-webcomponents/thememediaplayer');
|
||||
postInitDependencies.push('css!css/chromecast.css');
|
||||
postInitDependencies.push('scripts/autobackdrops');
|
||||
|
|
|
@ -410,8 +410,27 @@
|
|||
releaseCurrentPlayer();
|
||||
});
|
||||
|
||||
if (appHost.supports('remotecontrol')) {
|
||||
view.querySelector('.btnCast').classList.remove('hide');
|
||||
}
|
||||
|
||||
view.querySelector('.btnCast').addEventListener('click', function() {
|
||||
var btn = this;
|
||||
require(['playerSelectionMenu'], function (playerSelectionMenu) {
|
||||
playerSelectionMenu.show(btn);
|
||||
});
|
||||
});
|
||||
|
||||
function onPlayerChange() {
|
||||
bindToPlayer(playbackManager.getCurrentPlayer());
|
||||
|
||||
var currentPlayer = playbackManager.getCurrentPlayer();
|
||||
|
||||
if (currentPlayer && !currentPlayer.isLocalPlayer) {
|
||||
view.querySelector('.btnCast i').innerHTML = '';
|
||||
} else {
|
||||
view.querySelector('.btnCast i').innerHTML = '';
|
||||
}
|
||||
bindToPlayer(currentPlayer);
|
||||
}
|
||||
|
||||
function onStateChanged(event, state) {
|
||||
|
@ -719,9 +738,7 @@
|
|||
|
||||
var player = currentPlayer;
|
||||
|
||||
var audioTracks = lastPlayerState.MediaSource.MediaStreams.filter(function (s) {
|
||||
return s.Type === 'Audio';
|
||||
});
|
||||
var audioTracks = playbackManager.audioTracks(player);
|
||||
|
||||
var currentIndex = playbackManager.getAudioStreamIndex(player);
|
||||
|
||||
|
@ -760,9 +777,7 @@
|
|||
|
||||
var player = currentPlayer;
|
||||
|
||||
var streams = lastPlayerState.MediaSource.MediaStreams.filter(function (s) {
|
||||
return s.Type === 'Subtitle';
|
||||
});
|
||||
var streams = playbackManager.subtitleTracks(player);
|
||||
|
||||
var currentIndex = playbackManager.getSubtitleStreamIndex(player);
|
||||
if (currentIndex == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue