mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
bump dev version
This commit is contained in:
parent
6daced8387
commit
48a576778f
2
dashboard-ui/css/materialize.css
vendored
2
dashboard-ui/css/materialize.css
vendored
@ -119,7 +119,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
padding: .6em 2em;
|
padding: .6em 1.6em .6em 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-large {
|
.btn-large {
|
||||||
|
@ -252,7 +252,7 @@
|
|||||||
#videoPlayer .nowPlayingImage img {
|
#videoPlayer .nowPlayingImage img {
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
max-height: 300px;
|
max-height: 280px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="displayPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderPreferences}">
|
<div id="displayPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderPreferences}" data-require="scripts/mypreferencesdisplay,scripts/mypreferencescommon">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="#" class="ui-btn-active lnkDisplayPreferences">${TabDisplay}</a>
|
<a href="#" class="ui-btn-active lnkDisplayPreferences">${TabDisplay}</a>
|
||||||
<a href="#" class="lnkLanguagePreferences">${TabPlayback}</a>
|
<a href="#" class="lnkLanguagePreferences">${TabPlayback}</a>
|
||||||
@ -147,9 +147,6 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
<script type="text/javascript">
|
|
||||||
$('.displayPreferencesForm').off('submit', DisplayPreferencesPage.onSubmit).on('submit', DisplayPreferencesPage.onSubmit);
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="languagePreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderPreferences}">
|
<div id="languagePreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderPreferences}" data-require="scripts/mypreferenceslanguages,scripts/mypreferencescommon">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
||||||
<a href="#" class="ui-btn-active lnkLanguagePreferences">${TabPlayback}</a>
|
<a href="#" class="ui-btn-active lnkLanguagePreferences">${TabPlayback}</a>
|
||||||
@ -82,9 +82,6 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
<script type="text/javascript">
|
|
||||||
$('.languagePreferencesForm').off('submit', LanguagePreferencesPage.onSubmit).on('submit', LanguagePreferencesPage.onSubmit);
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="webClientPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderPreferences}">
|
<div id="webClientPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderPreferences}" data-require="scripts/mypreferenceswebclient,scripts/mypreferencescommon">
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
||||||
<a href="#" class="lnkLanguagePreferences">${TabPlayback}</a>
|
<a href="#" class="lnkLanguagePreferences">${TabPlayback}</a>
|
||||||
@ -150,6 +150,18 @@
|
|||||||
<option value="192000">192kbps</option>
|
<option value="192000">192kbps</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<div>
|
||||||
|
<fieldset data-role="controlgroup">
|
||||||
|
<legend>${LabelExternalPlayers}</legend>
|
||||||
|
<input type="checkbox" id="chkExternalVideoPlayer" />
|
||||||
|
<label for="chkExternalVideoPlayer">${OptionEnableExternalVideoPlayers}</label>
|
||||||
|
</fieldset>
|
||||||
|
<div style="padding: 0 2px;display:none;" class="labelGenericExternalPlayers">${LabelExternalPlayersHelp}</div>
|
||||||
|
<div style="padding: 0 2px;display:none;" class="labelNativeExternalPlayers">${LabelNativeExternalPlayersHelp}</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
<br />
|
<br />
|
||||||
<div>
|
<div>
|
||||||
<label for="selectThemeSong">${LabelEnableThemeSongs}</label>
|
<label for="selectThemeSong">${LabelEnableThemeSongs}</label>
|
||||||
@ -180,17 +192,6 @@
|
|||||||
</select>
|
</select>
|
||||||
<div>${LabelEnableItemPreviewsHelp}</div>
|
<div>${LabelEnableItemPreviewsHelp}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br />
|
|
||||||
<div>
|
|
||||||
<fieldset data-role="controlgroup">
|
|
||||||
<legend>${LabelExternalPlayers}</legend>
|
|
||||||
<input type="checkbox" id="chkExternalVideoPlayer" />
|
|
||||||
<label for="chkExternalVideoPlayer">${OptionEnableExternalVideoPlayers}</label>
|
|
||||||
</fieldset>
|
|
||||||
<div style="padding: 0 2px;display:none;" class="labelGenericExternalPlayers">${LabelExternalPlayersHelp}</div>
|
|
||||||
<div style="padding: 0 2px;display:none;" class="labelNativeExternalPlayers">${LabelNativeExternalPlayersHelp}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -206,9 +207,6 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
$('.webClientPreferencesForm').off('submit', WebClientPreferencesPage.onSubmit).on('submit', WebClientPreferencesPage.onSubmit);
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -4,7 +4,7 @@
|
|||||||
<title>Emby</title>
|
<title>Emby</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="userImagePage" data-role="page" class="page libraryPage userPreferencesPage userPasswordPage" data-contextname="${HeaderPreferences}">
|
<div id="userImagePage" data-role="page" class="page libraryPage userPreferencesPage userPasswordPage" data-contextname="${HeaderPreferences}" data-require="scripts/myprofile,scripts/mypreferencescommon">
|
||||||
|
|
||||||
<div class="libraryViewNav">
|
<div class="libraryViewNav">
|
||||||
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
||||||
@ -124,11 +124,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
|
||||||
$('.newImageForm').off('submit', MyProfilePage.onImageSubmit).on('submit', MyProfilePage.onImageSubmit);
|
|
||||||
$('.updatePasswordForm').off('submit', UpdatePasswordPage.onSubmit).on('submit', UpdatePasswordPage.onSubmit);
|
|
||||||
$('.localAccessForm').off('submit', UpdatePasswordPage.onLocalAccessSubmit).on('submit', UpdatePasswordPage.onLocalAccessSubmit);
|
|
||||||
</script>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
55
dashboard-ui/scripts/appsettings.js
Normal file
55
dashboard-ui/scripts/appsettings.js
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
(function (window, store) {
|
||||||
|
|
||||||
|
function update(key, val) {
|
||||||
|
store.setItem(key, val);
|
||||||
|
|
||||||
|
Events.trigger(AppSettings, 'settingupdated', [key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.AppSettings = {
|
||||||
|
|
||||||
|
maxStreamingBitrate: function (val) {
|
||||||
|
|
||||||
|
if (val != null) {
|
||||||
|
update('preferredVideoBitrate', val);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parseInt(store.getItem('preferredVideoBitrate') || '') || 1500000;
|
||||||
|
},
|
||||||
|
maxChromecastBitrate: function (val) {
|
||||||
|
|
||||||
|
if (val != null) {
|
||||||
|
update('chromecastBitrate', val);
|
||||||
|
}
|
||||||
|
|
||||||
|
return parseInt(store.getItem('chromecastBitrate') || '') || 3000000;
|
||||||
|
},
|
||||||
|
enableExternalPlayers: function (val) {
|
||||||
|
|
||||||
|
if (val != null) {
|
||||||
|
update('externalplayers', val.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return store.getItem('externalplayers') == 'true';
|
||||||
|
},
|
||||||
|
enableItemPreviews: function (val) {
|
||||||
|
|
||||||
|
if (val != null) {
|
||||||
|
update('enableItemPreviews', val.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return store.getItem('enableItemPreviews') != 'false';
|
||||||
|
},
|
||||||
|
enableFullScreen: function (val) {
|
||||||
|
|
||||||
|
if (val != null) {
|
||||||
|
update('enableFullScreen', val.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return store.getItem('enableFullScreen') == 'true';
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
})(window, window.appStorage);
|
@ -128,6 +128,10 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($.browser.android && Dashboard.isRunningInCordova()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if ($.browser.mobile) {
|
if ($.browser.mobile) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -28,11 +28,11 @@
|
|||||||
|
|
||||||
var PlayerName = 'Chromecast';
|
var PlayerName = 'Chromecast';
|
||||||
|
|
||||||
//var applicationID = "2D4B1DA3";
|
var applicationID = "2D4B1DA3";
|
||||||
//var messageNamespace = 'urn:x-cast:com.connectsdk';
|
var messageNamespace = 'urn:x-cast:com.connectsdk';
|
||||||
|
|
||||||
var applicationID = "F4EB2E8E";
|
//var applicationID = "F4EB2E8E";
|
||||||
var messageNamespace = 'urn:x-cast:com.google.cast.mediabrowser.v3';
|
//var messageNamespace = 'urn:x-cast:com.google.cast.mediabrowser.v3';
|
||||||
|
|
||||||
var CastPlayer = function () {
|
var CastPlayer = function () {
|
||||||
|
|
||||||
|
@ -631,7 +631,7 @@
|
|||||||
takeTour(page, Dashboard.getCurrentUserId());
|
takeTour(page, Dashboard.getCurrentUserId());
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshowready', "#indexPage", function () {
|
}).on('pageshowready', "#indexPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -130,6 +130,7 @@
|
|||||||
triggerPlayerChange(player, targetInfo);
|
triggerPlayerChange(player, targetInfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var currentPairingId = null;
|
||||||
self.trySetActivePlayer = function (player, targetInfo) {
|
self.trySetActivePlayer = function (player, targetInfo) {
|
||||||
|
|
||||||
if (typeof (player) === 'string') {
|
if (typeof (player) === 'string') {
|
||||||
@ -142,6 +143,12 @@
|
|||||||
throw new Error('null player');
|
throw new Error('null player');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentPairingId == targetInfo.id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentPairingId = targetInfo.id;
|
||||||
|
|
||||||
player.tryPair(targetInfo).done(function () {
|
player.tryPair(targetInfo).done(function () {
|
||||||
|
|
||||||
currentPlayer = player;
|
currentPlayer = player;
|
||||||
|
@ -45,8 +45,8 @@
|
|||||||
|
|
||||||
if (document.exitFullscreen) {
|
if (document.exitFullscreen) {
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
} else if (document.mozExitFullScreen) {
|
} else if (document.mozCancelFullScreen) {
|
||||||
document.mozExitFullScreen();
|
document.mozCancelFullScreen();
|
||||||
} else if (document.webkitExitFullscreen) {
|
} else if (document.webkitExitFullscreen) {
|
||||||
document.webkitExitFullscreen();
|
document.webkitExitFullscreen();
|
||||||
} else if (document.msExitFullscreen) {
|
} else if (document.msExitFullscreen) {
|
||||||
@ -396,7 +396,7 @@
|
|||||||
var chapterIndex = 0;
|
var chapterIndex = 0;
|
||||||
html += item.Chapters.map(function (c) {
|
html += item.Chapters.map(function (c) {
|
||||||
|
|
||||||
var width = 360;
|
var width = 320;
|
||||||
var chapterHtml = '<a class="card backdropCard chapterCard" href="#" style="margin-right:1em;width:' + width + 'px;" data-position="' + c.StartPositionTicks + '">';
|
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="cardBox">';
|
||||||
chapterHtml += '<div class="cardScalable">';
|
chapterHtml += '<div class="cardScalable">';
|
||||||
@ -445,11 +445,12 @@
|
|||||||
var personHtml = '<div class="tileItem smallPosterTileItem" style="width:300px;">';
|
var personHtml = '<div class="tileItem smallPosterTileItem" style="width:300px;">';
|
||||||
|
|
||||||
var imgUrl;
|
var imgUrl;
|
||||||
|
var height = 160;
|
||||||
|
|
||||||
if (cast.PrimaryImageTag) {
|
if (cast.PrimaryImageTag) {
|
||||||
|
|
||||||
imgUrl = ApiClient.getScaledImageUrl(cast.Id, {
|
imgUrl = ApiClient.getScaledImageUrl(cast.Id, {
|
||||||
height: 160,
|
height: height,
|
||||||
tag: cast.PrimaryImageTag,
|
tag: cast.PrimaryImageTag,
|
||||||
type: "primary",
|
type: "primary",
|
||||||
minScale: 2
|
minScale: 2
|
||||||
@ -460,7 +461,7 @@
|
|||||||
imgUrl = "css/images/items/list/person.png";
|
imgUrl = "css/images/items/list/person.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
personHtml += '<div class="tileImage lazy" data-src="' + imgUrl + '" style="height:160px;"></div>';
|
personHtml += '<div class="tileImage lazy" data-src="' + imgUrl + '" style="height:' + height + 'px;"></div>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -623,7 +624,7 @@
|
|||||||
idleState = true;
|
idleState = true;
|
||||||
$('.hiddenOnIdle').addClass("inactive");
|
$('.hiddenOnIdle').addClass("inactive");
|
||||||
$('#videoPlayer').addClass('idlePlayer');
|
$('#videoPlayer').addClass('idlePlayer');
|
||||||
}, 5000);
|
}, 4000);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateVolumeButtons(vol) {
|
function updateVolumeButtons(vol) {
|
||||||
@ -1317,10 +1318,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
self.updatePlaylistUi = function () {
|
self.updatePlaylistUi = function () {
|
||||||
var index = self.currentPlaylistIndex(null),
|
var index = self.currentPlaylistIndex(null);
|
||||||
length = self.playlist.length,
|
var length = self.playlist.length;
|
||||||
requiresNativeControls = !self.enableCustomVideoControls(),
|
var requiresNativeControls = !self.enableCustomVideoControls();
|
||||||
controls = $(requiresNativeControls ? '.videoAdvancedControls' : '.videoControls');
|
var controls = $(requiresNativeControls ? '.videoAdvancedControls' : '.videoControls');
|
||||||
|
|
||||||
if (length < 2) {
|
if (length < 2) {
|
||||||
$('.videoTrackControl').hide();
|
$('.videoTrackControl').hide();
|
||||||
|
11
dashboard-ui/scripts/mypreferencescommon.js
Normal file
11
dashboard-ui/scripts/mypreferencescommon.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
$(document).on('pageshowready', ".userPreferencesPage", function () {
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||||
|
|
||||||
|
$('.lnkDisplayPreferences', page).attr('href', 'mypreferencesdisplay.html?userId=' + userId);
|
||||||
|
$('.lnkLanguagePreferences', page).attr('href', 'mypreferenceslanguages.html?userId=' + userId);
|
||||||
|
$('.lnkWebClientPreferences', page).attr('href', 'mypreferenceswebclient.html?userId=' + userId);
|
||||||
|
$('.lnkMyProfile', page).attr('href', 'myprofile.html?userId=' + userId);
|
||||||
|
});
|
@ -257,10 +257,9 @@
|
|||||||
|
|
||||||
// Disable default form submission
|
// Disable default form submission
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#displayPreferencesPage", function () {
|
$(document).on('pageinitdepends', "#displayPreferencesPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
@ -295,7 +294,9 @@
|
|||||||
ul.listview('destroy').listview({});
|
ul.listview('destroy').listview({});
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pageshow', "#displayPreferencesPage", function () {
|
$('.displayPreferencesForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||||
|
|
||||||
|
}).on('pageshowready', "#displayPreferencesPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
@ -308,21 +309,6 @@
|
|||||||
loadForm(page, user);
|
loadForm(page, user);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pageshow', ".userPreferencesPage", function () {
|
|
||||||
|
|
||||||
var page = this;
|
|
||||||
|
|
||||||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
|
||||||
|
|
||||||
$('.lnkDisplayPreferences', page).attr('href', 'mypreferencesdisplay.html?userId=' + userId);
|
|
||||||
$('.lnkLanguagePreferences', page).attr('href', 'mypreferenceslanguages.html?userId=' + userId);
|
|
||||||
$('.lnkWebClientPreferences', page).attr('href', 'mypreferenceswebclient.html?userId=' + userId);
|
|
||||||
$('.lnkMyProfile', page).attr('href', 'myprofile.html?userId=' + userId);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.DisplayPreferencesPage = {
|
|
||||||
onSubmit: onSubmit
|
|
||||||
};
|
|
||||||
|
|
||||||
})(jQuery, window, document);
|
})(jQuery, window, document);
|
@ -92,10 +92,9 @@
|
|||||||
|
|
||||||
// Disable default form submission
|
// Disable default form submission
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageinit', "#languagePreferencesPage", function () {
|
$(document).on('pageinitdepends', "#languagePreferencesPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
@ -105,15 +104,14 @@
|
|||||||
$('.subtitles' + this.value + 'Help', page).show();
|
$('.subtitles' + this.value + 'Help', page).show();
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pageshow', "#languagePreferencesPage", function () {
|
$('.languagePreferencesForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||||
|
|
||||||
|
|
||||||
|
}).on('pageshowready', "#languagePreferencesPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
loadPage(page);
|
loadPage(page);
|
||||||
});
|
});
|
||||||
|
|
||||||
window.LanguagePreferencesPage = {
|
|
||||||
onSubmit: onSubmit
|
|
||||||
};
|
|
||||||
|
|
||||||
})(jQuery, window, document);
|
})(jQuery, window, document);
|
@ -65,7 +65,13 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on('pageshowready', "#webClientPreferencesPage", function () {
|
$(document).on('pageinitdepends', "#webClientPreferencesPage", function () {
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
$('.webClientPreferencesForm', page).off('submit', onSubmit).on('submit', onSubmit);
|
||||||
|
|
||||||
|
}).on('pageshowready', "#webClientPreferencesPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
@ -96,50 +102,4 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
window.WebClientPreferencesPage = {
|
|
||||||
onSubmit: onSubmit
|
|
||||||
};
|
|
||||||
|
|
||||||
})(jQuery, window, document);
|
})(jQuery, window, document);
|
||||||
|
|
||||||
(function (window, store) {
|
|
||||||
|
|
||||||
window.AppSettings = {
|
|
||||||
|
|
||||||
maxStreamingBitrate: function (val) {
|
|
||||||
|
|
||||||
if (val != null) {
|
|
||||||
store.setItem('preferredVideoBitrate', val);
|
|
||||||
}
|
|
||||||
|
|
||||||
return parseInt(store.getItem('preferredVideoBitrate') || '') || 1500000;
|
|
||||||
},
|
|
||||||
maxChromecastBitrate: function (val) {
|
|
||||||
|
|
||||||
if (val != null) {
|
|
||||||
store.setItem('chromecastBitrate', val);
|
|
||||||
}
|
|
||||||
|
|
||||||
return parseInt(store.getItem('chromecastBitrate') || '') || 3000000;
|
|
||||||
},
|
|
||||||
enableExternalPlayers: function (val) {
|
|
||||||
|
|
||||||
if (val != null) {
|
|
||||||
store.setItem('externalplayers', val.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return store.getItem('externalplayers') == 'true';
|
|
||||||
},
|
|
||||||
enableItemPreviews: function (val) {
|
|
||||||
|
|
||||||
if (val != null) {
|
|
||||||
store.setItem('enableItemPreviews', val.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return store.getItem('enableItemPreviews') != 'false';
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
})(window, window.appStorage);
|
|
@ -181,7 +181,7 @@
|
|||||||
|
|
||||||
window.MyProfilePage = new myProfilePage();
|
window.MyProfilePage = new myProfilePage();
|
||||||
|
|
||||||
$(document).on('pageinit', "#userImagePage", function () {
|
$(document).on('pageinitdepends', "#userImagePage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
@ -204,6 +204,9 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.newImageForm').off('submit', MyProfilePage.onImageSubmit).on('submit', MyProfilePage.onImageSubmit);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -403,7 +406,14 @@
|
|||||||
|
|
||||||
window.UpdatePasswordPage = new updatePasswordPage();
|
window.UpdatePasswordPage = new updatePasswordPage();
|
||||||
|
|
||||||
$(document).on('pageshow', ".userPasswordPage", function () {
|
$(document).on('pageinitdepends', ".userPasswordPage", function () {
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
$('.updatePasswordForm').off('submit', UpdatePasswordPage.onSubmit).on('submit', UpdatePasswordPage.onSubmit);
|
||||||
|
$('.localAccessForm').off('submit', UpdatePasswordPage.onLocalAccessSubmit).on('submit', UpdatePasswordPage.onLocalAccessSubmit);
|
||||||
|
|
||||||
|
}).on('pageshowready', ".userPasswordPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
@ -640,6 +640,11 @@ var Dashboard = {
|
|||||||
|
|
||||||
html += '<form>';
|
html += '<form>';
|
||||||
|
|
||||||
|
if (AppInfo.supportsFullScreen) {
|
||||||
|
var checkedHtml = AppSettings.enableFullScreen() ? ' checked="checked"' : '';
|
||||||
|
html += '<p style="margin:1.5em 0;"><label for="chkFullScreen">' + Globalize.translate('OptionEnableFullscreen') + '</label><input type="checkbox"' + checkedHtml + ' id="chkFullScreen" data-mini="true" onchange="AppSettings.enableFullScreen(this.checked);" /></p>';
|
||||||
|
}
|
||||||
|
|
||||||
html += '<p class="preferencesContainer"></p>';
|
html += '<p class="preferencesContainer"></p>';
|
||||||
|
|
||||||
if (Dashboard.isConnectMode()) {
|
if (Dashboard.isConnectMode()) {
|
||||||
@ -1540,9 +1545,13 @@ var AppInfo = {};
|
|||||||
|
|
||||||
AppInfo.enableAppStorePolicy = isCordova;
|
AppInfo.enableAppStorePolicy = isCordova;
|
||||||
|
|
||||||
if ($.browser.safari) {
|
var isSafari = $.browser.safari;
|
||||||
|
var isAndroid = $.browser.android;
|
||||||
|
var isMobile = $.browser.mobile;
|
||||||
|
|
||||||
if ($.browser.mobile) {
|
if (isSafari) {
|
||||||
|
|
||||||
|
if (isMobile) {
|
||||||
AppInfo.hasLowImageBandwidth = true;
|
AppInfo.hasLowImageBandwidth = true;
|
||||||
AppInfo.forcedImageFormat = 'jpg';
|
AppInfo.forcedImageFormat = 'jpg';
|
||||||
}
|
}
|
||||||
@ -1584,15 +1593,16 @@ var AppInfo = {};
|
|||||||
AppInfo.enableFooterNotifications = true;
|
AppInfo.enableFooterNotifications = true;
|
||||||
AppInfo.enableSupporterMembership = true;
|
AppInfo.enableSupporterMembership = true;
|
||||||
|
|
||||||
if (!$.browser.android && !$.browser.ipad && !$.browser.iphone) {
|
if (!isAndroid && !isSafari) {
|
||||||
AppInfo.enableAppLayouts = true;
|
AppInfo.enableAppLayouts = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AppInfo.enableUserImage = true;
|
AppInfo.enableUserImage = true;
|
||||||
AppInfo.hasPhysicalVolumeButtons = isCordova || $.browser.mobile;
|
AppInfo.hasPhysicalVolumeButtons = isCordova || isMobile;
|
||||||
|
|
||||||
AppInfo.enableBackButton = ($.browser.safari && window.navigator.standalone) || (isCordova && $.browser.safari);
|
AppInfo.enableBackButton = (isSafari && window.navigator.standalone) || (isCordova && isSafari);
|
||||||
|
AppInfo.supportsFullScreen = isCordova && isAndroid;
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeApiClient(apiClient) {
|
function initializeApiClient(apiClient) {
|
||||||
@ -1829,11 +1839,16 @@ var AppInfo = {};
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (Dashboard.isRunningInCordova()) {
|
if (Dashboard.isRunningInCordova()) {
|
||||||
requirejs(['thirdparty/cordova/connectsdk', 'thirdparty/cordova/remotecontrols', 'scripts/registrationservices']);
|
requirejs(['thirdparty/cordova/connectsdk', 'scripts/registrationservices']);
|
||||||
|
|
||||||
if ($.browser.android) {
|
if ($.browser.android) {
|
||||||
requirejs(['thirdparty/cordova/android/immersive']);
|
requirejs(['thirdparty/cordova/android/immersive']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($.browser.safari) {
|
||||||
|
requirejs(['thirdparty/cordova/remotecontrols']);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ($.browser.chrome) {
|
if ($.browser.chrome) {
|
||||||
requirejs(['scripts/chromecast']);
|
requirejs(['scripts/chromecast']);
|
||||||
|
@ -346,10 +346,6 @@
|
|||||||
|
|
||||||
function isAvailable(item, user) {
|
function isAvailable(item, user) {
|
||||||
|
|
||||||
if (Dashboard.isRunningInCordova()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return item.SupportsSync;
|
return item.SupportsSync;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
25
dashboard-ui/thirdparty/apiclient/apiclient.js
vendored
25
dashboard-ui/thirdparty/apiclient/apiclient.js
vendored
@ -148,11 +148,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (includeAuthorization !== false) {
|
if (includeAuthorization !== false) {
|
||||||
|
|
||||||
|
var currentServerInfo = self.serverInfo();
|
||||||
|
|
||||||
if (clientName) {
|
if (clientName) {
|
||||||
|
|
||||||
var auth = 'MediaBrowser Client="' + clientName + '", Device="' + deviceName + '", DeviceId="' + deviceId + '", Version="' + applicationVersion + '"';
|
var auth = 'MediaBrowser Client="' + clientName + '", Device="' + deviceName + '", DeviceId="' + deviceId + '", Version="' + applicationVersion + '"';
|
||||||
|
|
||||||
var userId = serverInfo.UserId;
|
var userId = currentServerInfo.UserId;
|
||||||
|
|
||||||
if (userId) {
|
if (userId) {
|
||||||
auth += ', UserId="' + userId + '"';
|
auth += ', UserId="' + userId + '"';
|
||||||
@ -163,7 +166,7 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var accessToken = serverInfo.AccessToken;
|
var accessToken = currentServerInfo.AccessToken;
|
||||||
|
|
||||||
if (accessToken) {
|
if (accessToken) {
|
||||||
request.headers['X-MediaBrowser-Token'] = accessToken;
|
request.headers['X-MediaBrowser-Token'] = accessToken;
|
||||||
@ -184,10 +187,12 @@
|
|||||||
|
|
||||||
var newConnectionMode;
|
var newConnectionMode;
|
||||||
|
|
||||||
if (connectionMode == MediaBrowser.ConnectionMode.Local && serverInfo.RemoteAddress) {
|
var currentServerInfo = self.serverInfo();
|
||||||
|
|
||||||
|
if (connectionMode == MediaBrowser.ConnectionMode.Local && currentServerInfo.RemoteAddress) {
|
||||||
newConnectionMode = MediaBrowser.ConnectionMode.Remote;
|
newConnectionMode = MediaBrowser.ConnectionMode.Remote;
|
||||||
}
|
}
|
||||||
else if (connectionMode == MediaBrowser.ConnectionMode.Remote && serverInfo.LocalAddress) {
|
else if (connectionMode == MediaBrowser.ConnectionMode.Remote && currentServerInfo.LocalAddress) {
|
||||||
newConnectionMode = MediaBrowser.ConnectionMode.Local;
|
newConnectionMode = MediaBrowser.ConnectionMode.Local;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -199,9 +204,7 @@
|
|||||||
|
|
||||||
function tryReconnectInternal(deferred, connectionMode, currentRetryCount) {
|
function tryReconnectInternal(deferred, connectionMode, currentRetryCount) {
|
||||||
|
|
||||||
var url = connectionMode == MediaBrowser.ConnectionMode.Local ?
|
var url = MediaBrowser.ServerInfo.getServerAddress(self.serverInfo(), connectionMode);
|
||||||
self.serverInfo().LocalAddress :
|
|
||||||
self.serverInfo().RemoteAddress;
|
|
||||||
|
|
||||||
logger.log("Attempting reconnection to " + url);
|
logger.log("Attempting reconnection to " + url);
|
||||||
|
|
||||||
@ -258,9 +261,7 @@
|
|||||||
|
|
||||||
if (replaceUrl) {
|
if (replaceUrl) {
|
||||||
|
|
||||||
var baseUrl = self.connectionMode == MediaBrowser.ConnectionMode.Local ?
|
var baseUrl = MediaBrowser.ServerInfo.getServerAddress(self.serverInfo(), self.connectionMode);
|
||||||
self.serverInfo().LocalAddress :
|
|
||||||
self.serverInfo().RemoteAddress;
|
|
||||||
|
|
||||||
request.url = replaceServerAddress(request.url, baseUrl);
|
request.url = replaceServerAddress(request.url, baseUrl);
|
||||||
}
|
}
|
||||||
@ -379,7 +380,7 @@
|
|||||||
|
|
||||||
self.openWebSocket = function () {
|
self.openWebSocket = function () {
|
||||||
|
|
||||||
var accessToken = serverInfo.AccessToken;
|
var accessToken = self.serverInfo().AccessToken;
|
||||||
|
|
||||||
if (!accessToken) {
|
if (!accessToken) {
|
||||||
throw new Error("Cannot open web socket without access token.");
|
throw new Error("Cannot open web socket without access token.");
|
||||||
@ -578,7 +579,7 @@
|
|||||||
self.setAuthenticationInfo(null, null);
|
self.setAuthenticationInfo(null, null);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (serverInfo.AccessToken) {
|
if (self.serverInfo().AccessToken) {
|
||||||
var url = self.getUrl("Sessions/Logout");
|
var url = self.getUrl("Sessions/Logout");
|
||||||
|
|
||||||
return self.ajax({
|
return self.ajax({
|
||||||
|
@ -176,7 +176,7 @@
|
|||||||
|
|
||||||
if (!apiClient) {
|
if (!apiClient) {
|
||||||
|
|
||||||
var url = self.getServerAddress(server, connectionMode);
|
var url = MediaBrowser.ServerInfo.getServerAddress(server, connectionMode);
|
||||||
|
|
||||||
apiClient = new MediaBrowser.ApiClient(logger, url, appName, appVersion, deviceName, deviceId);
|
apiClient = new MediaBrowser.ApiClient(logger, url, appName, appVersion, deviceName, deviceId);
|
||||||
|
|
||||||
@ -339,7 +339,7 @@
|
|||||||
throw new Error("credentials.ConnectUserId cannot be null");
|
throw new Error("credentials.ConnectUserId cannot be null");
|
||||||
}
|
}
|
||||||
|
|
||||||
var url = self.getServerAddress(server, connectionMode);
|
var url = MediaBrowser.ServerInfo.getServerAddress(server, connectionMode);
|
||||||
|
|
||||||
url += "/Connect/Exchange?format=json&ConnectUserId=" + credentials.ConnectUserId;
|
url += "/Connect/Exchange?format=json&ConnectUserId=" + credentials.ConnectUserId;
|
||||||
|
|
||||||
@ -367,7 +367,7 @@
|
|||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
|
|
||||||
var url = self.getServerAddress(server, connectionMode);
|
var url = MediaBrowser.ServerInfo.getServerAddress(server, connectionMode);
|
||||||
|
|
||||||
AjaxApi.ajax({
|
AjaxApi.ajax({
|
||||||
|
|
||||||
@ -663,7 +663,7 @@
|
|||||||
function findServers() {
|
function findServers() {
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
ServerDiscovery.findServers(2000).done(function (foundServers) {
|
ServerDiscovery.findServers(2500).done(function (foundServers) {
|
||||||
|
|
||||||
var servers = foundServers.map(function (foundServer) {
|
var servers = foundServers.map(function (foundServer) {
|
||||||
|
|
||||||
@ -710,17 +710,7 @@
|
|||||||
logger.log('Begin connect');
|
logger.log('Begin connect');
|
||||||
|
|
||||||
var deferred = DeferredBuilder.Deferred();
|
var deferred = DeferredBuilder.Deferred();
|
||||||
var isResolved = false;
|
|
||||||
|
|
||||||
if (capabilities.SupportsOfflineAccess) {
|
|
||||||
if (!NetworkStatus.isNetworkAvailable()) {
|
|
||||||
|
|
||||||
deferred.resolveWith(null, [self.getOffineResult()]);
|
|
||||||
isResolved = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isResolved) {
|
|
||||||
self.getAvailableServers().done(function (servers) {
|
self.getAvailableServers().done(function (servers) {
|
||||||
|
|
||||||
self.connectToServers(servers).done(function (result) {
|
self.connectToServers(servers).done(function (result) {
|
||||||
@ -729,7 +719,6 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
return deferred.promise();
|
return deferred.promise();
|
||||||
};
|
};
|
||||||
@ -813,8 +802,7 @@
|
|||||||
if (tests.indexOf(MediaBrowser.ConnectionMode.Local) == -1) { tests.push(MediaBrowser.ConnectionMode.Local); }
|
if (tests.indexOf(MediaBrowser.ConnectionMode.Local) == -1) { tests.push(MediaBrowser.ConnectionMode.Local); }
|
||||||
if (tests.indexOf(MediaBrowser.ConnectionMode.Remote) == -1) { tests.push(MediaBrowser.ConnectionMode.Remote); }
|
if (tests.indexOf(MediaBrowser.ConnectionMode.Remote) == -1) { tests.push(MediaBrowser.ConnectionMode.Remote); }
|
||||||
|
|
||||||
var isLocalNetworkAvailable = NetworkStatus.isAnyLocalNetworkAvailable();
|
var sendWakeOnLan = server.WakeOnLanInfos && server.WakeOnLanInfos.length;
|
||||||
var sendWakeOnLan = server.WakeOnLanInfos && server.WakeOnLanInfos.length && isLocalNetworkAvailable;
|
|
||||||
|
|
||||||
if (sendWakeOnLan) {
|
if (sendWakeOnLan) {
|
||||||
beginWakeServer(server);
|
beginWakeServer(server);
|
||||||
@ -822,7 +810,7 @@
|
|||||||
|
|
||||||
var wakeOnLanSendTime = new Date().getTime();
|
var wakeOnLanSendTime = new Date().getTime();
|
||||||
|
|
||||||
testNextConnectionMode(tests, 0, isLocalNetworkAvailable, server, wakeOnLanSendTime, options, deferred);
|
testNextConnectionMode(tests, 0, server, wakeOnLanSendTime, options, deferred);
|
||||||
|
|
||||||
return deferred.promise();
|
return deferred.promise();
|
||||||
};
|
};
|
||||||
@ -832,7 +820,7 @@
|
|||||||
return (str1 || '').toLowerCase() == (str2 || '').toLowerCase();
|
return (str1 || '').toLowerCase() == (str2 || '').toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
function testNextConnectionMode(tests, index, isLocalNetworkAvailable, server, wakeOnLanSendTime, options, deferred) {
|
function testNextConnectionMode(tests, index, server, wakeOnLanSendTime, options, deferred) {
|
||||||
|
|
||||||
if (index >= tests.length) {
|
if (index >= tests.length) {
|
||||||
|
|
||||||
@ -842,16 +830,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var mode = tests[index];
|
var mode = tests[index];
|
||||||
var address = self.getServerAddress(server, mode);
|
var address = MediaBrowser.ServerInfo.getServerAddress(server, mode);
|
||||||
var enableRetry = false;
|
var enableRetry = false;
|
||||||
var skipTest = false;
|
var skipTest = false;
|
||||||
var timeout = defaultTimeout;
|
var timeout = defaultTimeout;
|
||||||
|
|
||||||
if (mode == MediaBrowser.ConnectionMode.Local) {
|
if (mode == MediaBrowser.ConnectionMode.Local) {
|
||||||
|
|
||||||
if (!isLocalNetworkAvailable) {
|
|
||||||
skipTest = true;
|
|
||||||
}
|
|
||||||
enableRetry = true;
|
enableRetry = true;
|
||||||
timeout = 5000;
|
timeout = 5000;
|
||||||
}
|
}
|
||||||
@ -865,7 +850,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (skipTest || !address) {
|
if (skipTest || !address) {
|
||||||
testNextConnectionMode(tests, index + 1, isLocalNetworkAvailable, server, wakeOnLanSendTime, options, deferred);
|
testNextConnectionMode(tests, index + 1, server, wakeOnLanSendTime, options, deferred);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -886,10 +871,10 @@
|
|||||||
|
|
||||||
// TODO: Implement delay and retry
|
// TODO: Implement delay and retry
|
||||||
|
|
||||||
testNextConnectionMode(tests, index + 1, isLocalNetworkAvailable, server, wakeOnLanSendTime, options, deferred);
|
testNextConnectionMode(tests, index + 1, server, wakeOnLanSendTime, options, deferred);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
testNextConnectionMode(tests, index + 1, isLocalNetworkAvailable, server, wakeOnLanSendTime, options, deferred);
|
testNextConnectionMode(tests, index + 1, server, wakeOnLanSendTime, options, deferred);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -949,7 +934,7 @@
|
|||||||
MediaBrowser.ConnectionState.ServerSignIn;
|
MediaBrowser.ConnectionState.ServerSignIn;
|
||||||
|
|
||||||
result.Servers.push(server);
|
result.Servers.push(server);
|
||||||
result.ApiClient.enableAutomaticNetworking(server, connectionMode, self.getServerAddress(server, connectionMode));
|
result.ApiClient.enableAutomaticNetworking(server, connectionMode, MediaBrowser.ServerInfo.getServerAddress(server, connectionMode));
|
||||||
|
|
||||||
if (result.State == MediaBrowser.ConnectionState.SignedIn) {
|
if (result.State == MediaBrowser.ConnectionState.SignedIn) {
|
||||||
afterConnected(result.ApiClient, options);
|
afterConnected(result.ApiClient, options);
|
||||||
@ -960,20 +945,6 @@
|
|||||||
Events.trigger(self, 'connected', [result]);
|
Events.trigger(self, 'connected', [result]);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.getServerAddress = function (server, mode) {
|
|
||||||
|
|
||||||
switch (mode) {
|
|
||||||
case MediaBrowser.ConnectionMode.Local:
|
|
||||||
return server.LocalAddress;
|
|
||||||
case MediaBrowser.ConnectionMode.Manual:
|
|
||||||
return server.ManualAddress;
|
|
||||||
case MediaBrowser.ConnectionMode.Remote:
|
|
||||||
return server.RemoteAddress;
|
|
||||||
default:
|
|
||||||
return server.ManualAddress || server.LocalAddress || server.RemoteAddress;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function normalizeAddress(address) {
|
function normalizeAddress(address) {
|
||||||
|
|
||||||
if (address.toLowerCase().indexOf('http') != 0) {
|
if (address.toLowerCase().indexOf('http') != 0) {
|
||||||
|
17
dashboard-ui/thirdparty/apiclient/credentials.js
vendored
17
dashboard-ui/thirdparty/apiclient/credentials.js
vendored
@ -94,4 +94,21 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
globalScope.MediaBrowser.ServerInfo = {
|
||||||
|
|
||||||
|
getServerAddress: function (server, mode) {
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case MediaBrowser.ConnectionMode.Local:
|
||||||
|
return server.LocalAddress;
|
||||||
|
case MediaBrowser.ConnectionMode.Manual:
|
||||||
|
return server.ManualAddress;
|
||||||
|
case MediaBrowser.ConnectionMode.Remote:
|
||||||
|
return server.RemoteAddress;
|
||||||
|
default:
|
||||||
|
return server.ManualAddress || server.LocalAddress || server.RemoteAddress;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
})(window, window.JSON);
|
})(window, window.JSON);
|
@ -12,23 +12,97 @@
|
|||||||
//AndroidFullScreen.isSupported();
|
//AndroidFullScreen.isSupported();
|
||||||
|
|
||||||
//// Is immersive mode supported?
|
//// Is immersive mode supported?
|
||||||
//AndroidFullScreen.isImmersiveModeSupported(successFunction, errorFunction);
|
//AndroidFullScreen.isImmersiveModeSupported(onSuccess, onError);
|
||||||
|
|
||||||
//// The width of the screen in immersive mode
|
//// The width of the screen in immersive mode
|
||||||
//AndroidFullScreen.immersiveWidth(trace, errorFunction);
|
//AndroidFullScreen.immersiveWidth(trace, onError);
|
||||||
|
|
||||||
//// The height of the screen in immersive mode
|
//// The height of the screen in immersive mode
|
||||||
//AndroidFullScreen.immersiveHeight(trace, errorFunction);
|
//AndroidFullScreen.immersiveHeight(trace, onError);
|
||||||
|
|
||||||
//// Hide system UI until user interacts
|
//// Hide system UI until user interacts
|
||||||
//AndroidFullScreen.leanMode(successFunction, errorFunction);
|
//AndroidFullScreen.leanMode(onSuccess, onError);
|
||||||
|
|
||||||
//// Show system UI
|
//// Show system UI
|
||||||
//AndroidFullScreen.showSystemUI(successFunction, errorFunction);
|
//AndroidFullScreen.showSystemUI(onSuccess, onError);
|
||||||
|
|
||||||
//// Extend your app underneath the system UI (Android 4.4+ only)
|
//// Extend your app underneath the system UI (Android 4.4+ only)
|
||||||
//AndroidFullScreen.showUnderSystemUI(successFunction, errorFunction);
|
//AndroidFullScreen.showUnderSystemUI(onSuccess, onError);
|
||||||
|
|
||||||
//// Hide system UI and keep it hidden (Android 4.4+ only)
|
//// Hide system UI and keep it hidden (Android 4.4+ only)
|
||||||
//AndroidFullScreen.immersiveMode(successFunction, errorFunction);
|
//AndroidFullScreen.immersiveMode(onSuccess, onError);
|
||||||
|
|
||||||
|
var currentPlayer;
|
||||||
|
|
||||||
|
function onPlaybackStart(e, state) {
|
||||||
|
|
||||||
|
var player = this;
|
||||||
|
|
||||||
|
if (player.isLocalPlayer && state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
|
||||||
|
AndroidFullScreen.immersiveMode(onSuccess, onError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPlaybackStopped(e, state) {
|
||||||
|
|
||||||
|
var player = this;
|
||||||
|
|
||||||
|
if (player.isLocalPlayer && state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
|
||||||
|
AndroidFullScreen.showSystemUI(onSuccess, onError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function bindToPlayer(player) {
|
||||||
|
|
||||||
|
releaseCurrentPlayer();
|
||||||
|
|
||||||
|
currentPlayer = player;
|
||||||
|
|
||||||
|
if (!player.isLocalPlayer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(player).on('playbackstart.fullscreen', onPlaybackStart)
|
||||||
|
.on('playbackstop.fullscreen', onPlaybackStopped);
|
||||||
|
}
|
||||||
|
|
||||||
|
function releaseCurrentPlayer() {
|
||||||
|
|
||||||
|
if (currentPlayer) {
|
||||||
|
|
||||||
|
$(currentPlayer).off('.fullscreen');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateFromSetting(leaveFullScreen) {
|
||||||
|
|
||||||
|
if (AppSettings.enableFullScreen()) {
|
||||||
|
AndroidFullScreen.immersiveMode(onSuccess, onError);
|
||||||
|
}
|
||||||
|
else if (leaveFullScreen) {
|
||||||
|
AndroidFullScreen.showSystemUI(onSuccess, onError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Dashboard.ready(function () {
|
||||||
|
|
||||||
|
console.log('binding fullscreen to MediaController');
|
||||||
|
|
||||||
|
$(MediaController).on('playerchange', function () {
|
||||||
|
|
||||||
|
bindToPlayer(MediaController.getCurrentPlayer());
|
||||||
|
});
|
||||||
|
|
||||||
|
bindToPlayer(MediaController.getCurrentPlayer());
|
||||||
|
|
||||||
|
updateFromSetting(false);
|
||||||
|
|
||||||
|
$(AppSettings).on('settingupdated', function (e, key) {
|
||||||
|
|
||||||
|
if (key == 'enableFullScreen') {
|
||||||
|
updateFromSetting(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
})();
|
})();
|
104
dashboard-ui/thirdparty/cordova/chromecast.js
vendored
104
dashboard-ui/thirdparty/cordova/chromecast.js
vendored
@ -6,6 +6,7 @@
|
|||||||
var currentPairedDeviceId;
|
var currentPairedDeviceId;
|
||||||
var currentDeviceFriendlyName;
|
var currentDeviceFriendlyName;
|
||||||
var currentWebAppSession;
|
var currentWebAppSession;
|
||||||
|
var currentDevice;
|
||||||
|
|
||||||
function chromecastPlayer() {
|
function chromecastPlayer() {
|
||||||
|
|
||||||
@ -312,6 +313,10 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
self.seek = function (position) {
|
self.seek = function (position) {
|
||||||
|
|
||||||
|
position = parseInt(position);
|
||||||
|
position = position / 10000000;
|
||||||
|
|
||||||
sendMessageToDevice({
|
sendMessageToDevice({
|
||||||
options: {
|
options: {
|
||||||
position: position
|
position: position
|
||||||
@ -441,18 +446,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSessionConnected(device, session) {
|
function handleMessage(message) {
|
||||||
|
// message could be either a string or an object
|
||||||
|
if (typeof message === 'string') {
|
||||||
|
onMessage(JSON.parse(message));
|
||||||
|
} else {
|
||||||
|
onMessage(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleSessionDisconnect() {
|
||||||
|
console.log("session disconnected");
|
||||||
|
|
||||||
|
cleanupSession();
|
||||||
|
MediaController.removeActivePlayer(PlayerName);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setupWebAppSession(device, session) {
|
||||||
|
|
||||||
// hold on to a reference
|
// hold on to a reference
|
||||||
currentWebAppSession = session.acquire();
|
currentWebAppSession = session.acquire();
|
||||||
|
|
||||||
session.connect().success(function () {
|
currentWebAppSession.on('message', handleMessage);
|
||||||
|
currentWebAppSession.on('disconnect', handleSessionDisconnect);
|
||||||
|
|
||||||
|
currentWebAppSession.connect().success(function () {
|
||||||
|
|
||||||
console.log('session.connect succeeded');
|
console.log('session.connect succeeded');
|
||||||
|
|
||||||
MediaController.setActivePlayer(PlayerName, convertDeviceToTarget(device));
|
MediaController.setActivePlayer(PlayerName, convertDeviceToTarget(device));
|
||||||
currentDeviceFriendlyName = device.getFriendlyName();
|
currentDeviceFriendlyName = device.getFriendlyName();
|
||||||
currentPairedDeviceId = device.getId();
|
currentPairedDeviceId = device.getId();
|
||||||
|
currentDevice = device;
|
||||||
|
|
||||||
$(castPlayer).trigger('connect');
|
$(castPlayer).trigger('connect');
|
||||||
|
|
||||||
@ -460,34 +485,32 @@
|
|||||||
options: {},
|
options: {},
|
||||||
command: 'Identify'
|
command: 'Identify'
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
session.on('message', function (message) {
|
}).error(handleSessionError);
|
||||||
// message could be either a string or an object
|
|
||||||
if (typeof message === 'string') {
|
|
||||||
onMessage(JSON.parse(message));
|
|
||||||
} else {
|
|
||||||
onMessage(message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
session.on('disconnect', function () {
|
|
||||||
|
|
||||||
console.log("session disconnected");
|
|
||||||
|
|
||||||
if (currentPairedDeviceId == device.getId()) {
|
|
||||||
onDisconnected();
|
|
||||||
MediaController.removeActivePlayer(PlayerName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
function handleSessionError() {
|
||||||
|
cleanupSession();
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanupSession() {
|
||||||
|
|
||||||
|
var session = currentWebAppSession;
|
||||||
|
|
||||||
|
if (session) {
|
||||||
|
// Clean up listeners
|
||||||
|
session.off("message");
|
||||||
|
session.off("disconnect");
|
||||||
|
|
||||||
|
// Release session to free up memory
|
||||||
|
session.disconnect();
|
||||||
|
session.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDisconnected() {
|
|
||||||
currentWebAppSession = null;
|
currentWebAppSession = null;
|
||||||
currentPairedDeviceId = null;
|
currentPairedDeviceId = null;
|
||||||
currentDeviceFriendlyName = null;
|
currentDeviceFriendlyName = null;
|
||||||
|
currentDevice = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function launchWebApp(device) {
|
function launchWebApp(device) {
|
||||||
@ -497,7 +520,7 @@
|
|||||||
device.getWebAppLauncher().joinWebApp(ApplicationID).success(function (session) {
|
device.getWebAppLauncher().joinWebApp(ApplicationID).success(function (session) {
|
||||||
|
|
||||||
console.log('joinWebApp success. calling onSessionConnected');
|
console.log('joinWebApp success. calling onSessionConnected');
|
||||||
onSessionConnected(device, session);
|
setupWebAppSession(device, session);
|
||||||
|
|
||||||
}).error(function (err) {
|
}).error(function (err) {
|
||||||
|
|
||||||
@ -506,7 +529,7 @@
|
|||||||
device.getWebAppLauncher().launchWebApp(ApplicationID).success(function (session) {
|
device.getWebAppLauncher().launchWebApp(ApplicationID).success(function (session) {
|
||||||
|
|
||||||
console.log('launchWebApp success. calling onSessionConnected');
|
console.log('launchWebApp success. calling onSessionConnected');
|
||||||
onSessionConnected(device, session);
|
setupWebAppSession(device, session);
|
||||||
|
|
||||||
}).error(function (err1) {
|
}).error(function (err1) {
|
||||||
|
|
||||||
@ -533,21 +556,28 @@
|
|||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
var boundHandlers = [];
|
|
||||||
|
|
||||||
self.tryPair = function (target) {
|
self.tryPair = function (target) {
|
||||||
|
|
||||||
var deferred = $.Deferred();
|
var deferred = $.Deferred();
|
||||||
|
|
||||||
var manager = ConnectSDK.discoveryManager;
|
var device = ConnectSDK.discoveryManager.getDeviceList().filter(function (d) {
|
||||||
|
|
||||||
var device = manager.getDeviceList().filter(function (d) {
|
|
||||||
|
|
||||||
return d.getId() == target.id;
|
return d.getId() == target.id;
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
if (device) {
|
if (device) {
|
||||||
|
|
||||||
|
self.tryPairWithDevice(device, deferred);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
deferred.reject();
|
||||||
|
}
|
||||||
|
|
||||||
|
return deferred.promise();
|
||||||
|
};
|
||||||
|
|
||||||
|
self.tryPairWithDevice = function (device, deferred) {
|
||||||
|
|
||||||
var deviceId = device.getId();
|
var deviceId = device.getId();
|
||||||
currentPairingDeviceId = deviceId;
|
currentPairingDeviceId = deviceId;
|
||||||
|
|
||||||
@ -560,25 +590,18 @@
|
|||||||
|
|
||||||
console.log('Binding device ready handler');
|
console.log('Binding device ready handler');
|
||||||
|
|
||||||
if (boundHandlers.indexOf(deviceId) == -1) {
|
|
||||||
|
|
||||||
boundHandlers.push(deviceId);
|
|
||||||
device.on("ready", function () {
|
device.on("ready", function () {
|
||||||
console.log('device.ready fired');
|
console.log('device.ready fired');
|
||||||
onDeviceReady(device);
|
onDeviceReady(device);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
device.on("disconnect", function () {
|
||||||
|
device.off("ready");
|
||||||
|
});
|
||||||
|
|
||||||
console.log('Calling device.connect');
|
console.log('Calling device.connect');
|
||||||
device.connect();
|
device.connect();
|
||||||
}
|
}
|
||||||
//deferred.resolve();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
deferred.reject();
|
|
||||||
}
|
|
||||||
|
|
||||||
return deferred.promise();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$(MediaController).on('playerchange', function (e, newPlayer, newTarget) {
|
$(MediaController).on('playerchange', function (e, newPlayer, newTarget) {
|
||||||
@ -588,7 +611,6 @@
|
|||||||
if (currentWebAppSession) {
|
if (currentWebAppSession) {
|
||||||
console.log('Disconnecting from chromecast');
|
console.log('Disconnecting from chromecast');
|
||||||
currentWebAppSession.disconnect();
|
currentWebAppSession.disconnect();
|
||||||
onDisconnected();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
var updatedProducts = [];
|
var updatedProducts = [];
|
||||||
|
|
||||||
|
var unlockAlias = "premium features";
|
||||||
|
|
||||||
function updateProductInfo(p) {
|
function updateProductInfo(p) {
|
||||||
|
|
||||||
updatedProducts = updatedProducts.filter(function (r) {
|
updatedProducts = updatedProducts.filter(function (r) {
|
||||||
@ -11,6 +13,26 @@
|
|||||||
updatedProducts.push(p);
|
updatedProducts.push(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getProduct(alias) {
|
||||||
|
var products = updatedProducts.filter(function (r) {
|
||||||
|
return r.alias == alias;
|
||||||
|
});
|
||||||
|
|
||||||
|
return products.length ? products[0] : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function hasPurchased(alias) {
|
||||||
|
var product = getProduct(alias);
|
||||||
|
|
||||||
|
return product != null && product.owned;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isPurchaseAvailable(alias) {
|
||||||
|
var product = getProduct(alias);
|
||||||
|
|
||||||
|
return product != null && product.canPurchase;
|
||||||
|
}
|
||||||
|
|
||||||
function isAndroid() {
|
function isAndroid() {
|
||||||
|
|
||||||
var platform = (device.platform || '').toLowerCase();
|
var platform = (device.platform || '').toLowerCase();
|
||||||
@ -29,7 +51,7 @@
|
|||||||
validateFeature({
|
validateFeature({
|
||||||
|
|
||||||
id: 'appunlock',
|
id: 'appunlock',
|
||||||
alias: "premium features"
|
alias: unlockAlias
|
||||||
|
|
||||||
}, deferred);
|
}, deferred);
|
||||||
}
|
}
|
||||||
@ -45,7 +67,7 @@
|
|||||||
validateFeature({
|
validateFeature({
|
||||||
|
|
||||||
id: 'premiumunlock',
|
id: 'premiumunlock',
|
||||||
alias: "premium features"
|
alias: unlockAlias
|
||||||
|
|
||||||
}, deferred);
|
}, deferred);
|
||||||
}
|
}
|
||||||
@ -61,7 +83,7 @@
|
|||||||
validateFeature({
|
validateFeature({
|
||||||
|
|
||||||
id: 'premiumunlock',
|
id: 'premiumunlock',
|
||||||
alias: "premium features"
|
alias: unlockAlias
|
||||||
|
|
||||||
}, deferred);
|
}, deferred);
|
||||||
}
|
}
|
||||||
@ -78,24 +100,20 @@
|
|||||||
|
|
||||||
function validateFeature(info, deferred) {
|
function validateFeature(info, deferred) {
|
||||||
|
|
||||||
var products = updatedProducts.filter(function (r) {
|
if (hasPurchased(info.alias)) {
|
||||||
return r.alias == info.alias;
|
|
||||||
});
|
|
||||||
|
|
||||||
var product = products.length ? products[0] : null;
|
|
||||||
|
|
||||||
if (product && product.owned) {
|
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var productInfo = {
|
var productInfo = {
|
||||||
enableSupporterUnlock: isAndroid(),
|
enableSupporterUnlock: isAndroid(),
|
||||||
enableAppUnlock: product != null && product.canPurchase
|
enableAppUnlock: isPurchaseAvailable(info.alias)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var prefix = isAndroid() ? 'android' : 'ios';
|
||||||
|
|
||||||
// Get supporter status
|
// Get supporter status
|
||||||
getRegistrationInfo('appunlock', productInfo.enableSupporterUnlock).done(function (registrationInfo) {
|
getRegistrationInfo(prefix + 'appunlock', productInfo.enableSupporterUnlock).done(function (registrationInfo) {
|
||||||
|
|
||||||
if (registrationInfo.IsRegistered) {
|
if (registrationInfo.IsRegistered) {
|
||||||
deferred.resolve();
|
deferred.resolve();
|
||||||
@ -267,38 +285,32 @@
|
|||||||
|
|
||||||
function initializeStore() {
|
function initializeStore() {
|
||||||
|
|
||||||
|
if (isAndroid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Let's set a pretty high verbosity level, so that we see a lot of stuff
|
// Let's set a pretty high verbosity level, so that we see a lot of stuff
|
||||||
// in the console (reassuring us that something is happening).
|
// in the console (reassuring us that something is happening).
|
||||||
store.verbosity = store.INFO;
|
store.verbosity = store.INFO;
|
||||||
|
|
||||||
store.validator = validateProduct;
|
store.validator = validateProduct;
|
||||||
|
|
||||||
if (isAndroid) {
|
|
||||||
store.register({
|
|
||||||
id: "premiumunlock",
|
|
||||||
alias: "premium features",
|
|
||||||
type: store.NON_CONSUMABLE
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
|
|
||||||
// iOS
|
// iOS
|
||||||
store.register({
|
store.register({
|
||||||
id: "appunlock",
|
id: "appunlock",
|
||||||
alias: "premium features",
|
alias: unlockAlias,
|
||||||
type: store.NON_CONSUMABLE
|
type: store.NON_CONSUMABLE
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// When purchase of the full version is approved,
|
// When purchase of the full version is approved,
|
||||||
// show some logs and finish the transaction.
|
// show some logs and finish the transaction.
|
||||||
store.when("premium feautres").approved(function (order) {
|
store.when(unlockAlias).approved(function (order) {
|
||||||
log('You just unlocked the FULL VERSION!');
|
log('You just unlocked the FULL VERSION!');
|
||||||
order.finish();
|
order.finish();
|
||||||
});
|
});
|
||||||
|
|
||||||
// The play button can only be accessed when the user
|
// The play button can only be accessed when the user
|
||||||
// owns the full version.
|
// owns the full version.
|
||||||
store.when("premium feautres").updated(function (product) {
|
store.when(unlockAlias).updated(function (product) {
|
||||||
|
|
||||||
updateProductInfo(product);
|
updateProductInfo(product);
|
||||||
});
|
});
|
||||||
@ -309,11 +321,11 @@
|
|||||||
store.ready(function () {
|
store.ready(function () {
|
||||||
|
|
||||||
console.log("Store ready");
|
console.log("Store ready");
|
||||||
|
});
|
||||||
|
|
||||||
// After we've done our setup, we tell the store to do
|
// After we've done our setup, we tell the store to do
|
||||||
// it's first refresh. Nothing will happen if we do not call store.refresh()
|
// it's first refresh. Nothing will happen if we do not call store.refresh()
|
||||||
store.refresh();
|
store.refresh();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// We must wait for the "deviceready" event to fire
|
// We must wait for the "deviceready" event to fire
|
||||||
|
@ -48,25 +48,23 @@
|
|||||||
return deferred.promise();
|
return deferred.promise();
|
||||||
}
|
}
|
||||||
|
|
||||||
var isTimedOut = false;
|
|
||||||
var timeout;
|
var timeout;
|
||||||
var socketId;
|
var socketId;
|
||||||
|
|
||||||
function startTimer() {
|
function onTimerExpired() {
|
||||||
|
|
||||||
console.log('starting udp receive timer with timeout ms: ' + timeoutMs);
|
|
||||||
|
|
||||||
timeout = setTimeout(function () {
|
|
||||||
|
|
||||||
isTimedOut = true;
|
|
||||||
deferred.resolveWith(null, [servers]);
|
deferred.resolveWith(null, [servers]);
|
||||||
|
|
||||||
if (socketId) {
|
if (socketId) {
|
||||||
chrome.sockets.udp.onReceive.removeListener(onReceive);
|
chrome.sockets.udp.onReceive.removeListener(onReceive);
|
||||||
closeSocket(socketId);
|
closeSocket(socketId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}, timeoutMs);
|
function startTimer() {
|
||||||
|
|
||||||
|
console.log('starting udp receive timer with timeout ms: ' + timeoutMs);
|
||||||
|
|
||||||
|
timeout = setTimeout(onTimerExpired, timeoutMs);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onReceive(info) {
|
function onReceive(info) {
|
||||||
@ -98,48 +96,42 @@
|
|||||||
|
|
||||||
var port = 7359;
|
var port = 7359;
|
||||||
console.log('chrome.sockets.udp.create');
|
console.log('chrome.sockets.udp.create');
|
||||||
|
|
||||||
|
startTimer();
|
||||||
|
|
||||||
chrome.sockets.udp.create(function (createInfo) {
|
chrome.sockets.udp.create(function (createInfo) {
|
||||||
|
|
||||||
if (!createInfo) {
|
if (!createInfo) {
|
||||||
console.log('create fail');
|
console.log('create fail');
|
||||||
deferred.resolveWith(null, [servers]);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!createInfo.socketId) {
|
if (!createInfo.socketId) {
|
||||||
console.log('create fail');
|
console.log('create fail');
|
||||||
deferred.resolveWith(null, [servers]);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
socketId = createInfo.socketId;
|
socketId = createInfo.socketId;
|
||||||
|
|
||||||
console.log('chrome.sockets.udp.bind');
|
console.log('chrome.sockets.udp.bind');
|
||||||
|
|
||||||
chrome.sockets.udp.bind(createInfo.socketId, '0.0.0.0', 0, function (bindResult) {
|
chrome.sockets.udp.bind(createInfo.socketId, '0.0.0.0', 0, function (bindResult) {
|
||||||
|
|
||||||
if (getResultCode(bindResult) != 0) {
|
if (getResultCode(bindResult) != 0) {
|
||||||
console.log('bind fail: ' + bindResult);
|
console.log('bind fail: ' + bindResult);
|
||||||
deferred.resolveWith(null, [servers]);
|
|
||||||
closeSocket(createInfo.socketId);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = stringToArrayBuffer('who is EmbyServer?');
|
var data = stringToArrayBuffer('who is EmbyServer?');
|
||||||
|
|
||||||
console.log('chrome.sockets.udp.send');
|
console.log('chrome.sockets.udp.send');
|
||||||
|
|
||||||
chrome.sockets.udp.send(createInfo.socketId, data, '255.255.255.255', port, function (sendResult) {
|
chrome.sockets.udp.send(createInfo.socketId, data, '255.255.255.255', port, function (sendResult) {
|
||||||
|
|
||||||
if (getResultCode(sendResult) != 0) {
|
if (getResultCode(sendResult) != 0) {
|
||||||
console.log('send fail: ' + sendResult);
|
console.log('send fail: ' + sendResult);
|
||||||
deferred.resolveWith(null, [servers]);
|
|
||||||
closeSocket(createInfo.socketId);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
console.log('sendTo: success ' + port);
|
|
||||||
|
|
||||||
startTimer();
|
|
||||||
chrome.sockets.udp.onReceive.addListener(onReceive);
|
chrome.sockets.udp.onReceive.addListener(onReceive);
|
||||||
|
console.log('sendTo: success ' + port);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -163,10 +155,10 @@
|
|||||||
|
|
||||||
}).fail(function () {
|
}).fail(function () {
|
||||||
|
|
||||||
deferred.reject();
|
deferred.resolveWith(null, [[]]);
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
deferred.reject();
|
deferred.resolveWith(null, [[]]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
10
dashboard-ui/thirdparty/jquery.unveil-custom.js
vendored
10
dashboard-ui/thirdparty/jquery.unveil-custom.js
vendored
@ -15,12 +15,10 @@
|
|||||||
|
|
||||||
function getThreshold() {
|
function getThreshold() {
|
||||||
|
|
||||||
if (window.AppInfo && AppInfo.hasLowImageBandwidth) {
|
// If less than 100, the search window ends up not getting images
|
||||||
return 0;
|
// If less than 200, this happens on the home page
|
||||||
}
|
// Need to fix those before this can be set to 0
|
||||||
|
return 200;
|
||||||
// Test search before setting to 0
|
|
||||||
return 100;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$.fn.unveil = function () {
|
$.fn.unveil = function () {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<title></title>
|
<title></title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="userPasswordPage" data-role="page" class="page type-interior userProfilesPage userPasswordPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Users">
|
<div id="userPasswordPage" data-role="page" class="page type-interior userProfilesPage userPasswordPage" data-helpurl="https://github.com/MediaBrowser/Wiki/wiki/Users" data-require="scripts/myprofile">
|
||||||
|
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
|
Loading…
Reference in New Issue
Block a user