From fc4f9788facc3bc953cc075c0446f9fe024193c3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 16 Sep 2014 23:04:10 -0400 Subject: [PATCH] adjust discovery of local ip addresses --- dashboard-ui/mypreferenceswebclient.html | 4 +-- dashboard-ui/scripts/externalplayer.js | 31 +++++++++++++++++------- dashboard-ui/scripts/useredit.js | 2 +- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/dashboard-ui/mypreferenceswebclient.html b/dashboard-ui/mypreferenceswebclient.html index b7a1c73ed..34bc5884b 100644 --- a/dashboard-ui/mypreferenceswebclient.html +++ b/dashboard-ui/mypreferenceswebclient.html @@ -135,8 +135,8 @@
${LabelExternalPlayers} - - +
diff --git a/dashboard-ui/scripts/externalplayer.js b/dashboard-ui/scripts/externalplayer.js index 10b762527..f3f11b9b4 100644 --- a/dashboard-ui/scripts/externalplayer.js +++ b/dashboard-ui/scripts/externalplayer.js @@ -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 { maxVideoAudioChannels: 6, maxAudioChannels: 2, maxVideoLevel: 50, - maxWidth: 1920, - maxHeight: 1080, + maxWidth: maxWidth, maxSampleRate: 48000 }; @@ -31,7 +41,7 @@ return false; } - var codecLimits = getCodecLimits(); + var codecLimits = getCodecLimits(maxBitrate); if (mediaType == "Audio") { @@ -49,6 +59,10 @@ return false; } + if (videoStream.Width && videoStream.Width > codecLimits.maxWidth) { + return false; + } + if (mediaSource.VideoType != 'VideoFile') { return false; } @@ -59,7 +73,7 @@ throw new Error('Unrecognized MediaType'); } - function canPlayAudioStreamDirect(audioStream, isVideo) { + function canPlayAudioStreamDirect(audioStream, isVideo, maxBitrate) { var audioCodec = (audioStream.Codec || '').toLowerCase().replace('-', ''); @@ -70,7 +84,7 @@ return false; } - var codecLimits = getCodecLimits(); + var codecLimits = getCodecLimits(maxBitrate); var maxChannels = isVideo ? codecLimits.maxVideoAudioChannels : codecLimits.maxAudioChannels; @@ -159,7 +173,7 @@ var audioStream = m.audioStream; - if (!audioStream || !canPlayAudioStreamDirect(audioStream, item.MediaType == 'Video')) { + if (!audioStream || !canPlayAudioStreamDirect(audioStream, item.MediaType == 'Video', maxBitrate)) { return false; } @@ -217,7 +231,7 @@ var url; - var codecLimits = getCodecLimits(); + var codecLimits = getCodecLimits(maxBitrate); if (mediaType == 'Audio') { @@ -268,7 +282,6 @@ url += '&level=41'; url += '&maxwidth=' + codecLimits.maxWidth; - url += '&maxheight=' + codecLimits.maxHeight; url += '&videoCodec=h264'; url += '&audioCodec=aac'; diff --git a/dashboard-ui/scripts/useredit.js b/dashboard-ui/scripts/useredit.js index 5bbb7169e..e376d12f7 100644 --- a/dashboard-ui/scripts/useredit.js +++ b/dashboard-ui/scripts/useredit.js @@ -21,7 +21,7 @@ } if (user.Id && loggedInUser.Configuration.IsAdministrator) { - $('#fldConnectInfo', page).show(); + $('#fldConnectInfo', page).hide(); } else { $('#fldConnectInfo', page).hide(); }