How do I display video?

Link to a Video

The Okanagan campus Video on Demand service can be used to display any .flv or .swf (Flash) video file within UBC's Okanagan campus common-look-and-feel.  The file itself can reside in any location, on any server.

  • The Video on Demand service resides at www.ubc.ca/okanagan/vod/
  • To play a video, add a query string to the URL in the form of ?f=PATH_TO_FILE
  • So, the URL would be www.ubc.ca/okanagan/vod/?f=path_to_file
If your video is located on UBCO.tv, you can also link directy to it.

Embed a Video

You may also wish to embed a flash video within your own website. In HTML editing mode, insert the following code wherever you'd like your video to appear.

<script src="http://www.ubc.ca/okanagan/_ubc_ulf/js/swfobject.js" type="text/javascript">
</script>

<div id="mediaspace">
Video will be placed here
</div>

<script type="text/javascript">
var so = new SWFObject('http://www.ubc.ca/okanagan/_ubc_ulf/swf/player-4.7.707.swf','mpl','512','288','9','#ffffff');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','opaque');
so.addVariable('backcolor','#FFFFFF');
so.addVariable('frontcolor','#3B3228');
so.addVariable('lightcolor','#655C55');
so.addVariable('screencolor','#000000');
so.addVariable('bufferlength',10);
so.addVariable('autostart','true');
so.addVariable('mute','false');
so.addVariable('file','PATH_TO_FILE');
so.write('mediaspace');
</script>

Replace the following with the appropriate values:

  • PATH_TO_FILE
    Specify the full path to file (URL) *
  • WIDTH (512) / HEIGHT (288)
    Specify the width and height (in pixels) of the video.  If you're unsure, contact the person(s) responsible for creating the video, or check out the Standard Video Sizes listed in the right-hand column of this page.

Would you like your video to repeat automatically?

  • Add the following:
    so.addVariable('repeat','always');

* UBCO.tv

Trying to embed a video that is located on UBCO.tv?  It is necessary to specify the direct path to the .flv file.
If the supplied URL is, for example, http://ubco.tv/frontend2.php?cm=movies/143WalkingTrails.flv, use the format:
http://ubco.tv/movies/143WalkingTrails.flv
as the PATH_TO_FILE.

If you'd like to display the video using the Okanagan campus 'Video on Demand' service, you'll also need to format the URL as above.
http://www.ubc.ca/okanagan/vod?f=http://ubco.tv/movies/143WalkingTrails.flv

to top

Last reviewed4/3/2012 5:03:06 PM

Standard Video Sizes

4:3 Aspect Ratio

  • 160 x 120
  • 320 x 240
  • 496 x 372
  • 576 x 432
  • 640 x 480

16:9 Aspect Ratio

  • 128 x 72 *
  • 160 x 90
  • 256 x 144 *
  • 384 x 216 *
  • 512 x 288 *
  • 576 x 324
  • 640 x 360 *
  • 854 x 480

* true 16:9 resolution

160 x 90 is a good size for a video located in the right-hand column of your site, where 576 x 324 (16:9) is the largest size that can be accommodated when you're using a 'Nav 2 Col' template on your page.  Learn more about templates >>

Need a video hosted or converted into a web-friendly format?
Contact the Media Centre.

a place of mind, The University of British Columbia