How to embed a video player to your website

Web programming topics
Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to embed a video player to your website

Post by Saman » Sun Oct 03, 2010 9:08 pm

Follow these quick instructions to add video/audio to your website. Make sure you go to http://www.longtailvideo.com/players/ to see latest updates.
  1. Download the Installation Zip
    Installing the JW Player™ onto your page is a simple two-step process. If you haven't already, download the installation ZIP from here, which contains everything you need to get started. The attached one is as of 03/10/2010.
    jw-player.zip
    (92.79 KiB) Downloaded 315 times
  2. Upload Player Files to Website
    Transfer the player.swf, yt.swf and swfobject.js file from the ZIP to your website. Make sure that you've also uploaded all the necessary videos, songs and/or images to your site.
  3. Embed Player Code into HTML
    Embed the player in your HTML page with the lines of code below. Note: If you place the files in different directories, make sure to set the references in this code accordingly.

    Code: Select all

    <p id='preview'>The player will show in this paragraph</p>
    <script type='text/javascript' src='swfobject.js'></script>
    <script type='text/javascript'>
    	var s1 = new SWFObject('player.swf','player','400','300','9');
    	s1.addParam('allowfullscreen','true');
    	s1.addParam('allowscriptaccess','always');
    	s1.addParam('flashvars','file=video.flv');
    	s1.write('preview');
    </script>
Notice the flashvars parameter above can contain a list of variables for configuring the player to use different Plugins or Skins. To quickly set up FlashVars, use the setup wizard. Simply choose an example, select the variables you want to use and paste the code onto your page. It's that easy.
Post Reply

Return to “Web programming”