mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #2378 from jellyfin/session-style
update style for active sessions
This commit is contained in:
commit
bc557b1970
3 changed files with 40 additions and 72 deletions
|
@ -320,7 +320,6 @@ div[data-role=controlgroup] a.ui-btn-active {
|
||||||
.sessionCardFooter {
|
.sessionCardFooter {
|
||||||
padding-top: 0.5em !important;
|
padding-top: 0.5em !important;
|
||||||
padding-bottom: 1em !important;
|
padding-bottom: 1em !important;
|
||||||
border-top: 1px solid #eee;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
@ -346,15 +345,11 @@ div[data-role=controlgroup] a.ui-btn-active {
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
background: rgba(0, 0, 0, 0.7);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sessionNowPlayingContent-withbackground + .sessionNowPlayingInnerContent {
|
|
||||||
color: #fff !important;
|
|
||||||
background: rgba(0, 0, 0, 0.7);
|
|
||||||
}
|
|
||||||
|
|
||||||
.sessionAppName {
|
.sessionAppName {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
max-width: 200px;
|
max-width: 200px;
|
||||||
|
@ -377,10 +372,6 @@ div[data-role=controlgroup] a.ui-btn-active {
|
||||||
padding: 0.8em 0.5em;
|
padding: 0.8em 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sessionNowPlayingStreamInfo {
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.playbackProgress,
|
.playbackProgress,
|
||||||
.transcodingProgress {
|
.transcodingProgress {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -393,6 +384,7 @@ div[data-role=controlgroup] a.ui-btn-active {
|
||||||
margin: -0.6em;
|
margin: -0.6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.activeSession .backgroundProgress,
|
||||||
.activeSession .playbackProgress,
|
.activeSession .playbackProgress,
|
||||||
.activeSession .transcodingProgress {
|
.activeSession .transcodingProgress {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -409,9 +401,14 @@ div[data-role=controlgroup] a.ui-btn-active {
|
||||||
}
|
}
|
||||||
|
|
||||||
.transcodingProgress > div {
|
.transcodingProgress > div {
|
||||||
|
z-index: 10;
|
||||||
background-color: #dd4919;
|
background-color: #dd4919;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.backgroundProgress > div {
|
||||||
|
background-color: #303030;
|
||||||
|
}
|
||||||
|
|
||||||
@media all and (max-width: 34.375em) {
|
@media all and (max-width: 34.375em) {
|
||||||
.sessionAppName {
|
.sessionAppName {
|
||||||
max-width: 160px;
|
max-width: 160px;
|
||||||
|
|
|
@ -40,9 +40,13 @@ import confirm from '../../components/confirm/confirm';
|
||||||
text.push(globalize.translate('DirectStreamHelp1'));
|
text.push(globalize.translate('DirectStreamHelp1'));
|
||||||
text.push('<br/>');
|
text.push('<br/>');
|
||||||
text.push(globalize.translate('DirectStreamHelp2'));
|
text.push(globalize.translate('DirectStreamHelp2'));
|
||||||
|
} else if (displayPlayMethod === 'DirectPlay') {
|
||||||
|
title = globalize.translate('DirectPlaying');
|
||||||
|
text.push(globalize.translate('DirectPlayHelp'));
|
||||||
} else if (displayPlayMethod === 'Transcode') {
|
} else if (displayPlayMethod === 'Transcode') {
|
||||||
title = globalize.translate('Transcoding');
|
title = globalize.translate('Transcoding');
|
||||||
text.push(globalize.translate('MediaIsBeingConverted'));
|
text.push(globalize.translate('MediaIsBeingConverted'));
|
||||||
|
text.push(DashboardPage.getSessionNowPlayingStreamInfo(session));
|
||||||
|
|
||||||
if (session.TranscodingInfo && session.TranscodingInfo.TranscodeReasons && session.TranscodingInfo.TranscodeReasons.length) {
|
if (session.TranscodingInfo && session.TranscodingInfo.TranscodeReasons && session.TranscodingInfo.TranscodeReasons.length) {
|
||||||
text.push('<br/>');
|
text.push('<br/>');
|
||||||
|
@ -251,12 +255,13 @@ import confirm from '../../components/confirm/confirm';
|
||||||
} else {
|
} else {
|
||||||
const nowPlayingItem = session.NowPlayingItem;
|
const nowPlayingItem = session.NowPlayingItem;
|
||||||
const className = 'scalableCard card activeSession backdropCard backdropCard-scalable';
|
const className = 'scalableCard card activeSession backdropCard backdropCard-scalable';
|
||||||
|
const imgUrl = DashboardPage.getNowPlayingImageUrl(nowPlayingItem);
|
||||||
|
|
||||||
html += '<div class="' + className + '" id="' + rowId + '">';
|
html += '<div class="' + className + '" id="' + rowId + '">';
|
||||||
html += '<div class="cardBox visualCardBox">';
|
html += '<div class="cardBox visualCardBox">';
|
||||||
html += '<div class="cardScalable visualCardBox-cardScalable">';
|
html += '<div class="cardScalable visualCardBox-cardScalable">';
|
||||||
html += '<div class="cardPadder cardPadder-backdrop"></div>';
|
html += '<div class="cardPadder cardPadder-backdrop"></div>';
|
||||||
html += '<div class="cardContent">';
|
html += `<div class="cardContent ${cardBuilder.getDefaultBackgroundClass()}">`;
|
||||||
const imgUrl = DashboardPage.getNowPlayingImageUrl(nowPlayingItem);
|
|
||||||
|
|
||||||
if (imgUrl) {
|
if (imgUrl) {
|
||||||
html += '<div class="sessionNowPlayingContent sessionNowPlayingContent-withbackground"';
|
html += '<div class="sessionNowPlayingContent sessionNowPlayingContent-withbackground"';
|
||||||
|
@ -287,29 +292,19 @@ import confirm from '../../components/confirm/confirm';
|
||||||
html += '<div class="sessionNowPlayingTime">' + DashboardPage.getSessionNowPlayingTime(session) + '</div>';
|
html += '<div class="sessionNowPlayingTime">' + DashboardPage.getSessionNowPlayingTime(session) + '</div>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
if (nowPlayingItem && nowPlayingItem.RunTimeTicks) {
|
let percent = 100 * session?.PlayState?.PositionTicks / nowPlayingItem?.RunTimeTicks;
|
||||||
const percent = 100 * (session.PlayState.PositionTicks || 0) / nowPlayingItem.RunTimeTicks;
|
html += indicators.getProgressHtml(percent || 0, {
|
||||||
html += indicators.getProgressHtml(percent, {
|
|
||||||
containerClass: 'playbackProgress'
|
containerClass: 'playbackProgress'
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
// need to leave the element in just in case the device starts playback
|
|
||||||
html += indicators.getProgressHtml(0, {
|
|
||||||
containerClass: 'playbackProgress hide'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (session.TranscodingInfo && session.TranscodingInfo.CompletionPercentage) {
|
percent = session?.TranscodingInfo?.CompletionPercentage?.toFixed(1);
|
||||||
const percent = session.TranscodingInfo.CompletionPercentage.toFixed(1);
|
html += indicators.getProgressHtml(percent || 0, {
|
||||||
html += indicators.getProgressHtml(percent, {
|
|
||||||
containerClass: 'transcodingProgress'
|
containerClass: 'transcodingProgress'
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
// same issue as playbackProgress element above
|
html += indicators.getProgressHtml(100, {
|
||||||
html += indicators.getProgressHtml(0, {
|
containerClass: 'backgroundProgress'
|
||||||
containerClass: 'transcodingProgress hide'
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
@ -322,18 +317,12 @@ import confirm from '../../components/confirm/confirm';
|
||||||
|
|
||||||
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionPlayPause paper-icon-button-light ' + btnCssClass + '"><span class="material-icons ' + playIcon + '"></span></button>';
|
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionPlayPause paper-icon-button-light ' + btnCssClass + '"><span class="material-icons ' + playIcon + '"></span></button>';
|
||||||
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionStop paper-icon-button-light ' + btnCssClass + '"><span class="material-icons stop"></span></button>';
|
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionStop paper-icon-button-light ' + btnCssClass + '"><span class="material-icons stop"></span></button>';
|
||||||
|
|
||||||
btnCssClass = session.TranscodingInfo && session.TranscodingInfo.TranscodeReasons && session.TranscodingInfo.TranscodeReasons.length ? '' : ' hide';
|
|
||||||
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionInfo paper-icon-button-light ' + btnCssClass + '" title="' + globalize.translate('ViewPlaybackInfo') + '"><span class="material-icons info"></span></button>';
|
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionInfo paper-icon-button-light ' + btnCssClass + '" title="' + globalize.translate('ViewPlaybackInfo') + '"><span class="material-icons info"></span></button>';
|
||||||
|
|
||||||
btnCssClass = session.ServerId && session.SupportedCommands.indexOf('DisplayMessage') !== -1 && session.DeviceId !== ServerConnections.deviceId() ? '' : ' hide';
|
btnCssClass = session.ServerId && session.SupportedCommands.indexOf('DisplayMessage') !== -1 && session.DeviceId !== ServerConnections.deviceId() ? '' : ' hide';
|
||||||
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionSendMessage paper-icon-button-light ' + btnCssClass + '" title="' + globalize.translate('SendMessage') + '"><span class="material-icons message"></span></button>';
|
html += '<button is="paper-icon-button-light" class="sessionCardButton btnSessionSendMessage paper-icon-button-light ' + btnCssClass + '" title="' + globalize.translate('SendMessage') + '"><span class="material-icons message"></span></button>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
html += '<div class="sessionNowPlayingStreamInfo" style="padding:.5em 0 1em;">';
|
|
||||||
html += DashboardPage.getSessionNowPlayingStreamInfo(session);
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
html += '<div class="flex align-items-center justify-content-center">';
|
html += '<div class="flex align-items-center justify-content-center">';
|
||||||
const userImage = DashboardPage.getUserImage(session);
|
const userImage = DashboardPage.getUserImage(session);
|
||||||
html += userImage ? '<div class="activitylogUserPhoto" style="background-image:url(\'' + userImage + "');\"></div>" : '<div style="height:1.71em;"></div>';
|
html += userImage ? '<div class="activitylogUserPhoto" style="background-image:url(\'' + userImage + "');\"></div>" : '<div style="height:1.71em;"></div>';
|
||||||
|
@ -415,10 +404,8 @@ import confirm from '../../components/confirm/confirm';
|
||||||
} else if (displayPlayMethod === 'DirectStream') {
|
} else if (displayPlayMethod === 'DirectStream') {
|
||||||
html += globalize.translate('DirectStreaming');
|
html += globalize.translate('DirectStreaming');
|
||||||
} else if (displayPlayMethod === 'Transcode') {
|
} else if (displayPlayMethod === 'Transcode') {
|
||||||
html += globalize.translate('Transcoding');
|
|
||||||
|
|
||||||
if (session.TranscodingInfo && session.TranscodingInfo.Framerate) {
|
if (session.TranscodingInfo && session.TranscodingInfo.Framerate) {
|
||||||
html += ' (' + session.TranscodingInfo.Framerate + ' fps)';
|
html += `${globalize.translate('Framerate')}: ${session.TranscodingInfo.Framerate}fps`;
|
||||||
}
|
}
|
||||||
|
|
||||||
showTranscodingInfo = true;
|
showTranscodingInfo = true;
|
||||||
|
@ -562,8 +549,10 @@ import confirm from '../../components/confirm/confirm';
|
||||||
|
|
||||||
if (nowPlayingItem) {
|
if (nowPlayingItem) {
|
||||||
row.classList.add('playingSession');
|
row.classList.add('playingSession');
|
||||||
|
row.querySelector('.btnSessionInfo').classList.remove('hide');
|
||||||
} else {
|
} else {
|
||||||
row.classList.remove('playingSession');
|
row.classList.remove('playingSession');
|
||||||
|
row.querySelector('.btnSessionInfo').classList.add('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session.ServerId && session.SupportedCommands.indexOf('DisplayMessage') !== -1) {
|
if (session.ServerId && session.SupportedCommands.indexOf('DisplayMessage') !== -1) {
|
||||||
|
@ -572,12 +561,6 @@ import confirm from '../../components/confirm/confirm';
|
||||||
row.querySelector('.btnSessionSendMessage').classList.add('hide');
|
row.querySelector('.btnSessionSendMessage').classList.add('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session.TranscodingInfo && session.TranscodingInfo.TranscodeReasons && session.TranscodingInfo) {
|
|
||||||
row.querySelector('.btnSessionInfo').classList.remove('hide');
|
|
||||||
} else {
|
|
||||||
row.querySelector('.btnSessionInfo').classList.add('hide');
|
|
||||||
}
|
|
||||||
|
|
||||||
const btnSessionPlayPause = row.querySelector('.btnSessionPlayPause');
|
const btnSessionPlayPause = row.querySelector('.btnSessionPlayPause');
|
||||||
|
|
||||||
if (session.ServerId && nowPlayingItem && session.SupportsRemoteControl) {
|
if (session.ServerId && nowPlayingItem && session.SupportsRemoteControl) {
|
||||||
|
@ -592,7 +575,6 @@ import confirm from '../../components/confirm/confirm';
|
||||||
btnSessionPlayPauseIcon.classList.remove('play_arrow', 'pause');
|
btnSessionPlayPauseIcon.classList.remove('play_arrow', 'pause');
|
||||||
btnSessionPlayPauseIcon.classList.add(session.PlayState && session.PlayState.IsPaused ? 'play_arrow' : 'pause');
|
btnSessionPlayPauseIcon.classList.add(session.PlayState && session.PlayState.IsPaused ? 'play_arrow' : 'pause');
|
||||||
|
|
||||||
row.querySelector('.sessionNowPlayingStreamInfo').innerHTML = DashboardPage.getSessionNowPlayingStreamInfo(session);
|
|
||||||
row.querySelector('.sessionNowPlayingTime').innerHTML = DashboardPage.getSessionNowPlayingTime(session);
|
row.querySelector('.sessionNowPlayingTime').innerHTML = DashboardPage.getSessionNowPlayingTime(session);
|
||||||
row.querySelector('.sessionUserName').innerHTML = DashboardPage.getUsersHtml(session);
|
row.querySelector('.sessionUserName').innerHTML = DashboardPage.getUsersHtml(session);
|
||||||
row.querySelector('.sessionAppSecondaryText').innerHTML = DashboardPage.getAppSecondaryText(session);
|
row.querySelector('.sessionAppSecondaryText').innerHTML = DashboardPage.getAppSecondaryText(session);
|
||||||
|
@ -605,30 +587,17 @@ import confirm from '../../components/confirm/confirm';
|
||||||
}
|
}
|
||||||
|
|
||||||
const playbackProgressElem = row.querySelector('.playbackProgress');
|
const playbackProgressElem = row.querySelector('.playbackProgress');
|
||||||
|
|
||||||
if (nowPlayingItem && nowPlayingItem.RunTimeTicks) {
|
|
||||||
const percent = 100 * (session.PlayState.PositionTicks || 0) / nowPlayingItem.RunTimeTicks;
|
|
||||||
playbackProgressElem.outerHTML = indicators.getProgressHtml(percent, {
|
|
||||||
containerClass: 'playbackProgress'
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
playbackProgressElem.outerHTML = indicators.getProgressHtml(0, {
|
|
||||||
containerClass: 'playbackProgress hide'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const transcodingProgress = row.querySelector('.transcodingProgress');
|
const transcodingProgress = row.querySelector('.transcodingProgress');
|
||||||
|
|
||||||
if (session.TranscodingInfo && session.TranscodingInfo.CompletionPercentage) {
|
let percent = 100 * session?.PlayState?.PositionTicks / nowPlayingItem?.RunTimeTicks;
|
||||||
const percent = session.TranscodingInfo.CompletionPercentage.toFixed(1);
|
playbackProgressElem.outerHTML = indicators.getProgressHtml(percent || 0, {
|
||||||
transcodingProgress.outerHTML = indicators.getProgressHtml(percent, {
|
containerClass: 'playbackProgress'
|
||||||
|
});
|
||||||
|
|
||||||
|
percent = session?.TranscodingInfo?.CompletionPercentage?.toFixed(1);
|
||||||
|
transcodingProgress.outerHTML = indicators.getProgressHtml(percent || 0, {
|
||||||
containerClass: 'transcodingProgress'
|
containerClass: 'transcodingProgress'
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
transcodingProgress.outerHTML = indicators.getProgressHtml(0, {
|
|
||||||
containerClass: 'transcodingProgress hide'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const imgUrl = DashboardPage.getNowPlayingImageUrl(nowPlayingItem) || '';
|
const imgUrl = DashboardPage.getNowPlayingImageUrl(nowPlayingItem) || '';
|
||||||
const imgElem = row.querySelector('.sessionNowPlayingContent');
|
const imgElem = row.querySelector('.sessionNowPlayingContent');
|
||||||
|
|
|
@ -176,6 +176,7 @@
|
||||||
"Director": "Director",
|
"Director": "Director",
|
||||||
"Directors": "Directors",
|
"Directors": "Directors",
|
||||||
"DirectPlaying": "Direct playing",
|
"DirectPlaying": "Direct playing",
|
||||||
|
"DirectPlayHelp": "The source file is entirely compatible with this client, and the session is receiving the file without modifications.",
|
||||||
"DirectStreamHelp1": "The video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or number of audio channels. The video stream will be repackaged losslessly on the fly before being sent to the device. Only the audio stream will be transcoded.",
|
"DirectStreamHelp1": "The video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or number of audio channels. The video stream will be repackaged losslessly on the fly before being sent to the device. Only the audio stream will be transcoded.",
|
||||||
"DirectStreamHelp2": "Power consumed by direct streaming usually depends on the audio profile. Only the video stream is lossless.",
|
"DirectStreamHelp2": "Power consumed by direct streaming usually depends on the audio profile. Only the video stream is lossless.",
|
||||||
"DirectStreaming": "Direct streaming",
|
"DirectStreaming": "Direct streaming",
|
||||||
|
@ -263,6 +264,7 @@
|
||||||
"Filters": "Filters",
|
"Filters": "Filters",
|
||||||
"Folders": "Folders",
|
"Folders": "Folders",
|
||||||
"FormatValue": "Format: {0}",
|
"FormatValue": "Format: {0}",
|
||||||
|
"Framerate": "Framerate",
|
||||||
"Friday": "Friday",
|
"Friday": "Friday",
|
||||||
"Fullscreen": "Full screen",
|
"Fullscreen": "Full screen",
|
||||||
"General": "General",
|
"General": "General",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue