flowembed is a tool that you can use to place multiple player instances into the same page by using following amazingly simple HTML syntax.
<a class="flowplayer" href="[PATH TO VIDEO]">
<img src="[SPLASH IMAGE]" />
</a>
Plase following script node anywhere on your page, preferrably inside HEAD tag.
<script>
// selectt all link tags with "flowplayer" class and "video- enable" them.
$(function() {
$("a.flowplayer").flowembed("../video/FlowPlayerDark.swf");
});
</script>
This is our complete CSS.
/* dimensios for both splash image and the player wrapper */
a.flowplayer, a.flowplayer img {
display:block;
width:300px;
height:240px;
border:0px;
}
/* play button on top of splash screenn */
div.playButton {
background:url(../img/btn/play.png) no-repeat;
width:50px;
height:50px;
position:relative;
top:-140px;
left:125px;
opacity:0.9;
margin-bottom:-50px;
}
/* play button upon mouseover */
div.playButton:hover {
opacity:1.0;
}
Here are all arguments that you can supply to flowembed. First two arguments are given directly to flashembed and third argument is specific to this tool.
// select nodes that will be "video- enabled"
$("jquery selector").flowembed({FLASH CONFIG}, {FLOWPLAYER CONFIG}, {
/*
By default only one player instance is allowed on the page. if this
is set to false then many instances can be played simultaneously.
*/
oneInstance:true,
// CSS class for the currently playing flowplayer instance
activeClass:'playing',
// CSS class for the overlayed play button, default "playButton"
overlayClass: 'playButton' ,
/*
If your video is in h.264 format and you want to offer flv videos
for those clients that do not support it specify alternate video
extension here. Usually this is "flv"
*/
fallback: null
});
| 1:st argument | are standard Adobe Flash parameters. If this argument is given as string it is intepreted as src parameter. This is the most common scenario. |
| 2:nd argument | is an object that you can use to configure Flowplayer with these configuration variables |
flow.embed.js (unpacked source code 1.8 kb)
This script requires that following JavaScript tools are included into the page.
note: Working example of this tool is included into our latest build which can be downloaded here.