mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update desktop video player osd
This commit is contained in:
parent
8f71cd9871
commit
f13e19c928
4 changed files with 18 additions and 5 deletions
|
@ -148,7 +148,7 @@
|
|||
}
|
||||
|
||||
.videoNowPlayingName {
|
||||
font-size: 22px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.videoNowPlayingOverview, .videoNowPlayingRating {
|
||||
|
@ -221,7 +221,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@media all and (max-width: 800px), all and (max-height: 600px) {
|
||||
@media all and (max-width: 1400px), all and (max-height: 800px) {
|
||||
|
||||
#mediaPlayer .nowPlayingInfo {
|
||||
display: none !important;
|
||||
|
@ -252,7 +252,7 @@
|
|||
#videoPlayer .nowPlayingImage img {
|
||||
height: auto !important;
|
||||
max-width: 400px;
|
||||
max-height: 280px;
|
||||
max-height: 240px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,6 +135,8 @@
|
|||
.on('play', onPlay)
|
||||
.on('pause', onPause)
|
||||
.on('playing', onPlaying)
|
||||
.on('click', onClick)
|
||||
.on('dblclick', onDblClick)
|
||||
.on('error', onError)[0];
|
||||
}
|
||||
|
||||
|
|
|
@ -395,7 +395,7 @@
|
|||
var chapterIndex = 0;
|
||||
html += item.Chapters.map(function (c) {
|
||||
|
||||
var width = 320;
|
||||
var width = 240;
|
||||
var chapterHtml = '<a class="card backdropCard chapterCard" href="#" style="margin-right:1em;width:' + width + 'px;" data-position="' + c.StartPositionTicks + '">';
|
||||
chapterHtml += '<div class="cardBox">';
|
||||
chapterHtml += '<div class="cardScalable">';
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
var currentPlayer;
|
||||
var lastPlayerState;
|
||||
var lastUpdateTime;
|
||||
|
||||
function updatePlayerState(state, eventName) {
|
||||
|
||||
|
@ -29,6 +30,7 @@
|
|||
var album = state.NowPlayingItem.Album || '';
|
||||
var duration = state.NowPlayingItem.RunTimeTicks ? (state.NowPlayingItem.RunTimeTicks / 10000000) : 0;
|
||||
var position = playState.PositionTicks ? (playState.PositionTicks / 10000000) : 0;
|
||||
var itemId = state.NowPlayingItem.Id;
|
||||
|
||||
var isPaused = playState.IsPaused || false;
|
||||
var canSeek = playState.CanSeek || false;
|
||||
|
@ -64,7 +66,16 @@
|
|||
|
||||
}
|
||||
|
||||
MainActivity.updateMediaSession(eventName, title, artist, album, parseInt(duration), parseInt(position), url, canSeek, isPaused);
|
||||
// Don't go crazy reporting position changes
|
||||
if (eventName == 'positionchange') {
|
||||
var time = new Date().getTime();
|
||||
if ((time - lastUpdateTime) < 500) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
MainActivity.updateMediaSession(eventName, itemId, title, artist, album, parseInt(duration), parseInt(position), url, canSeek, isPaused);
|
||||
lastUpdateTime = new Date().getTime();
|
||||
}
|
||||
|
||||
function onStateChanged(e, state) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue