| CODE TO PLAY A FLV VIDEO |
In this section I will show you how to embed (display) a .flv video file in your web page using the code that comes with Flash Video Player 3.6 by Jeroen
Wijering (created early 2007). This flash player is now called JW FLV Media Player (Current Version: 4.5 - created in 2009), is managed by Longtail Ad Solutions
(with JW still on board) and allows you to playback any video format that is supported by Adobe Flash Player.
So why use version 3.6 when version 4.5 is more superior with updated code and features? Well. When I first wanted to embed a .flv video file into a web page I used
Web Easy Professional 7
from Avanquest because it was quick and easy to do so. Upon investigation though I found out that although both versions of the flv player are free-to-use
for non-commercial purposes, to my knowledge they both display a watermark on your video during playback and have a right click attribution (advert
acknowledgement). In order to remove the watermark and attribution you need to buy a commercial license for your website (currently €39, approximately
£34 or $55). Fair enough. Seems reasonable that if you want to stream flv video through your website, via the unbranded/licensed JW Player in your
public_html (website) folder, you need to pay for it. But again. What has this got to do with version 3.6? Answer. Version 3.6 that comes with Web Easy
Professional 7, and other web development packages, has a licensed version (i.e. 3.6) inside it that you can use.
At first I thought "Why have WEP7 given me version 3.6?". And after that I asked myself "Even if WEP7 are licensed to put the player in their package,
what good is that if the package user (me) can only view .flv video on their computer but not on their website?". I do not want to pay for another
software (the flv player/license) now that I have bought WEP7. So I decided to ask LongTail for the facts, using a bogus email address of course! - Always
use a bogus email address when making general enquiries. Some companies take it upon themselves to abuse your email address otherwise. Longtail have not
abused my bogus email address. In fact, Ethan Feldman was very professional. Anyway. To cut the story short, Ethan Feldman (Ad Solution Manager) told me
(SarahP actually) that I was free to use my licensed, non-branded, version 3.6. So basically the purchaser of WEP7, and any other web development
package using version 3.6, is licensed to use version 3.6 on their website. And the same would apply if that web development package was using version
4.5, but always check with LongTail first if in doubt. I have put the email conversation between me (bogus SarahP) and Ethan Feldman at the bottom of this
section for you.
In this example I have used a modern-day .flv video recording, with Adobe Flash Player 10.0.22.87 (and Adobe Shockwave Player 11.5.0.600) installed, using
Flash Video Player 3.6 by Jeroen Wijering to show you that you do not necessarily need all the features of version 4.5 for example to play a simple .flv
video file. The files produced by the WEP7 web development software consist of four main files. 1) The web page that is to play the .flv video file.
2) The javascript (i.e. video.js) file that collects variables passed to it by the web page, which in turn it passes to the .swf file. 3) The .swf
(Shockwave Flash/Small Web Format) file itself that interacts with Adobe Flash Player in order to display the .flv video file. And 4) The .flv video
file. In Fig 1.0 below I have cut the web page code down to its minimum.
Fig 1.0 above highlights the two segments of code that call up (insert) the javascript code (highlight 1) and execute (run/launch) the javascript code
(highlight 2). The script tag (command/instruction) in highlight 1 simply tells your web browser to insert the video.js code into memory, where
its weAddFlashVideo() function (command/instruction) can then be executed by the html code in highlight 2. The weAddFlashVideo() function requires
certain parameters to be passed (given) to it, such as the video size parameters (320, 240), before it then passes those same parameters to the
flvplayer.swf file. For example. I have told the weAddFlashVideo() function I want the .flv video to be displayed at a size of 320 pixels wide by 240
pixels high. When the weAddFlashVideo() function is executed, with my size parameters, it then executes the flvplayer.swf file. The flvplayer.swf
receives those same size parameters which Adobe Flash Player then reads and display the .flv video file accordingly.
Although the video.js code could of been incorporated into the play_video.html web page it was not, simply because you never know when you are going to
need that same video.js code again. For example. With one web page it does not matter if you incorporate it or not, unless you really want to save on
code (i.e. have all code in one file). In general though, when you have more than one web page using the same video.js code, because each web page is
going to play the same flv video, you normally just link to the same video.js file (with the same code inside it) with a SCRIPT tag. In other words. One
video.js file with each web page having a script tag inside it, but never each web page with the same video.js code inside it.
You can ignore the video.js file because there is nothing inside its code for you to touch or worry about. As said above, you just incorporate it into memory (link to it) via a SCRIPT tag. Looking at the video.js code you can see how the parameters for the weAddFlashVideo() function are made up.
|
File Name (URL or local file)
Display Area Size (Width and Height) AutoStart - Play video automatically (True or False) Repeat - Play video repeatedly (True or False) Image (pause image) used when AutoStart and/or Repeat is/are set to false Foreground colour for the button/controls Background colour for the button/controls Highlight colour for the button/controls |
http://www.websitecreationhelp.com/video.flv or video.flv
320, 240 True (Yes) or False (No) True (Yes) or False (No) http://www.websitecreationhelp.com/bgimage.jpg or bgimage.jpg 0xff0000 (red) - (HexDecimal) 0xffff00 (yellow) - (HexDecimal) 0x00ff00 (green) - (HexDecimal) |
Fig 1.2 above shows the effect of changing the colour parameters, which must be in the HexDecimal
number format as far as I am aware. Notice there is no watermark obstructing the video footage, a part from the watermark/timer that I purposely wanted
from my webcam. If I right click over the video footage the right click attribution (author/company acknowledgement) will be there, but you know what they say.
"What the eyes don't see the heart won't miss!".
Below is a copy of the email conversation I (bogus SarahP) had with Ethan Feldman (Ad Solutions Manager), with all replies. Read it from the bottom
upwards because that is where hotmail displays the original email message from. It should give you a definate understanding of who can use the player.
The code for version 4.5 is a lot different to that of version 3.6. It has different, extra, parameters from version 3.6 and has fixed many bugs (code errors/mistakes), but is still implemented in the same way as above (as version 3.6). If you can afford the commercial license of version 4.5, and if you require a commercial license of course, then I would suggest you buy one and use version 4.5. However. If you only need to play the odd .flv video on your website, without a watermark but with right click attribution, I would suggest hunting down a cheap web development software that comes with a license already.
All HTM, CSS, PHP and MySQL files in the websitecreationhelp.com folder and its sub-folders are (c) John White, 2009. All Rights Reserved. Email: John