mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
chromecast updates
This commit is contained in:
parent
d3fc2c0fa5
commit
4685d0f254
1 changed files with 20 additions and 3 deletions
|
@ -81,7 +81,7 @@
|
||||||
// v3 Id 69C59853
|
// v3 Id 69C59853
|
||||||
// default receiver chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
|
// default receiver chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
|
||||||
|
|
||||||
var applicationID = "472F0435";
|
var applicationID = "69C59853";
|
||||||
|
|
||||||
// request session
|
// request session
|
||||||
var sessionRequest = new chrome.cast.SessionRequest(applicationID);
|
var sessionRequest = new chrome.cast.SessionRequest(applicationID);
|
||||||
|
@ -261,6 +261,8 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var player = this;
|
||||||
|
|
||||||
var message = {
|
var message = {
|
||||||
options: options,
|
options: options,
|
||||||
command: command,
|
command: command,
|
||||||
|
@ -271,14 +273,29 @@
|
||||||
serverAddress: ApiClient.serverAddress()
|
serverAddress: ApiClient.serverAddress()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var address = message.serverAddress.toLowerCase();
|
||||||
|
if (address.indexOf('localhost') != -1 || address.indexOf('127.0.0') != -1) {
|
||||||
|
|
||||||
|
ApiClient.getSystemInfo().done(function(info) {
|
||||||
|
|
||||||
|
message.serverAddress = info.WanAddress;
|
||||||
|
player.sendMessage(message);
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
player.sendMessage(message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
CastPlayer.prototype.sendMessage = function(message) {
|
||||||
message = JSON.stringify(message);
|
message = JSON.stringify(message);
|
||||||
//console.log(message);
|
//console.log(message);
|
||||||
|
|
||||||
this.session.sendMessage(messageNamespace, message, this.onPlayCommandSuccess.bind(this), this.errorHandler);
|
this.session.sendMessage(messageNamespace, message, this.onPlayCommandSuccess.bind(this), this.errorHandler);
|
||||||
};
|
}
|
||||||
|
|
||||||
CastPlayer.prototype.onPlayCommandSuccess = function () {
|
CastPlayer.prototype.onPlayCommandSuccess = function () {
|
||||||
console.log('Play command was sent ok.');
|
console.log('Message was sent to receiver ok.');
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue