Skip to content

Instantly share code, notes, and snippets.

@CF-Terence
Created April 4, 2012 03:50
Show Gist options
  • Save CF-Terence/2297598 to your computer and use it in GitHub Desktop.
Save CF-Terence/2297598 to your computer and use it in GitHub Desktop.
Playing Dune from XBMC
self.playMovie = function(file) {
if (file === undefined) {
var file = self.currentMovieFile; // This would give full path :D:\Movie\MoviesHD\Title of the movie (2011).mkv
}
// truncate front characters from e.g. D:\Movie\MoviesHD\Title of the movie (2011).mkv to get filename and extension only.
var filext = file.slice(14); // Note : Slice characters will depend on directory path e.g. D:\Movie\MoviesHD\
//send command to Dune player.
CF.request("http://192.168.0.104/cgi-bin/do?cmd=start_file_playback&media_url=storage_name://Clayton2tb5/Movie/MoviesHD/"+filext, null);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment