Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 35 made on Thursday August 6, 2020 at 17:40
mpg7321
Regular Member
Joined:
Posts:
June 2020
51
Hear is my entire code for returned data.
var url = CF.widget("Kodi_aURL","Kodi_PARAMETERS_test").label;
var FFcommand = "2";
var RRcommand = "2";
function kodi1(){
var socket = new TCPSocket();
socket.onConnect = function() {
prefix = 'GET /jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "thumbnail"], "playerid": 1 }, "id": "1"}'
postfix = ' HTTP/1.0\r\n'
try {
socket.write(prefix+postfix);
socket.write("HOST:+url+\r\n\r\n");
} catch(e) {
socket.close()
}}
socket.onData = function() {
var info1 = socket.read();
var cover = info1.split('original%2f').pop().split('.jpg')[0];
//CF.widget("MOVIE_COVER").label=cover;
if (info1.indexOf('unknown') !== -1) {
CF.widget("KODI_TITLE").label="Nothing Playing";
}else{
var title = info1.split('title":"').pop().split('","type')[0];
CF.widget("KODI_TITLE").label=title;
};
socket.close()
}
socket.onIOError = function(e) {
socket.close()
}
socket.connect(url, 9090, 3000);
scheduleAfter(500,kodi2);
};
////////////////////////////////////////////////////////////////////////////////////////////
function kodi2(){
var url1 = "image.tmdb.org";
var socket = new TCPSocket();
socket.onConnect = function() {
prefix = 'GET /t/p/original/'
postfix = '.jpg /HTTP1.0\r\n'
try {
socket.write(prefix+cover+postfix);
socket.write("HOST:+url1+\r\n\r\n");
} catch(e) {
socket.close()
}}
socket.onData = function() {
var cover1 = socket.read();
// remove the HTTP information from the received data
var imageStartIndex = cover1.indexOf("\r\n\r\n");
var bitmapData = cover1.substring(imageStartIndex+4);
// make and display the image
var MyImage = new Image(bitmapData);
widget(“MOVIE_COVER”).setImage(MyImage);
socket.close()
}
socket.onIOError = function(e) {
socket.close()
}
socket.connect(url1, 80, 3000);
scheduleAfter(500,kodi3);
};


Hosting Services by ipHouse