mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
support turning off subtitles
This commit is contained in:
parent
00d9a83ac7
commit
7e45bd999d
5 changed files with 41 additions and 29 deletions
|
@ -273,55 +273,55 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.channelList, .programGrid {
|
.channelList, .programGrid {
|
||||||
height: 200px;
|
height: 220px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-height: 500px) {
|
@media (min-height: 500px) {
|
||||||
|
|
||||||
.channelList, .programGrid {
|
.channelList, .programGrid {
|
||||||
height: 250px;
|
height: 290px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-height: 600px) {
|
@media (min-height: 600px) {
|
||||||
|
|
||||||
.channelList, .programGrid {
|
.channelList, .programGrid {
|
||||||
height: 350px;
|
height: 390px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-height: 700px) {
|
@media (min-height: 700px) {
|
||||||
|
|
||||||
.channelList, .programGrid {
|
.channelList, .programGrid {
|
||||||
height: 450px;
|
height: 490px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-height: 800px) {
|
@media (min-height: 800px) {
|
||||||
|
|
||||||
.channelList, .programGrid {
|
.channelList, .programGrid {
|
||||||
height: 550px;
|
height: 590px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-height: 900px) {
|
@media (min-height: 900px) {
|
||||||
|
|
||||||
.channelList, .programGrid {
|
.channelList, .programGrid {
|
||||||
height: 650px;
|
height: 690px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-height: 1000px) {
|
@media (min-height: 1000px) {
|
||||||
|
|
||||||
.channelList, .programGrid {
|
.channelList, .programGrid {
|
||||||
height: 750px;
|
height: 790px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-height: 1100px) {
|
@media (min-height: 1100px) {
|
||||||
|
|
||||||
.channelList, .programGrid {
|
.channelList, .programGrid {
|
||||||
height: 850px;
|
height: 890px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="#" data-role="button" class="ui-btn-active">Media Folders</a>
|
<a href="#" data-role="button" class="ui-btn-active">Media Folders</a>
|
||||||
<a href="librarypathmapping.html" data-role="button">Path Mapping</a>
|
<a href="librarypathmapping.html" data-role="button">Path Mapping</a>
|
||||||
<a href="librarysettings.html" data-role="button">Other Settings</a>
|
<a href="librarysettings.html" data-role="button">Advanced</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="readOnlyContent">
|
<div class="readOnlyContent">
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="library.html" data-role="button">Media Folders</a>
|
<a href="library.html" data-role="button">Media Folders</a>
|
||||||
<a href="#" data-role="button" class="ui-btn-active">Path Mapping</a>
|
<a href="#" data-role="button" class="ui-btn-active">Path Mapping</a>
|
||||||
<a href="librarysettings.html" data-role="button">Other Settings</a>
|
<a href="librarysettings.html" data-role="button">Advanced</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="libraryPathMappingForm">
|
<form id="libraryPathMappingForm">
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
|
||||||
<a href="library.html" data-role="button">Media Folders</a>
|
<a href="library.html" data-role="button">Media Folders</a>
|
||||||
<a href="librarypathmapping.html" data-role="button">Path Mapping</a>
|
<a href="librarypathmapping.html" data-role="button">Path Mapping</a>
|
||||||
<a href="#" data-role="button" class="ui-btn-active">Other Settings</a>
|
<a href="#" data-role="button" class="ui-btn-active">Advanced</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form id="librarySettingsForm">
|
<form id="librarySettingsForm">
|
||||||
|
|
|
@ -180,9 +180,9 @@
|
||||||
currentProgressInterval = null;
|
currentProgressInterval = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function canPlayWebm() {
|
function canPlayWebm() {
|
||||||
|
|
||||||
return testableVideoElement.canPlayType('video/webm').replace(/no/, '');
|
return testableVideoElement.canPlayType('video/webm').replace(/no/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,12 +218,12 @@
|
||||||
|
|
||||||
var currentSrc = element.currentSrc;
|
var currentSrc = element.currentSrc;
|
||||||
currentSrc = replaceQueryString(currentSrc, 'starttimeticks', ticks);
|
currentSrc = replaceQueryString(currentSrc, 'starttimeticks', ticks);
|
||||||
|
|
||||||
if (params.AudioStreamIndex != null) {
|
if (params.AudioStreamIndex != null) {
|
||||||
currentSrc = replaceQueryString(currentSrc, 'AudioStreamIndex', params.AudioStreamIndex);
|
currentSrc = replaceQueryString(currentSrc, 'AudioStreamIndex', params.AudioStreamIndex);
|
||||||
}
|
}
|
||||||
if (params.SubtitleStreamIndex != null) {
|
if (params.SubtitleStreamIndex != null) {
|
||||||
currentSrc = replaceQueryString(currentSrc, 'SubtitleStreamIndex', params.SubtitleStreamIndex);
|
currentSrc = replaceQueryString(currentSrc, 'SubtitleStreamIndex', (params.SubtitleStreamIndex == -1 ? '' : params.SubtitleStreamIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
var maxWidth = params.MaxWidth || getParameterByName('MaxWidth', currentSrc);
|
var maxWidth = params.MaxWidth || getParameterByName('MaxWidth', currentSrc);
|
||||||
|
@ -539,7 +539,7 @@
|
||||||
console.log('Transcoding because the content is not a video file');
|
console.log('Transcoding because the content is not a video file');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((videoStream.Codec || '').toLowerCase().indexOf('h264') == -1) {
|
if ((videoStream.Codec || '').toLowerCase().indexOf('h264') == -1) {
|
||||||
console.log('Transcoding because the content is not h264');
|
console.log('Transcoding because the content is not h264');
|
||||||
return false;
|
return false;
|
||||||
|
@ -554,15 +554,15 @@
|
||||||
console.log('Transcoding because subtitles are required');
|
console.log('Transcoding because subtitles are required');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!videoStream.Width || videoStream.Width > maxWidth) {
|
if (!videoStream.Width || videoStream.Width > maxWidth) {
|
||||||
console.log('Transcoding because resolution is too high');
|
console.log('Transcoding because resolution is too high');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var videoBitrate = videoStream.BitRate || 0;
|
var videoBitrate = videoStream.BitRate || 0;
|
||||||
var audioBitrate = audioStream ? audioStream.BitRate || 0 : null;
|
var audioBitrate = audioStream ? audioStream.BitRate || 0 : null;
|
||||||
|
|
||||||
if ((videoBitrate + audioBitrate) > bitrate) {
|
if ((videoBitrate + audioBitrate) > bitrate) {
|
||||||
console.log('Transcoding because bitrate is too high');
|
console.log('Transcoding because bitrate is too high');
|
||||||
return false;
|
return false;
|
||||||
|
@ -682,9 +682,9 @@
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
var subtitleStream = (item.MediaStreams || []).filter(function (stream) {
|
var subtitleStream = (item.MediaStreams || []).filter(function (stream) {
|
||||||
return stream.Index === subtitleStreamIndex ;
|
return stream.Index === subtitleStreamIndex;
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
var canPlayDirect = canPlayVideoDirect(item, videoStream, audioStream, subtitleStream, maxWidth, bitrate);
|
var canPlayDirect = canPlayVideoDirect(item, videoStream, audioStream, subtitleStream, maxWidth, bitrate);
|
||||||
|
|
||||||
var audioBitrate = bitrate >= 700000 ? 128000 : 64000;
|
var audioBitrate = bitrate >= 700000 ? 128000 : 64000;
|
||||||
|
@ -897,7 +897,7 @@
|
||||||
console.log('Html5 Video error code: ' + errorCode);
|
console.log('Html5 Video error code: ' + errorCode);
|
||||||
|
|
||||||
var errorMsg = 'There was an error playing the video.';
|
var errorMsg = 'There was an error playing the video.';
|
||||||
|
|
||||||
if (item.Type == "Channel") {
|
if (item.Type == "Channel") {
|
||||||
errorMsg += " Please ensure there is an open tuner availalble.";
|
errorMsg += " Please ensure there is an open tuner availalble.";
|
||||||
}
|
}
|
||||||
|
@ -1007,7 +1007,7 @@
|
||||||
if (!user.Configuration.EnableMediaPlayback) {
|
if (!user.Configuration.EnableMediaPlayback) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.LocationType == "Virtual") {
|
if (item.LocationType == "Virtual") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1488,7 +1488,7 @@
|
||||||
self.playById(id);
|
self.playById(id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) {
|
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) {
|
||||||
|
|
||||||
if (item.IsFolder) {
|
if (item.IsFolder) {
|
||||||
|
@ -1781,6 +1781,11 @@
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
|
streams.unshift({
|
||||||
|
Index: -1,
|
||||||
|
Language: "Off"
|
||||||
|
});
|
||||||
|
|
||||||
for (var i = 0, length = streams.length; i < length; i++) {
|
for (var i = 0, length = streams.length; i < length; i++) {
|
||||||
|
|
||||||
var stream = streams[i];
|
var stream = streams[i];
|
||||||
|
@ -1791,13 +1796,22 @@
|
||||||
html += '<div data-index="' + stream.Index + '" class="mediaFlyoutOption">';
|
html += '<div data-index="' + stream.Index + '" class="mediaFlyoutOption">';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '<img class="mediaFlyoutOptionImage" src="css/images/media/subtitleflyout.png" />';
|
if (stream.Index != -1) {
|
||||||
|
html += '<img class="mediaFlyoutOptionImage" src="css/images/media/subtitleflyout.png" />';
|
||||||
|
} else {
|
||||||
|
html += '<div class="mediaFlyoutOptionImage"></div>';
|
||||||
|
}
|
||||||
|
|
||||||
html += '<div class="mediaFlyoutOptionContent">';
|
html += '<div class="mediaFlyoutOptionContent">';
|
||||||
|
|
||||||
var language = null;
|
var language = null;
|
||||||
|
var options = [];
|
||||||
|
|
||||||
if (stream.Language && stream.Language != "und") {
|
if (stream.Language == "Off") {
|
||||||
|
language = "Off";
|
||||||
|
options.push(' ');
|
||||||
|
}
|
||||||
|
else if (stream.Language && stream.Language != "und") {
|
||||||
|
|
||||||
var culture = cultures.filter(function (current) {
|
var culture = cultures.filter(function (current) {
|
||||||
return current.ThreeLetterISOLanguageName.toLowerCase() == stream.Language.toLowerCase();
|
return current.ThreeLetterISOLanguageName.toLowerCase() == stream.Language.toLowerCase();
|
||||||
|
@ -1810,8 +1824,6 @@
|
||||||
|
|
||||||
html += '<div class="mediaFlyoutOptionName">' + (language || 'Unknown language') + '</div>';
|
html += '<div class="mediaFlyoutOptionName">' + (language || 'Unknown language') + '</div>';
|
||||||
|
|
||||||
var options = [];
|
|
||||||
|
|
||||||
if (stream.Codec) {
|
if (stream.Codec) {
|
||||||
options.push(stream.Codec);
|
options.push(stream.Codec);
|
||||||
}
|
}
|
||||||
|
@ -1860,7 +1872,7 @@
|
||||||
if (isStatic) {
|
if (isStatic) {
|
||||||
options[0].name = "Direct";
|
options[0].name = "Direct";
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i = 0, length = options.length; i < length; i++) {
|
for (var i = 0, length = options.length; i < length; i++) {
|
||||||
|
|
||||||
var option = options[i];
|
var option = options[i];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue