ajax.php
changeset 10 d3059e20b0fa
parent 6 5f35ebc4f9bb
child 18 69af47034212
--- a/ajax.php	Mon Mar 24 00:12:21 2008 -0400
+++ b/ajax.php	Mon Mar 24 02:53:42 2008 -0400
@@ -70,7 +70,7 @@
       $tid =& $params[1];
       if ( !preg_match('/^[0-9]+$/', $tid) )
       {
-        return die_json('Invalid track ID');
+        return json_die('Invalid track ID');
       }
       $tid = intval($tid);
       dcop_action('playlist', "playByIndex $tid");
@@ -86,7 +86,7 @@
       $volume =& $params[1];
       if ( !preg_match('/^[0-9]+$/', $volume) )
       {
-        return die_json('Invalid track ID');
+        return json_die('Invalid track ID');
       }
       $volume = intval($volume);
       dcop_action('player', "setVolume $volume");
@@ -95,6 +95,18 @@
         );
       echo $json->encode($return);
       break;
+    case 'seek':
+      if ( !$allowcontrol )
+        return false;
+      $pos =& $params[1];
+      if ( !preg_match('/^[0-9]+$/', $pos) )
+      {
+        return json_die('Invalid track ID');
+      }
+      $pos = intval($pos);
+      dcop_action('player', "seek $pos");
+      
+      break;
     case 'refresh':
       global $playlist_last_refresh, $playlist, $playlist_last_md5;
       if ( $playlist_last_refresh + 60 < time() )