Example 1: Using the Default Settings
This sample shows the player loaded with a 5-minute video, and the logo file called logo.png. The default time-frame is between 20-50 seconds.
Here's the code:
<div id="container">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.
<script type="text/javascript">
var s1 = new SWFObject("player.swf","ply","400","300","9","#000000");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.addVariable("file","video.flv");
s1.addVariable("duration","300");
s1.addVariable("logo","logo.png");
s1.addVariable("plugins","logomover");
s1.addVariable("bufferlength","5");
s1.write("container");
</script>
</div> <!-- end container -->
Example 2: Using a Custom Time-Span
This sample shows the player loaded with the same video. The time-span is between 2-7 seconds, set using the flashVars logomover.mintime and logomover.maxtime.
Here's the code:
<div id="container2">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.
<script type="text/javascript">
var s1 = new SWFObject("player.swf","ply","400","300","9","#000000");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.addVariable("file","video.flv");
s1.addVariable("duration","300");
s1.addVariable("logo","logo.png");
s1.addVariable("plugins","logomover");
s1.addVariable("logomover.mintime","2");
s1.addVariable("logomover.maxtime","7");
s1.addVariable("bufferlength","10");
s1.write("container2");
</script>
</div> <!-- end container2 -->
(If you care, that's me floating around on top of the video, from a photo taken back in 1980. The video itself is from a band I used to be in, around 2003-ish.)
Logo Mover:
a plug-in for the JW Player v.4.3+
Developed by Leland Hirschman, for www.gpanswers.com
This is a sample of the new logomover plug-in for the JW-Player. The logo (an existing optional feature of the Player) repositions to a random location on the screen at random intervals between twenty and fifty seconds (20-50 sec). You can also customize the minimum and maximum times of the time-span using flashVars. The logo only moves if the video is playing. It does not move while paused or stopped, and the timer is reset when you start playing again.
Version History:
| Version | Date | Notes |
|---|---|---|
| v.1.1 | 2009-02-15 |
|
| v.1.0 | 2009-01-16 | Delivered to Client & to Longtail Plug-In Repository using the name LogoRandomPosition |
Requirements:
- JW Player 4.3+
- You must also already be using the logo feature of the player.
Background:
A client was looking for some security measures for the video portion of his website. He didn't want his videos to be copied and redistributed by his competition. He already used the Player's built-in Logo feature, but figured that a savvy thief could find a way to cover it, or crop around it. But if the logo moved around at random intervals, it could help to deter the would-be thief. This plug-in is the result of that need.
What it Does:
When the player is loaded, a timer is created, and is set to a random number between 20-seconds and 50-seconds, if no times are submitted via flashVars. When the timer reaches that randomly-selected number, it moves the logo to a random position on the screen. Then it resets the timer again to a new random number within the range, and moves the logo again when it reaches the end. And so on 'till the video is over. If you pause the video, the timer stops and resets again. It's pretty basic.
And if you want to specify a different minimum or maximum time for the time-range, you can specify them via flashVars.
Quick Reference:
| Plug-In Name: | logomover | ||
|---|---|---|---|
| flashVars | |||
| flashVars Name | Default | Type | Description |
| logomover.mintime | 20 | [number] | Optional The minimum amount of time in seconds that may pass before the logo can move. |
| logomover.maxtime | 50 | [number] | Optional The maximum amount of time in seconds that may pass before the logo can move. |
Basic Installation:
By default, when plug-ins are used, they are loaded from the official Longtail Plug-In Repository.
To load the plug-in, add the following flashVars to your code, as required by the JW Player loaded using swfobject:
s1.addVariable("file","video.flv");
s1.addVariable("logo","logo.png");
s1.addVariable("plugins","logomover[,otherplugins]");
REMEMBER: This plug-in uses the video's 'logo' flashVars.
logo [path/to.file] (default:[null]) - Path to the logo file.
Examples:
- example #1:
s1.addVariable("logo","logo.png");
Loads the file 'logo.png' as the logo. - example #2:
s1.addVariable("logo","images/watermark.gif");
Loads the file 'watermark.gif' from the images folder as the logo.
Customized Installation - flashVars:
Two additional flashVars are available with this plug-in. They are:
logomover.mintime [number] (default:20) - The minimum number of seconds that must pass before the logo may move.
Examples:
- example #1:
s1.addVariable("logomover.mintime","150");
The logo will not move until a random time greater than 150 seconds has passed. - example #2:
s1.addVariable("logomover.mintime","30");
The logo will not move until a random time greater than 30 seconds has passed.
logomover.maxtime [number] (default:50) - The maximum number of seconds that may pass before the logo may move.
Examples:
- example #1:
s1.addVariable("logomover.mintime","250");
The logo will not move until a random time less than 250 seconds has passed. - example #2:
s1.addVariable("logomover.mintime","60");
The logo will not move until a random time less than 60 seconds has passed.
OK, you ask, but how do I put it all together...?
The Complete Code:
To properly use this plug-in, with extra customization using flashVars, use the examples along the side, adjusting the values as needed.
© 2009, Leland Hirschman