URL, LOGIN, Password - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27) +---- Forum: Web Interfaces (https://forum.kodi.tv/forumdisplay.php?fid=156) +---- Thread: URL, LOGIN, Password (/showthread.php?tid=177832) |
URL, LOGIN, Password - schnibel - 2013-11-12 Hi, I'm using XBMC since few days, and it's quite interesting. I installed in my house a whole solution to control my lights, dimmers, blinds through KNX and through my iPad. I also developed a supervision MMI to control my lights, dimmers, blinds, AV Ampli, television... And now I want to add some functionalities to choose IN THIS APPLICATION movies, music hosted on my NAS and to play them using XBMC (installed on Raspberry PI model B) I saw the webInterface.default provided by the XBMC team which is almost perfect because everything is done, I just have to provide other CSS and button locations. The code is not going to be hosted on the XBMC itself, but it's going to be hosted on a remote apache2 server (in the same network of course). So I need to provide the URL, a login and a password to be able to interact with the XBMC server. The point is that I don't understand where I can provide the URL and the options. I saw in the "XBMC.core.js" that this should be there "request_options.url = xbmc.core.JSON_RPC + '?' + options.method;" But : - I don't understand when this is called and by which program... - I don't understand how I can provide the information such as : 192.168.0.10:1234 and a login and a password... Does anyone can help me Thanks in advance RE: URL, LOGIN, Password - danmedhurst - 2013-11-13 You need to look into the JSON RPC API. for example : List Movies http://192.168.1.66:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "filter": {"field": "playcount", "operator": "is", "value": "0"}, "limits": { "start" : 0, "end": 75 }, "properties" : ["art", "rating", "thumbnail", "playcount", "file"], "sort": { "order": "ascending", "method": "label", "ignorearticle": true } }, "id": "libMovies"} Play File http://192.168.1.66:8080/jsonrpc?request={ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "smb://serveur/movie/movie.mkv" } }, "id": 1 } Currently Playing http://192.168.1.66:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1} Pause Currently Playing http://192.168.1.66:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": 1 }, "id": 1} Update Library http://192.168.1.64:8080/jsonrpc?request={ "jsonrpc": "2.0", "method": "VideoLibrary.Scan", "id": "mybash"} RE: URL, LOGIN, Password - schnibel - 2013-11-14 Hi, Thanks for your reply... I understood that point, and it already tried to send request using this way... The point is that I'd like to use the code provided in the webInterface.default, sending variables (eg: IP/Port/login/password) to a function (which one And how ) located somewhere in the package (probably xbms.core.js) I don't understand where I can provide these data... RE: URL, LOGIN, Password - schnibel - 2013-11-15 Hi all, Here are the test I made on my system :
I check with a netstat -an that the port 9090 was LISTENING on another machine, I launched a telnet session (telnet 192.168.15.10 9090) and I had the following result : Trying 192.168.0.103... Connected to 192.168.15.10. Escape character is '^]'. I entered the following JSON command : http://192.168.15.10:9090/jsonrpc?request={"jsonrpc":"2.0","method":"Playlist.GetPlaylists","id":1} I received the following result : {"id":1,"jsonrpc":"2.0","result":[{"playlistid":0,"type":"audio"},{"playlistid":1,"type":"video"},{"playlistid":2,"type":"picture"}]}{"jsonrpc":"2.0","method":"GUI.OnScreensaverDeactivated","params":{"data":false,"sender":"xbmc"}} As the communication worked, I modified the file "xbmc.core.js", and I hardcoded the JSON_RPC value, as show hereby : xbmc.core = { 'DEFAULT_ALBUM_COVER': 'images/DefaultAlbumCover.png', 'DEFAULT_VIDEO_COVER': 'images/DefaultVideo.png', 'JSON_RPC': 'http://192.168.15.10:9090/jsonrpc', 'applyDeviceFixes': function () { window.document.addEventListener('touchmove', function (e) { e.preventDefault(); }); }, But when I try the code, I always have the error code : "Connection to server lost", as coded in the xbmc.core.js Important behaviour :
I don't understand what I did wrong... do you have any idea ? RE: URL, LOGIN, Password - schnibel - 2013-11-15 98 viewers... 1 answer... If I didn't explain correctly do not hesitate to tell me if this is the case... As I'm not an expert, I sure the answer is really simple... one more point... Instead of using the port 9090 for the request, i used the port 80... in my browser, I received an answer in the application, I still have the Error code "Connection to server lost" Thanks again for your help |