Aktuelle Zeit: 22. Mai 2022 03:15

Alle Zeiten sind UTC + 1 Stunde




 Seite 1 von 1 [ 1 Beitrag ] 
Autor Nachricht
 Betreff des Beitrags: Simple Media Player
BeitragVerfasst: 23. August 2009 15:54 
Administrator
Benutzeravatar

Registriert: 17. März 2008 13:32
Beiträge: 96
Wohnort: NRW, Germany
Supports everything that windows media player could play
Requires MCI.DLL
;; Simple Media Player (or something like it ;))
;; Usage /player [filename]
;; Trackbar is fully working
;; Spacebare pauses the player (while window is active)
;; Movie gets paused while moving
;; Playerwindow closes when playback is finished
;; Double click into player window closes the window and stops the playback
alias mci if ($1- = close vid) { !.timermcipos off } | return $dll(mci.dll,MCIString,$1-)
alias player {
  if ($window(@MCIPlayer)) {
    mci close vid
    window -c @MCIPlayer
  }
  if ($isfile($shortfn($1-))) {
    if ($istok(avi divx mpeg mpg wmv mp4,$gettok($1-,-1,46),32)) {
      set %lastviddir $nofile($shortfn($1-))
      mci open $shortfn($1-) type mpegvideo alias vid
      mci where vid destination max
      tokenize 32 $result
      !window -Bhpdk0o +d @MCIPlayer -1 -1 $4 $calc($5 +5)
      titlebar @MCIPlayer playing
      mciposupdate 1
      mci window vid handle [ $window(@MCIPlayer).hwnd ]
      mci play vid
      mci set vid time format ms
      mci status vid volume 255
      mci status vid length
      !.timermcipos -m 0 100 mciposupdate $gettok($result,2,32)
    }
    else {
      echo $color(info) -ag * Please open only files with the extensions: avi, divx, mpeg, mpg, wmv, mp4
    }
  }
  elseif (!$len($1)) {
    var %x $shortfn($$sfile(%lastviddir *.avi;*.divx;*.mpeg;*.mpg;*.wmv;*.mp4,Open Video,Open))
    .timer -m 1 1 player $iif(%x,%x)
  }
  else {
    echo $color(info) -ag * Please use: /player [filename] - If you specify a filename the file must exists!
  }
}
on *:unload:{
  unset %lastviddir
}
alias mciposupdate {
  mci status vid position
  drawrect -fr @mciplayer 0 0 0 $calc($window(@mciplayer).h - 5) $window(@mciplayer).w 5
  drawline -r @mciplayer 16777215 1 0 $calc($window(@mciplayer).h - 5) $window(@mciplayer).w $calc($window(@mciplayer).h - 5)
  drawline -r @mciplayer 16777215 1 0 $calc($window(@mciplayer).h - 5) 0 $window(@mciplayer).h
  drawline -r @mciplayer 5263440 1 0 $calc($window(@mciplayer).h -1) $calc($window(@mciplayer).w -1) $calc($window(@mciplayer).h -1) $calc($window(@mciplayer).w -1) $calc($window(@mciplayer).h - 5)
  drawrect -fr @mciplayer $rgb(255,127,127) 0 1 $calc($window(@mciplayer).h -4) $ceil($calc(($gettok($result,2,32) / $1) * ($window(@mciplayer).w -2))) 3
  if ($gettok($result,2,32) == $1) {
    mci close vid
    window -c @mciplayer
    echo $color(info) -ag * Simple Media Player closed. (Video Finished)
  }
}
menu @MCIPlayer {
  sclick:{
    if ($mouse.y isnum $+($calc($window(@mciplayer).h -4),-,$calc($window(@mciplayer).h -1))) && ($mouse.x isnum $+(2-,$calc($window(@mciplayer).w -2))) {
      mci status vid length
      var %l = $gettok($result,2,32)
      mci play vid from $ceil($calc(%l / ($window(@mciplayer).w -2) * $mouse.x))
      mciposupdate %l
    }
    else {
      !set %playerMove $mouse.x $mouse.y | if ($wt != paused) { mci pause vid }
    }   
  }
  uclick:!unset %playerMove | if ($wt != paused) { mci resume vid }
  mouse:{
    if (%playerMove && $mouse.key & 1) {
      !.timermoveplayer -m 1 15 window $active $&
        $calc($mouse.dx - $gettok(%playerMove,1,32)) $&
        $calc($mouse.dy - $gettok(%playerMove,2,32)) $&
        $window($active).w $window($active).h
    }
  }
  dclick:{
    mci close vid
    window -c @MCIPlayer
  }
}
alias -l wt { return $window(@mciplayer).title }
on *:KEYDOWN:@MCIPlayer:32:{
  if ($wt = paused) {
    mci resume vid
    titlebar @mciplayer playing
  }
  else {
    mci pause vid
    titlebar @mciplayer paused
  }
}
on *:close:@MCIPlayer:{ mci close vid }


Bild



_________________
one step closer to world domination
Cyberscripters Administrator/Founder
   
 
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
 Seite 1 von 1 [ 1 Beitrag ] 

Alle Zeiten sind UTC + 1 Stunde


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  

cron