Ejemplo n.º 1
0
$player_type = $players->result[0]->type;
$player_id = $players->result[0]->playerid;
if ($command == 'refresh') {
    $out['PLAY'] = preg_replace('/\\\\$/is', '', $out['PLAY']);
    $path = str_replace('/', "\\", utf2win($out['PLAY']));
    if (is_file($path)) {
        //play file
        $result = xbmc_request($ch, $terminal, 'Player.Open', array('item' => array('file' => $path)));
    } else {
        //play folder
        ///!!!!!! how to get it working???
        $result = xbmc_request($ch, $terminal, 'Player.Open', array('item' => array('path' => $path)));
    }
}
if ($command == 'pause') {
    $result = xbmc_request($ch, $terminal, 'Player.PlayPause', array('playerid' => (int) $player_id));
}
if ($command == 'fullscreen') {
}
if ($command == 'next') {
    $result = xbmc_request($ch, $terminal, 'Player.GoNext', array('playerid' => (int) $player_id));
}
if ($command == 'prev') {
    $result = xbmc_request($ch, $terminal, 'Player.GoPrevious', array('playerid' => (int) $player_id));
}
if ($command == 'close') {
    $result = xbmc_request($ch, $terminal, 'Player.Stop', array('playerid' => (int) $player_id));
}
if ($command == 'volume') {
    $result = xbmc_request($ch, $terminal, 'Application.SetVolume', array('volume' => (int) $volume));
}
Ejemplo n.º 2
0
    }
}
if ($command == 'pause') {
    $result = xbmc_request($ch, $terminal, 'Player.PlayPause', array('playerid' => (int) $player_id));
}
if ($command == 'fullscreen') {
}
if ($command == 'next') {
    $result = xbmc_request($ch, $terminal, 'Player.GoNext', array('playerid' => (int) $player_id));
}
if ($command == 'prev') {
    $result = xbmc_request($ch, $terminal, 'Player.GoPrevious', array('playerid' => (int) $player_id));
}
if ($command == 'close') {
    $result = xbmc_request($ch, $terminal, 'Player.Stop', array('playerid' => (int) $player_id));
}
if ($command == 'volume') {
    $result = xbmc_request($ch, $terminal, 'Application.SetVolume', array('volume' => (int) $volume));
}
if ($command == 'notify') {
    global $type;
    global $title;
    global $message;
    if (!$type) {
        $type = 'info';
    }
    if (!$title) {
        $title = 'MajorDoMo';
    }
    $result = xbmc_request($ch, $terminal, 'GUI.ShowNotification', array('title' => (string) $title, 'message' => (string) $message, 'image' => (string) $type));
}