mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
dlna fixes
This commit is contained in:
parent
ec163807cf
commit
99aed936db
7 changed files with 113 additions and 57 deletions
|
@ -280,7 +280,11 @@
|
|||
|
||||
html += '</div>';
|
||||
|
||||
html += '<div class="posterItemOverlayTarget"></div>';
|
||||
html += '<div class="posterItemOverlayTarget">';
|
||||
|
||||
html += '<div class="sessionNowPlayingStreamInfo">' + DashboardPage.getSessionNowPlayingStreamInfo(connection) + '</div>';
|
||||
html += '<div class="sessionNowPlayingTime">' + DashboardPage.getSessionNowPlayingTime(connection) + '</div>';
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
||||
|
@ -291,6 +295,50 @@
|
|||
$('.deadSession', parentElement).remove();
|
||||
},
|
||||
|
||||
getSessionNowPlayingStreamInfo: function (session) {
|
||||
|
||||
var html = '';
|
||||
|
||||
html += '<div>';
|
||||
|
||||
if (session.PlayState.PlayMethod == 'Transcode') {
|
||||
html += 'Transcoding';
|
||||
}
|
||||
else if (session.PlayState.PlayMethod == 'DirectStream') {
|
||||
html += 'Direct Streaming';
|
||||
}
|
||||
else if (session.PlayState.PlayMethod == 'DirectPlay') {
|
||||
html += 'Direct Playing';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
getSessionNowPlayingTime: function (session) {
|
||||
|
||||
var html = '';
|
||||
|
||||
if (session.PlayState.PositionTicks) {
|
||||
html += Dashboard.getDisplayTime(session.PlayState.PositionTicks);
|
||||
} else {
|
||||
html += '--:--:--';
|
||||
}
|
||||
|
||||
html += ' / ';
|
||||
|
||||
var nowPlayingItem = session.NowPlayingItem;
|
||||
|
||||
if (nowPlayingItem && nowPlayingItem.RunTimeTicks) {
|
||||
html += Dashboard.getDisplayTime(nowPlayingItem.RunTimeTicks);
|
||||
} else {
|
||||
html += '--:--:--';
|
||||
}
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
getAppSecondaryText: function (session) {
|
||||
|
||||
return session.ApplicationVersion;
|
||||
|
@ -405,6 +453,9 @@
|
|||
row.removeClass('playingSession');
|
||||
}
|
||||
|
||||
$('.sessionNowPlayingStreamInfo', row).html(DashboardPage.getSessionNowPlayingStreamInfo(session));
|
||||
$('.sessionNowPlayingTime', row).html(DashboardPage.getSessionNowPlayingTime(session));
|
||||
|
||||
$('.sessionUserName', row).html(DashboardPage.getUsersHtml(session));
|
||||
|
||||
$('.sessionAppSecondaryText', row).html(DashboardPage.getAppSecondaryText(session));
|
||||
|
@ -416,7 +467,7 @@
|
|||
nowPlayingInfoElem.html(nowPlayingName.html);
|
||||
nowPlayingInfoElem.attr('data-imgsrc', nowPlayingName.image || '');
|
||||
}
|
||||
|
||||
|
||||
if (nowPlayingItem && nowPlayingItem.RunTimeTicks) {
|
||||
|
||||
var position = session.PlayState.PositionTicks || 0;
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
})[0];
|
||||
|
||||
typeName = typeName ? typeName.name : "General or mixed content";
|
||||
typeName = typeName ? typeName.name : "Mixed movies & tv";
|
||||
|
||||
html += '<p style="padding-left:.5em;">Folder type: <b>' + typeName + '</b></p>';
|
||||
|
||||
|
|
|
@ -62,9 +62,6 @@
|
|||
|
||||
if (currentPlayer) {
|
||||
currentPlayer.unMute();
|
||||
|
||||
$(this).hide();
|
||||
$('.muteButton', elem).show();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -72,9 +69,6 @@
|
|||
|
||||
if (currentPlayer) {
|
||||
currentPlayer.mute();
|
||||
|
||||
$(this).hide();
|
||||
$('.unmuteButton', elem).show();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -89,9 +83,6 @@
|
|||
|
||||
if (currentPlayer) {
|
||||
currentPlayer.pause();
|
||||
|
||||
$(this).hide();
|
||||
$('.unpauseButton', elem).show();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -99,9 +90,6 @@
|
|||
|
||||
if (currentPlayer) {
|
||||
currentPlayer.unpause();
|
||||
|
||||
$(this).hide();
|
||||
$('.pauseButton', elem).show();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -163,6 +151,14 @@
|
|||
|
||||
return elem;
|
||||
}
|
||||
|
||||
function showButton(button) {
|
||||
button.removeClass('hide');
|
||||
}
|
||||
|
||||
function hideButton(button) {
|
||||
button.addClass('hide');
|
||||
}
|
||||
|
||||
function updatePlayerState(state) {
|
||||
|
||||
|
@ -203,24 +199,24 @@
|
|||
|
||||
if (state.isMuted) {
|
||||
|
||||
muteButton.hide();
|
||||
unmuteButton.show();
|
||||
hideButton(muteButton);
|
||||
showButton(unmuteButton);
|
||||
|
||||
} else {
|
||||
|
||||
muteButton.show();
|
||||
unmuteButton.hide();
|
||||
showButton(muteButton);
|
||||
hideButton(unmuteButton);
|
||||
}
|
||||
|
||||
if (state.isPaused) {
|
||||
|
||||
pauseButton.hide();
|
||||
unpauseButton.show();
|
||||
hideButton(pauseButton);
|
||||
showButton(unpauseButton);
|
||||
|
||||
} else {
|
||||
|
||||
pauseButton.show();
|
||||
unpauseButton.hide();
|
||||
showButton(pauseButton);
|
||||
hideButton(unpauseButton);
|
||||
}
|
||||
|
||||
if (!isVolumeSliderActive) {
|
||||
|
@ -320,6 +316,8 @@
|
|||
|
||||
function onPlaybackStart(e, state) {
|
||||
|
||||
console.log('nowplaying event: ' + e.type);
|
||||
|
||||
var player = this;
|
||||
|
||||
player.beginPlayerUpdates();
|
||||
|
@ -343,6 +341,7 @@
|
|||
|
||||
function onPlaybackStopped(e, state) {
|
||||
|
||||
console.log('nowplaying event: ' + e.type);
|
||||
var player = this;
|
||||
|
||||
player.endPlayerUpdates();
|
||||
|
@ -352,6 +351,7 @@
|
|||
|
||||
function onStateChanged(e, state) {
|
||||
|
||||
//console.log('nowplaying event: ' + e.type);
|
||||
var player = this;
|
||||
|
||||
if (player.isDefaultPlayer && state.mediaType == 'Video') {
|
||||
|
@ -385,7 +385,7 @@
|
|||
player.beginPlayerUpdates();
|
||||
}
|
||||
|
||||
onStateChanged.call(player, null, state);
|
||||
onStateChanged.call(player, {type: 'init'}, state);
|
||||
});
|
||||
|
||||
$(player).on('playbackstart.nowplayingbar', onPlaybackStart)
|
||||
|
|
|
@ -230,7 +230,7 @@
|
|||
|
||||
$(page).append(html);
|
||||
|
||||
panel = $('#searchPanel', page).panel({}).trigger('create');
|
||||
panel = $('#searchPanel', page).panel({}).panel('option', 'classes.modalOpen', 'searchPanelModelOpen ui-panel-dismiss-open').trigger('create');
|
||||
|
||||
$('#txtSearch', panel).on("keyup", function (e) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue