1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

adjust discovery of local ip addresses

This commit is contained in:
Luke Pulverenti 2014-09-16 23:04:10 -04:00
parent 6a1701ff3c
commit fc4f9788fa
3 changed files with 25 additions and 12 deletions

View file

@ -135,8 +135,8 @@
<div style="margin: 0 1em;"> <div style="margin: 0 1em;">
<fieldset data-role="controlgroup"> <fieldset data-role="controlgroup">
<legend>${LabelExternalPlayers}</legend> <legend>${LabelExternalPlayers}</legend>
<input type="checkbox" id="chkGoodplayer" class="chkExternalPlayer" data-name="GoodPlayer" data-scheme="goodplayer://{0}" /> <!--<input type="checkbox" id="chkGoodplayer" class="chkExternalPlayer" data-name="GoodPlayer" data-scheme="goodplayer://{0}" />
<label for="chkGoodplayer">GoodPlayer</label> <label for="chkGoodplayer">GoodPlayer</label>-->
<input type="checkbox" id="chkVlc" class="chkExternalPlayer" data-name="Vlc" data-scheme="vlc://{0}" /> <input type="checkbox" id="chkVlc" class="chkExternalPlayer" data-name="Vlc" data-scheme="vlc://{0}" />
<label for="chkVlc">Vlc</label> <label for="chkVlc">Vlc</label>
</fieldset> </fieldset>

View file

@ -10,15 +10,25 @@
} }
function getCodecLimits() { function getCodecLimits(maxBitrate) {
var maxWidth;
if (maxBitrate <= 1000000) {
maxWidth = 720;
}
else if (maxBitrate <= 5000000) {
maxWidth = 1280;
} else {
maxWidth = 1280;
}
return { return {
maxVideoAudioChannels: 6, maxVideoAudioChannels: 6,
maxAudioChannels: 2, maxAudioChannels: 2,
maxVideoLevel: 50, maxVideoLevel: 50,
maxWidth: 1920, maxWidth: maxWidth,
maxHeight: 1080,
maxSampleRate: 48000 maxSampleRate: 48000
}; };
@ -31,7 +41,7 @@
return false; return false;
} }
var codecLimits = getCodecLimits(); var codecLimits = getCodecLimits(maxBitrate);
if (mediaType == "Audio") { if (mediaType == "Audio") {
@ -49,6 +59,10 @@
return false; return false;
} }
if (videoStream.Width && videoStream.Width > codecLimits.maxWidth) {
return false;
}
if (mediaSource.VideoType != 'VideoFile') { if (mediaSource.VideoType != 'VideoFile') {
return false; return false;
} }
@ -59,7 +73,7 @@
throw new Error('Unrecognized MediaType'); throw new Error('Unrecognized MediaType');
} }
function canPlayAudioStreamDirect(audioStream, isVideo) { function canPlayAudioStreamDirect(audioStream, isVideo, maxBitrate) {
var audioCodec = (audioStream.Codec || '').toLowerCase().replace('-', ''); var audioCodec = (audioStream.Codec || '').toLowerCase().replace('-', '');
@ -70,7 +84,7 @@
return false; return false;
} }
var codecLimits = getCodecLimits(); var codecLimits = getCodecLimits(maxBitrate);
var maxChannels = isVideo ? codecLimits.maxVideoAudioChannels : codecLimits.maxAudioChannels; var maxChannels = isVideo ? codecLimits.maxVideoAudioChannels : codecLimits.maxAudioChannels;
@ -159,7 +173,7 @@
var audioStream = m.audioStream; var audioStream = m.audioStream;
if (!audioStream || !canPlayAudioStreamDirect(audioStream, item.MediaType == 'Video')) { if (!audioStream || !canPlayAudioStreamDirect(audioStream, item.MediaType == 'Video', maxBitrate)) {
return false; return false;
} }
@ -217,7 +231,7 @@
var url; var url;
var codecLimits = getCodecLimits(); var codecLimits = getCodecLimits(maxBitrate);
if (mediaType == 'Audio') { if (mediaType == 'Audio') {
@ -268,7 +282,6 @@
url += '&level=41'; url += '&level=41';
url += '&maxwidth=' + codecLimits.maxWidth; url += '&maxwidth=' + codecLimits.maxWidth;
url += '&maxheight=' + codecLimits.maxHeight;
url += '&videoCodec=h264'; url += '&videoCodec=h264';
url += '&audioCodec=aac'; url += '&audioCodec=aac';

View file

@ -21,7 +21,7 @@
} }
if (user.Id && loggedInUser.Configuration.IsAdministrator) { if (user.Id && loggedInUser.Configuration.IsAdministrator) {
$('#fldConnectInfo', page).show(); $('#fldConnectInfo', page).hide();
} else { } else {
$('#fldConnectInfo', page).hide(); $('#fldConnectInfo', page).hide();
} }