Documentation :: PHP Functions :: flv
|
flv - embeds an flv video. This function requires AC_RunActiveContent.js and rac.js. If you use it, make sure you use the flvheader function in the head section of your html document.
Description void flv (string $movie [, int $width [, int $height [, string fgcolor [, string bgcolor [, boolean $autoplay [, boolean $autoload [, boolean $autorewind [, int $volume [, boolean $loop [, boolean $mute [, boolean $muteonly [, string $clickurl [, string $clicktarget ]]]]]]]]]]]) Parameters movie - The path of the flv file to send to the player. May be relative or absolute. width - The desired width of the player. If not specified or set as -1, the function will use the width provided by the getflvsize function. If used, height must also be specified, and a value other than -1, otherwise, both values will be ignored. height - The desired height of the player. If not specified or set as -1, the function will use the height provided by the getflvsize function, plus 40px for the player’s controls. If used, width must be specified, and a value other than -1, otherwise, both values will be ignored. fgcolor - The foreground color of the player. Defaults to 0×13ABEC. bgcolor - The background color of the player. Defaults to 0×051615. autoplay - If set to true, the movie will begin playing as soon as it has started to load - otherwise it will require the play button to be pressed. Defaults to false. autoload - If set to true, the movie will load automatically - otherwise it will require the play button to be pressed. Setting this to false can save bandwidth and make pages with multiple videos run better. Defaults to true. autorewind - If set to true, the movie will return to the beginning after it has completed - otherwise it will stay on the last frame. Defaults to true. volume - The starting volume of the player. This can later be changed by the user, unless muteonly is set to true. Defaults to 70. loop - If set to true, the movie will restart after it has completed - otherwise it will stay on the last frame or go back to the beginning, depending on the value of autorewind. Defaults to false. mute - If set to true, the movie will start muted - otherwise it will start with volume equal to the value of volume. Defaults to false. muteonly - If set to true, the player will use the old style volume toggle - otherwise it will use the volume adjuster. Defaults to false. clickurl - If set, clicking the video will take you to this url. clicktarget - Used only if clickurl is specified, set to ‘_blank’ to open in a new window, ‘_self’ to open in the current frame or ‘_parent’ to open in the current window. Be aware that some popup blockers will prevent opening in a new window. |
|

January 24th, 2008 at 3:36 am
Is there any implementation of OS FLV with ColdFusion that you know?
Thank you very much.
Walter Conti
January 28th, 2008 at 11:29 am
None that I know of. If I get a chance I’ll port it - got to get a copy of Cold Fusion first.
February 7th, 2008 at 10:26 am
Do you know of a way to start the player playing a .flv file, but only have it play for 10 seconds and then stop?
March 5th, 2008 at 5:48 am
Does the FLV player support RMTP locations?
April 8th, 2008 at 3:08 am
i’d like to play .flv file on a different server. i’ve tried flv(”http://www.somewebsite.com/demo.flv”, -1, -1, ”, ”, false, false); but no use. is there any way to play .flv files on a different server?
April 19th, 2008 at 1:02 pm
how do you change tracker color
April 30th, 2008 at 1:29 pm
I believe there may be a bug with autorewind. When set to “off” or “false” the video rewinds and starts playing again (and the play/pause button doesn’t change). When it is set to “on” or “true” it works as expected (returns to beginning and stops)
June 11th, 2008 at 4:59 am
i want to display the stop & play buttons, Please give me code
July 3rd, 2008 at 4:23 am
is it suitable with joomla ??
July 27th, 2008 at 1:52 pm
Hello,
Iam able to play the first 2 flv video and after i can not play the videos In IE6 and IE7. its work fine firefox. how can i fix this?
please support me in this reagards.
Thanks inadvance.
here is the below code iam using to to pass source to palyer.
var src = ‘player’;
if(!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0))
src = ‘player8′;
AC_FL_RunContent(’codebase’, ‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0′, ‘width’, 548, ‘height’, 460, ’src’, src, ‘pluginspage’, ‘http://www.macromedia.com/go/getflashplayer’, ‘id’, ‘flvPlayer’, ‘allowFullScreen’, ‘true’, ‘movie’, src, ‘FlashVars’,'movie=http://andhratube.com/output/{$vinfo[0].flvdoname}&autoload=on&volume=70′);
plase make me a solution as early as posiible.
Regards
Rama Reddy
September 16th, 2008 at 10:23 am
Is there a way to add your own logo in the player? If yes then how? Thanks, very nice player btw.
September 18th, 2008 at 8:41 am
You might want to provide an argument which lets you set the id attribute of the player, in case you want to put more than one player per page.
September 29th, 2008 at 7:10 pm
instead of having a really really long function signature (14 parameters!) why not use a single “options” parameter, like how jQuery does with most things. the function calls would look like this: flv(array(”movie” => “myMovie.flv”, “mute” => true, “clickurl” => “example.com”));
October 29th, 2008 at 4:56 pm
Does this work with RTMP connections?
August 6th, 2009 at 1:04 am
Hi, I am able to run the flv video using the script generated by the html provided with in the zip file. But when I tried to replace the path with the URL the video is not getting played instead an error is showing up from adobe flash player.
My code is follows:
AC_FL_RunContent(’codebase’, ‘http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0′, ‘width’, ‘360′, ‘height’, ‘290′, ’src’, ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? ‘player8′ : ‘player’), ‘pluginspage’, ‘http://www.macromedia.com/go/getflashplayer’, ‘id’, ‘flvPlayer’, ‘allowFullScreen’, ‘true’, ‘movie’, ((!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0)) ? ‘player8′ : ‘player’), ‘FlashVars’, ‘movie=http://localhost:8080/flv/testFLV.flv&bgcolor=0×051615&fgcolor=0×13ABEC&volume=70&autoload=on&autorewind=on&clickurl=&clicktarget=’);
August 6th, 2009 at 8:09 am
Is the player able to access the local server that the video is on? That could be the problem.
September 23rd, 2009 at 4:26 am
Is there way to play to flv that loaded by a php file?
I tried this, but no luck.
flv(â€http://www.somewebsites.com/get.php?id=1â€, -1, -1, â€, â€, false, false);
or the file name must be absoulte local path with file name and extension?
September 28th, 2009 at 12:58 pm
See the documentation section for info on loading movies with PHP. go to http://www.osflv.com/Documentation.html
December 21st, 2009 at 1:18 pm
Loop parameter not working, it’s a bug?
January 5th, 2010 at 5:29 am
When using the flv function I dont get no “startup image”. I had to edit flash.php to automaticly add an empty ‘&postimage=’
not sure what happens if I add a postimage.
April 28th, 2010 at 7:30 am
Hi, great work,
but this function flv(), doesn’t work for me
for eg. flv(’test.flv’,'500′,’500′,”,”,true); I See the player and he works, but the autoplay is off
or flv(’test.flv’,'500′,’500′,’0xfffff’,'0×00000′); Still see the player, but fg. and bgcolors are still default
What I am making wrong.
Even the function embed() don’t work
for eg I give something like this embed(’test.swf’); and I cant’t see nothing
This is my exemplae test File
[php]
include ‘flash/flash.php’;
flvheader();
//embed(’test.swf’);
flv(’test.flv’,'500′,’500′,”,”,true);
[/php]
test.swf and test.flv are in the same Folder as the test php file
Any Ideas why ?
April 28th, 2010 at 7:39 am
@konrad - what version of the player are you using?
April 28th, 2010 at 10:27 am
I use v 4.05 because 4.1 somehow does not work for me
April 29th, 2010 at 11:37 am
hmm… I’ve got the same Problem
Version of the player 4.2,
Try to launch flv(’mario.flv’,'500′,’500′,’0xffffff’,'0×000000′,true);
And I get this
http://img135.imageshack.us/img135/7730/mariod.jpg
As You see, the witdh and height are working but the colors doesn’t change, autoplay too
In the source Code the variables are empty and autoplay is off
player.swf?movie=mario.flv&accentcolor=&btncolor=&autoplay=off&volume=20
April 29th, 2010 at 12:11 pm
Ok, I’ve made a little changes in the flash.php and now flv() works for me
This is what I’ve done
Old Code
####
if($fgcolor && $accentcolor !== ” && $accentcolor !== ‘default’)
$options[] = “accentcolor=$accentcolor”;
if($bgcolor && $btncolor !== ” && $btncolor !== ‘default’)
$options[] = “btncolor=$btncolor”;
if($autoplay && $autoplay !== ” && $autoplay !== ‘default’)
$options[] = ‘autoplay=off’;
###
New Code
####
if($fgcolor && $accentcolor !== ” && $accentcolor !== ‘default’)
$options[] = “accentcolor=$fgcolor”;
if($bgcolor && $btncolor !== ” && $btncolor !== ‘default’)
$options[] = “btncolor=$bgcolor”;
if($autoplay && $autoplay !== ” && $autoplay !== ‘default’)
$options[] = ‘autoplay=on’;
###
Now can I change the colors and I can control autoplay
flv(’mario.flv’,'500′,’500′,’0xffffff’,'0×000000′,false); -> autoplay OFF
flv(’mario.flv’,'500′,’500′,’0xffffff’,'0×000000′,true); -> autoplay ON
April 29th, 2010 at 12:17 pm
Well, the colors aren’t going to change unless you enter colors in. Are you saying your source Code looks like this: player.swf?movie=mario.flv&accentcolor=&btncolor=&autoplay=off&volume=20?
if so, you had to have changed it to look like that because if I use the code generator provided in the bundle, even if i dont enter anything into the fields I get: movie=movieurl&btncolor=0×333333&accentcolor=0×20b3f7&txtcolor=0xffffff&volume=&previewimage=previewimageurl&autoplay=on&autoload=on
You have to be setting the value of the colors in order for them to change from the defaults. If you leave it empty, it will use defaults I have set within the AS file.
April 29th, 2010 at 12:44 pm
Hi @admin,
Yes indeed if I use the code generator I get movie=movieurl&btncolor=0×333333&accentcolor=0×20b3f7&txtcolor=0xffffff&volume=&previewimage=previewimageurl&autoload=on
But I would not to use the code generator, I wanted to use only the php functions to generate the player
April 29th, 2010 at 3:52 pm
so you’re saying you are entering the correct values into the string but the php function is reverting them back to being blank? I’m not quite sure I understand your issue.
April 30th, 2010 at 4:09 am
What I tried to say is.
I wanted to use only this simply test.php file (whitout the use of code generator)
[php]
include ‘flash/flash.php’;
flvheader();
//embed(’test.swf’);
flv(’test.flv’,’500′,’500′,â€,â€,true);
[/php]
And when i launched flv(’mario.flv’,’500′,’500′,’0xffffff’,’0×000000′,true); i got back a player , but the the colours and autoplay didn’t change from default values (In documentation can we read the parameters 4 and 5 are responsible for the colors) until i’ve made some little changes in the flash.php.
I don’t generate the player whith the code generator, I generate them only with help of the php, but maybe, first of all, I must to use the generator and then the php functions ???
April 30th, 2010 at 3:14 pm
I’m not sure I can think of a reason it wouldn’t work if you are setting the values you want. If all else fails, you could try hardcoding the values you want into the php file.
July 1st, 2010 at 11:05 pm
I am developing a Wordpress Website for my client at http://medxprss.com.
The video playin on the home page is a stock video from iStockPhoto.com. They offered mp4 and mov files in the size the client wanted.
He would prefer to use flash to play the video. I’ve converted the stock video to an flv and worked through several players before stumbling upon yours. Nice work!
My questions are these:
1) Is the “loop” function working or not with the latest download?
2) Is there a way to eliminate controls so the presentation is pretty much like the quicktime video?
Thanks!
Marj Wyatt aka Virtually Marj
July 2nd, 2010 at 5:03 am
Hi,
I have install Osplayer in one of my site…
Now my requrment is to remove Preloader and Reply button from the player..
Please help how to do so…
Tnx
Sandipan Mandal
July 13th, 2010 at 6:13 am
Hi! Is it possible to hide the controls showing only the video?
August 27th, 2010 at 6:44 am
The video overlaps/hides above my content. I have tried to fix that using z-index, but that did not work.
I want to place the video player just below the global navigation panel (dropdown menu). please help.
thanks