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

fixes #1243 - Cannot set local address. If detection is wrong, chromecast fails

This commit is contained in:
Luke Pulverenti 2015-12-26 09:29:25 -05:00
parent 71ed24604d
commit 887ea2afc1
3 changed files with 310 additions and 27 deletions

View file

@ -336,24 +336,6 @@
});
};
var endpointInfo;
function getEndpointInfo() {
if (endpointInfo) {
return new Promise(function (resolve, reject) {
resolve(endpointInfo);
});
}
return ApiClient.getJSON(ApiClient.getUrl('System/Endpoint')).then(function (info) {
endpointInfo = info;
return info;
});
}
CastPlayer.prototype.sendMessage = function (message) {
var player = this;
@ -376,17 +358,12 @@
supportsAc3: AppSettings.enableChromecastAc3()
});
getEndpointInfo().then(function (endpoint) {
require(['chromecasthelpers'], function (chromecasthelpers) {
if (endpoint.IsInNetwork) {
ApiClient.getPublicSystemInfo().then(function (info) {
message.serverAddress = info.LocalAddress;
player.sendMessageInternal(message);
});
} else {
chromecasthelpers.getServerAddress(ApiClient).then(function (serverAddress) {
message.serverAddress = serverAddress;
player.sendMessageInternal(message);
}
});
});
};

View file

@ -1794,6 +1794,7 @@ var AppInfo = {};
headroom: bowerPath + '/headroom.js/dist/headroom.min',
masonry: bowerPath + '/masonry/dist/masonry.pkgd.min',
humanedate: 'components/humanedate',
chromecasthelpers: 'components/chromecasthelpers',
jQuery: bowerPath + '/jquery/dist/jquery.min',
fastclick: bowerPath + '/fastclick/lib/fastclick',
events: apiClientBowerPath + '/events',