Skip to content

Instantly share code, notes, and snippets.

@kylehowells
Last active August 29, 2015 14:06
Show Gist options
  • Save kylehowells/8ff379300eb2f088da24 to your computer and use it in GitHub Desktop.
Save kylehowells/8ff379300eb2f088da24 to your computer and use it in GitHub Desktop.
Send video to XBMC in Javascript
var string = "plugin://plugin.video.youtube/?action=play_video&videoid=WnlLQbAQSxQ"
var params = {
item : {
file : string
}
}
var data = { jsonrpc: "2.0", method: "Player.Open", id: 1 };
data.params = params;
var strData = JSON.stringify(data);
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://xbmc@192.168.1.100:8080", true);
xhr.setRequestHeader("Content-type", "application/json");
xhr.send(strData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment