mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
implement keep up to
This commit is contained in:
parent
633e2f0222
commit
2efcbc740d
14 changed files with 111 additions and 43 deletions
|
@ -263,12 +263,14 @@ define(['browser'], function (browser) {
|
|||
// Otherwise with HLS and mp3 audio we're seeing some browsers
|
||||
// safari is lying
|
||||
if ((videoTestElement.canPlayType('audio/mp4; codecs="ac-3"').replace(/no/, '') && !browser.safari) || browser.edgeUwp || browser.tizen) {
|
||||
videoAudioCodecs.push('ac3');
|
||||
if ((options.disableVideoAudioCodecs || []).indexOf('ac3') == -1) {
|
||||
videoAudioCodecs.push('ac3');
|
||||
|
||||
// This works in edge desktop, but not mobile
|
||||
// TODO: Retest this on mobile
|
||||
if (!browser.edge || !browser.touch) {
|
||||
hlsVideoAudioCodecs.push('ac3');
|
||||
// This works in edge desktop, but not mobile
|
||||
// TODO: Retest this on mobile
|
||||
if (!browser.edge || !browser.touch) {
|
||||
hlsVideoAudioCodecs.push('ac3');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1188,7 +1188,7 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo
|
|||
}
|
||||
|
||||
if (!imgUrl) {
|
||||
var defaultName = item.EpisodeTitle ? item.Name : itemHelper.getDisplayName(item);
|
||||
var defaultName = item.Type == 'Program' ? item.Name : itemHelper.getDisplayName(item);
|
||||
cardImageContainerOpen += '<div class="cardText cardCenteredText">' + defaultName + '</div>';
|
||||
}
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ define(['css!./indicators.css', 'material-icons'], function () {
|
|||
return '<i class="md-icon timerIndicator timerIndicator-inactive indicatorIcon"></i>';
|
||||
}
|
||||
}
|
||||
else if (item.TimerId) {
|
||||
else if (item.TimerId || item.Type == 'Timer') {
|
||||
return '<i class="md-icon timerIndicator indicatorIcon"></i>';
|
||||
}
|
||||
|
||||
|
|
|
@ -140,13 +140,6 @@
|
|||
html += '<button is="emby-button" class="itemAction autoSize fab cardOverlayFab mini" data-action="menu" data-playoptions="false"><i class="md-icon cardOverlayFab-md-icon">' + moreIcon + '</i></button>';
|
||||
buttonCount++;
|
||||
|
||||
html += userdataButtons.getIconsHtml({
|
||||
item: item,
|
||||
style: 'fab-mini',
|
||||
cssClass: 'cardOverlayFab',
|
||||
iconCssClass: 'cardOverlayFab-md-icon'
|
||||
});
|
||||
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
@ -215,6 +208,16 @@
|
|||
|
||||
innerElem.innerHTML = getOverlayHtml(apiClient, item, user, dataElement);
|
||||
|
||||
userdataButtons.fill({
|
||||
item: item,
|
||||
style: 'fab-mini',
|
||||
cssClass: 'cardOverlayFab',
|
||||
iconCssClass: 'cardOverlayFab-md-icon',
|
||||
element: innerElem.querySelector('.cardOverlayButtons'),
|
||||
fillMode: 'insertAdjacent',
|
||||
insertLocation: 'beforeend'
|
||||
});
|
||||
|
||||
innerElem.querySelector('.cardOverlayButtons').addEventListener('click', onCardOverlayButtonsClick);
|
||||
});
|
||||
|
||||
|
|
|
@ -1,4 +1,11 @@
|
|||
define(['connectionManager', 'globalize', 'paper-icon-button-light', 'material-icons', 'emby-button', 'css!./userdatabuttons'], function (connectionManager, globalize) {
|
||||
define(['connectionManager', 'globalize', 'dom', 'paper-icon-button-light', 'material-icons', 'emby-button', 'css!./userdatabuttons'], function (connectionManager, globalize, dom) {
|
||||
|
||||
var userDataMethods = {
|
||||
markPlayed: markPlayed,
|
||||
markDislike: markDislike,
|
||||
markLike: markLike,
|
||||
markFavorite: markFavorite
|
||||
};
|
||||
|
||||
function getUserDataButtonHtml(method, itemId, buttonCssClass, iconCssClass, icon, tooltip, style) {
|
||||
|
||||
|
@ -22,16 +29,49 @@ define(['connectionManager', 'globalize', 'paper-icon-button-light', 'material-i
|
|||
|
||||
iconCssClass += 'md-icon';
|
||||
|
||||
return '<button title="' + tooltip + '" data-itemid="' + itemId + '" is="' + is + '" class="' + className + '" onclick="UserDataButtons.' + method + '(this);return false;">\
|
||||
return '<button title="' + tooltip + '" data-itemid="' + itemId + '" is="' + is + '" data-method="' + method + '" class="' + className + '">\
|
||||
<i class="'+ iconCssClass + '">' + icon + '</i>\
|
||||
</button>';
|
||||
}
|
||||
|
||||
function onContainerClick(e) {
|
||||
|
||||
var btnUserData = dom.parentWithClass(e.target, 'btnUserData');
|
||||
|
||||
if (!btnUserData) {
|
||||
return;
|
||||
}
|
||||
|
||||
var method = btnUserData.getAttribute('data-method');
|
||||
userDataMethods[method](btnUserData);
|
||||
}
|
||||
|
||||
function fill(options) {
|
||||
|
||||
var html = getIconsHtml(options);
|
||||
|
||||
options.element.innerHTML = html;
|
||||
if (options.fillMode == 'insertAdjacent') {
|
||||
options.element.insertAdjacentHTML(options.insertLocation || 'beforeend', html);
|
||||
} else {
|
||||
options.element.innerHTML = html;
|
||||
}
|
||||
|
||||
dom.removeEventListener(options.element, 'click', onContainerClick, {
|
||||
passive: true
|
||||
});
|
||||
|
||||
dom.addEventListener(options.element, 'click', onContainerClick, {
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
|
||||
function destroy(options) {
|
||||
|
||||
options.element.innerHTML = '';
|
||||
|
||||
dom.removeEventListener(options.element, 'click', onContainerClick, {
|
||||
passive: true
|
||||
});
|
||||
}
|
||||
|
||||
function getIconsHtml(options) {
|
||||
|
@ -195,15 +235,9 @@ define(['connectionManager', 'globalize', 'paper-icon-button-light', 'material-i
|
|||
return apiClient.clearUserItemRating(apiClient.getCurrentUserId(), id);
|
||||
}
|
||||
|
||||
window.UserDataButtons = {
|
||||
markPlayed: markPlayed,
|
||||
markDislike: markDislike,
|
||||
markLike: markLike,
|
||||
markFavorite: markFavorite
|
||||
};
|
||||
|
||||
return {
|
||||
fill: fill,
|
||||
destroy: destroy,
|
||||
getIconsHtml: getIconsHtml
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue