mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
new media info display
This commit is contained in:
parent
1ae7b70f3c
commit
a61f2f4840
2 changed files with 87 additions and 68 deletions
|
@ -148,3 +148,25 @@
|
|||
max-width: 1000px;
|
||||
}
|
||||
}
|
||||
|
||||
.mediaInfoStream {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin-right: 2em;
|
||||
}
|
||||
|
||||
.mediaInfoStreamType {
|
||||
border-bottom: 1px solid #555;
|
||||
padding-bottom: 5px;
|
||||
margin-bottom: .5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.mediaInfoDetails {
|
||||
margin: 0 0 0 2em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.mediaInfoLabel {
|
||||
color: #bbb;
|
||||
}
|
||||
|
|
|
@ -456,21 +456,6 @@
|
|||
|
||||
var page = $.mobile.activePage;
|
||||
var html = '';
|
||||
var hasVideo = false;
|
||||
var hasLanguage = false;
|
||||
|
||||
html += '<table class="ui-responsive table-stroke" id="mediaInfo-table" data-role="table" data-mode="reflow">';
|
||||
html += '<thead><tr>';
|
||||
html += '<th data-priority="1">Type</th>';
|
||||
html += '<th data-priority="2">Codec</th>';
|
||||
html += '<th data-priority="3" class="language">Language</th>';
|
||||
html += '<th data-priority="4" class="resolution">Resolution</th>';
|
||||
html += '<th data-priority="6">Channels</th>';
|
||||
html += '<th data-priority="7">Bitrate</th>';
|
||||
html += '<th data-priority="8" class="framerate">Framerate</th>';
|
||||
html += '<th data-priority="9">Flags</th>';
|
||||
html += '</tr></thead>';
|
||||
html += '<tbody>';
|
||||
|
||||
for (var i = 0, length = item.MediaStreams.length; i < length; i++) {
|
||||
|
||||
|
@ -480,61 +465,73 @@
|
|||
continue;
|
||||
}
|
||||
|
||||
if (stream.Type == "Video") {
|
||||
hasVideo = true;
|
||||
var type;
|
||||
if (item.MediaType == "Audio" && stream.Type == "Video") {
|
||||
type = "Embedded Image";
|
||||
} else {
|
||||
type = stream.Type;
|
||||
}
|
||||
|
||||
if (item.MediaType == "Audio" && stream.Type == "Video") var type = "Embedded Image";
|
||||
else var type = stream.Type;
|
||||
html += '<div class="mediaInfoStream">';
|
||||
|
||||
html += '<tr>';
|
||||
html += '<td>' + type + '</td>';
|
||||
html += '<td>' + stream.Codec + '</td>';
|
||||
html += '<p class="mediaInfoStreamType">' + type + '</p>';
|
||||
|
||||
html += '<ul class="mediaInfoDetails">';
|
||||
|
||||
if (stream.Codec) {
|
||||
html += '<li><span class="mediaInfoLabel">Codec</span> ' + stream.Codec + '</li>';
|
||||
}
|
||||
if (stream.Profile) {
|
||||
html += '<li><span class="mediaInfoLabel">Profile</span> ' + stream.Profile + '</li>';
|
||||
}
|
||||
if (stream.Level) {
|
||||
html += '<li><span class="mediaInfoLabel">Level</span> ' + stream.Level + '</li>';
|
||||
}
|
||||
if (stream.Language) {
|
||||
hasLanguage = true;
|
||||
html += '<td class="language">' + stream.Language + '</td>';
|
||||
} else html += '<td class="language"></td>';
|
||||
|
||||
if (stream.Type == "Video") {
|
||||
html += '<td class="resolution">' + stream.Width + '/' + stream.Height + ' (' + stream.AspectRatio + ')</td>';
|
||||
} else {
|
||||
html += '<td class="resolution"></td>';
|
||||
html += '<li><span class="mediaInfoLabel">Language</span> ' + stream.Language + '</li>';
|
||||
}
|
||||
if (stream.Width) {
|
||||
html += '<li><span class="mediaInfoLabel">Width</span> ' + stream.Width + '</li>';
|
||||
}
|
||||
if (stream.Height) {
|
||||
html += '<li><span class="mediaInfoLabel">Height</span> ' + stream.Height + '</li>';
|
||||
}
|
||||
if (stream.AspectRatio) {
|
||||
html += '<li><span class="mediaInfoLabel">Aspect Ratio</span> ' + stream.AspectRatio + '</li>';
|
||||
}
|
||||
if (stream.Bitrate) {
|
||||
html += '<li><span class="mediaInfoLabel">Bitrate</span> ' + stream.Bitrate + '</li>';
|
||||
}
|
||||
|
||||
if (stream.Channels) {
|
||||
html += '<td>' + stream.Channels + 'ch ' + stream.SampleRate + ' khz</td>';
|
||||
} else {
|
||||
html += '<td></td>';
|
||||
html += '<li><span class="mediaInfoLabel">Channels</span> ' + stream.Channels + '</li>';
|
||||
}
|
||||
|
||||
html += '<td>' + stream.BitRate + '</td>';
|
||||
|
||||
if (stream.Type == "Video") {
|
||||
var framerate = stream.AverageFrameRate || stream.RealFrameRate;
|
||||
html += '<td class="framerate">' + framerate + '</td>';
|
||||
} else {
|
||||
html += '<td></td>';
|
||||
|
||||
if (framerate) {
|
||||
html += '<li><span class="mediaInfoLabel">Framerate</span> ' + framerate + '</li>';
|
||||
}
|
||||
|
||||
var notes = new Array();
|
||||
if (stream.IsExternal) notes.push("external file");
|
||||
if (stream.IsDefault) notes.push("Default");
|
||||
if (stream.IsForced) notes.push("Forced");
|
||||
|
||||
html += '<td>' + notes.join(', ') + '</td>';
|
||||
|
||||
html += '</tr>';
|
||||
if (stream.IsDefault) {
|
||||
html += '<li>Default</li>';
|
||||
}
|
||||
if (stream.IsForced) {
|
||||
html += '<li>Forced</li>';
|
||||
}
|
||||
if (stream.IsExternal) {
|
||||
html += '<li>External</li>';
|
||||
}
|
||||
if (stream.Path) {
|
||||
html += '<li><span class="mediaInfoLabel">Path</span> ' + stream.Path + '</li>';
|
||||
}
|
||||
|
||||
html += '</tbody></table>';
|
||||
html += '</ul>';
|
||||
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
$('#mediaInfoContent', page).html(html).trigger('create');
|
||||
if (!hasLanguage) $('#mediaInfoCollapsible #mediaInfo-table .language', page).hide();
|
||||
if (!hasVideo) {
|
||||
$('#mediaInfoCollapsible #mediaInfo-table .resolution', page).hide();
|
||||
$('#mediaInfoCollapsible #mediaInfo-table .framerate', page).hide();
|
||||
}
|
||||
|
||||
$('#mediaInfoCollapsible', page).show();
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue