Assembla home | Assembla project page
 

How to playback a Media file in an external application


It is often useful to click on a media file link, and instead of waiting for it to be downloaded before it can be played, the web browser should trigger launching an application to play the file...

If you have access to the disks with the media, then this is easiest by useing playlists containing links to the on-disk media files. For this to work, you need to have access to the media files using the same paths as the SageTV server. this is easiest if you have configured Sage to use UNC paths (\\server\share) to the media directories.

If you do not have access to the disks, then you will have to stream the media file data using the webserver.

To do this, either right-click the file name, and copy the HTTP link to the media file, and paste it into the open URL box of your media player...

Note, on Windows, the following players/file types support HTTP streaming:

PlayerMP3WMAMPGAVIWMV
Windows Media Player *1xx ??
Winampxx ??
VideoLanClientxxxx *2??
MPlayerxxxxx

Notes:

  • *1 -- some HTTP proxies do not like WMP, and block HTTP streaming.
  • *2 -- VLC can play back HTTP-streamed AVI files, but cannot seek (FF/REW) in them.

(Note: by default Mplayer does not have a friendly user interfaces... The Mplayer website lists several frontends, my personal favorite is: MPUI)

For media players that support playlists (VLC does), you can just click the appropriate Streaming Playlist button to download a playlist containing HTTP links. If you configure your browser/OS to open that playlist format with your preferred application, then this is one-click playback.

One final note, if you are behind a proxy/firewall, you may have to configure your media player to correctly connect to Sage webserver through the proxy:

Winamp:Options->preferences/General Preferences
Windows Media Player 10Right-click title bar, Tools->Options/Network
MplayerUsing the HTTP_PROXY environmental variable
VLCUsing the HTTP_PROXY environmental variable, or Settings->Preferences; Input/Codecs->Access Modules->HTTP

To set the HTTP_PROXY environmental variable so that VLC/Mplayer can use it.

  • Right Click My Computer
  • Select Properties
  • click the Advanced tab
  • click Environmental Variables
  • Click the New button below the 'User Variables' list
  • enter name of HTTP_PROXY
  • enter a value in the format http://[user[:pass]@]myproxy.mydomain:myport/
  • where user:pass and myport may be blank, eg:
    http://proxy.mydomain.com/
    http://me:mypass@proxy.mydomain.com:8080/