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 4 made on Friday November 19, 2021 at 21:42
mpg7321
Regular Member
Joined:
Posts:
June 2020
111
so I have been playing around with some script and here is what I have so far.

function JRiver_Info(){
var socket = new TCPSocket();
socket.onConnect = function() {
var prefix = 'GET /MCWS/v1/Playback/Info?Zone=-1'
var postfix = ' HTTP/1.1\r\n\r\n'
try {
socket.write(prefix+postfix);
socket.write("HOST:+url+\r\n\r\n");
} catch(e) {
socket.close()
};
};
socket.onData = function() {
var info = socket.read();

var timeremaining = info.split('').pop().split('')[0];
var totaltime = info.split('').pop().split('')[0];
var artist = info.split('').pop().split('')[0];
var title = info.split('').pop().split('')[0];

GUI.widget("JRiver_Time_Remaining").label=timeremaining;
GUI.widget("JRiver_Total_Time").label=totaltime;
GUI.widget("JRiver_Artist").label=artist;
GUI.widget("JRiver_Title").label=title;
};
socket.close()
socket.onIOError = function(e) {
socket.close()
};
socket.connect(url, 52199, 500);
};

Question I have, I am sending the command ever 1.5 seconds, some times the parsed out data shows other time it shows like corrupted data. Any thoughts?


Hosting Services by ipHouse