Scripting (KDE 3.1 only)


This is an example how you can control an embedded kmplayer from Javascript in a HTML page
<embed SRC="example.avi" NAME="audio" WIDTH=320 HEIGHT=240 TYPE="video/x-msvideo">
  <script> function onFinished() { alert('finished'); } </script>
<A HREF="">play</A>
<A HREF="javascript:audio.pause()">pause</A>
<A HREF="javascript:audio.volume(1)">++</A>
<A HREF="javascript:audio.volume(-1)">--</A>
<A HREF="javascript:audio.stop()">stop</A>
Also the binding for RealPlayer plugin interface are available (only some work, but at least it doesn't break scripts inside html pages).


Thanks to the KMediaPlayer::Player interface, KMPlayer can be controlled by DCOP. Eg. to open a movie, run
dcop kmplayer-<pid> KMediaPlayer openURL <your movie file>