[Seaside] embed a video with seaside

Andreas Petermann PetePetermann at gmx.de
Fri Nov 3 22:02:28 UTC 2006

Hi all,

a while ago I posted a problem by embedding an video (the same with audio) with seaside. Your helps doesn't really help me, so I tried it on my own again.
The solution of my problem is at least very simple (more simple I can imagine :-) ). 
The trick/hack is the #asMIMEDocumentType: mimeType methode.
I use an URI for my audio and video files, so I had to implement this methode for URI class ans all works fine.

the body of this legendary methode looks like the following:

#asMIMEDocumentType: mimeType
 ^SeasidePlattformSupport mimeDocumentOfType: mimeType from self asFullPath

and you should use this in this way:

url := URI fromString: 'file:///PATH_TO_FILE'.
mimeType := 'video/mpeg' or 'audio/mpeg' (depends on what to embed). 
src := html (RenderCanvas) context urlForDocument: url mimeType: mimeType fileName: url asFullPath.

Now use an embed tag...

embed := html tag: 'embed'.
embed attributes
  at: 'src' put: src;
  at: 'width' put: ???;

In this way all works fine.

I think this would be helpful for everyone who tried to embed videofiles or audiofiles with seaside.

GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl

More information about the Seaside mailing list