Linking to your stream
Linking to your stream
Once you are connected to a commedia server and are webcasting, how do your listeners receive your stream? Options are:
- Type the stream address into their player
- Embedded player in your website
- Connect directly to your stream from your website
- Connect via a streaming media meta file
To ensure that as many people as possible can easily access your webcast, and to get over many problems that different setups can cause, we generally recommend that you connect via the m3u meta file created automatically by our icecast streaming server (example below).
Add a hyperlink (image button or "Listen Live" text):
Linking to an MP3 stream
Its is important to link to a live MP3 stream via a meta file, an m3u, rather than linking directly to the stream. If the MP3 stream is linked to directly this can cause problems such as:
- Extended buffering
- Download a short amount (approximately 30 seconds) and only playing that short piece
- Not opening in default media player
- Opening stream in browser
- Combinations of the above
Failure to link correctly to the stream via an M3U is a common problem and is much easier than it may initially appear. The sequence of data would be:
- "Listen Live" button on website
- M3U file (the URL of which may be something like www.mywebsite.com/streamname.m3u)
- Your MP3 stream
All the M3U file is is a single line text file with the address of your stream, this would take the form:
The M3U can be created in any plain text editor, such as NotePad. Note: When saving your text file, if using NotePad, click "Save as type" and use "All Files". This allows you to be able to add an extension (.ram if connecting to a Real stream or .m3u if connecting to an mp3 stream) without ending up with a .txt extension. You need to avoid having your file be called something like mystream.m3u.txt
Connecting to a REAL stream
You can put a link to a streaming server directly into your web page like this:
<a href="rtsp://myserver.com/streamname.rm">Click here to listen</a>
...but it's generally a bad idea. Metafiles exist to make sure that the browser knows how to properly hand off the stream request to the media player. Using the technique above will work sometimes, but using metafiles will increase the odds that everything will work just the way you want it to, for all your visitors.
Metafiles typically contain just a few lines of text. The key ingredient is a URL that the media player uses to make its own connection to the streaming server to get the media file.
.ram files The most basic metafile for RealPlayer is the .ram file. At the simplest, a .ram file has one line with nothing more than a URL, like this:
The metafile can contain not just the stream URL but also playlists, title or copyright information, start and end times in the media file to play, and much more. The command set for RealPlayer .ram files is documented in the RealNetworks Production Guide. Here you'll find the commands for everything from controlling the color of the playback window to loading Web pages into the "Related Info" pane of the RealONE player.