There are two kinds of hyperlink for RealMedia files. One is to make a hyperlink directly to the video file – in this case the whole file will be downloaded before viewing (i.e. it will not stream). Use this method if you specifically want this outcome. For example:
<a href=”video01.rm”>Click here to download video
The other method is to make the video stream you actually need to create another file – a simple text file with a .ram extension. This is known as a metafile – a file which contains data about another file.
To create the metafile, open a text editor (such as Notepad) and enter the URL of the video file.
Save this text file with the extension .ram. It probably makes sense to use the same file name as the video file — this will make file management easier. Now create a hyperlink to the metafile like so:
<a href=”video01.ram”>Click here to view streaming video
Notice the only difference between this and the previous hyperlink: The file extension is .ram instead of .rm (so it points to the metafile instead of the video file).
When the user clicks this hyperlink, the metafile opens and in turn opens the video file – except this time it will be streamed instead of downloaded. This process is transparent to the user – as far as they are concerned the hyperlink just starts the streaming.
Note: In order for RealMedia files to stream from your website your host server must recognize the .ra, .ram, .rm and .rpm mime types. These are standardized file classifications and if your host doesn’t support them, you should request that they do or find another host.
Embed RealMedia Files
Use the following code to embed a real media file.
<OBJECT ID=RVOCX CLASSID=”clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA” WIDTH=”180″ HEIGHT=”159″>
<PARAM name=”src” value=”videofilename.rmvb”>
<PARAM name=”autostart” value=”false”>
<PARAM name=”controls” value=”imagewindow”>
<PARAM name=”console” value=”video”>
<EMBED TYPE=”audio/x-pn-realaudio-plugin” SRC=”videofilename.rmvb” WIDTH=”180″ HEIGHT=”159″ AUTOSTART=”false” CONTROLS=”all” CONSOLE=”video”>
RMVB to SWF is also another googd solution to stream video in Flash video format.