mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix-cast-with-localhost-server
This commit is contained in:
parent
26b83efc95
commit
51eeef00a6
1 changed files with 10 additions and 1 deletions
|
@ -335,16 +335,25 @@ class CastPlayer {
|
|||
apiClient = ServerConnections.currentApiClient();
|
||||
}
|
||||
|
||||
/* If serverAddress is localhost,this address can not be used for the cast receiver device.
|
||||
* Use the local address (ULA, Unique Local Address) in that case.
|
||||
*/
|
||||
const srvAddress = apiClient.serverAddress();
|
||||
const srvLocalAddress = srvAddress.startsWith('http://localhost') || srvAddress.startsWith('http://127.') || srvAddress.startsWith('http://[::1]')
|
||||
? apiClient.serverInfo().LocalAddress : srvAddress;
|
||||
|
||||
message = Object.assign(message, {
|
||||
userId: apiClient.getCurrentUserId(),
|
||||
deviceId: apiClient.deviceId(),
|
||||
accessToken: apiClient.accessToken(),
|
||||
serverAddress: apiClient.serverAddress(),
|
||||
serverAddress: srvLocalAddress,
|
||||
serverId: apiClient.serverId(),
|
||||
serverVersion: apiClient.serverVersion(),
|
||||
receiverName: receiverName
|
||||
});
|
||||
|
||||
console.debug('cc: message{'+message.command+'; '+srvAddress+' -> '+srvLocalAddress+'}');
|
||||
|
||||
const bitrateSetting = appSettings.maxChromecastBitrate();
|
||||
if (bitrateSetting) {
|
||||
message.maxBitrate = bitrateSetting;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue