[plt-scheme] Video stream on Macintosh computers

From: Norbert Lehmann (Norbert.Lehmann at unifr.ch)
Date: Wed Sep 21 08:55:01 EDT 2005

Hello

I am looking for a way to play a video stream inside a window
managed by MrEd. On systems running MS Windows, this can be achieved
with DrScheme v209 using the source code below which makes use of
MysterX to embedd the Windows Media Player inside a window:

;--------
(require (lib "mysterx.ss" "mysterx"))
(require (lib "class.ss"))

(define (play-video file title width height)
   (let ([titlebar-height 30]
         [toolbar-height 64]
         [frame-thickness 4]
         [horizontal-padding 10]
         [vertical-padding 15])
     (let* ([browser (make-object mx-browser%
                       title
                       ;; COM object width:
                       (+ frame-thickness
                          horizontal-padding
                          width
                          horizontal-padding
                          frame-thickness)
                       ;; COM object height:
                       (+ titlebar-height
                          vertical-padding
                          height
                          toolbar-height
                          vertical-padding
                          frame-thickness))]
            [document (send browser current-document)]
            [player (send document insert-object-from-coclass
                      "Windows Media Player"
                      width (+ height toolbar-height))]
            [movie (com-invoke player "newMedia" file)])
       (com-set-property! player "currentMedia" movie)
       browser)))
;--------

Clearly, as MysterX is based on COM, this code does not work on
Macintosh computers. Is there way how I could play a video stream in
DrScheme on Macintosh computers, for example by embedding Quicktime ?

Thanks
Norbert


Posted on the users mailing list.