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.

< Back

PHP Functions
Installation
FAQ

34 Responses to “Documentation :: PHP Functions :: flv”

  1. Walter Conti says:

    Is there any implementation of OS FLV with ColdFusion that you know?
    Thank you very much.
    Walter Conti

  2. admin says:

    None that I know of. If I get a chance I’ll port it - got to get a copy of Cold Fusion first.

  3. James Soderborg says:

    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?

  4. Martijn Lindhout says:

    Does the FLV player support RMTP locations?

  5. Chuck says:

    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?

  6. marvin says:

    how do you change tracker color

  7. Ryan says:

    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)

  8. santhoshreddy says:

    i want to display the stop & play buttons, Please give me code

  9. şömine says:

    is it suitable with joomla ??

  10. Rama Reddy says:

    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

  11. |--A--| says:

    Is there a way to add your own logo in the player? If yes then how? Thanks, very nice player btw. :-)

  12. Andy says:

    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.

  13. nickf says:

    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”));

  14. Gareth N says:

    Does this work with RTMP connections?

  15. Aditya says:

    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=’);

  16. admin says:

    Is the player able to access the local server that the video is on? That could be the problem.

  17. kkyy18 says:

    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?

  18. admin says:

    See the documentation section for info on loading movies with PHP. go to http://www.osflv.com/Documentation.html

  19. Francesco says:

    Loop parameter not working, it’s a bug?

  20. Finn-Arne Johansen says:

    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.

  21. konrad says:

    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 ?

  22. admin says:

    @konrad - what version of the player are you using?

  23. konrad says:

    I use v 4.05 because 4.1 somehow does not work for me

  24. konrad says:

    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

  25. konrad says:

    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

  26. admin says:

    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.

  27. konrad says:

    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

  28. admin says:

    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.

  29. konrad says:

    :) maybe I made something wrong
    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 ??? :)

  30. admin says:

    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.

  31. Marj Wyatt says:

    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

  32. Sandipan Mandal says:

    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

  33. Chris says:

    Hi! Is it possible to hide the controls showing only the video?

  34. Talha says:

    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

Leave a Reply

Copyright Jambo Media, LLC 2009

Powered by WordPress - Created by Tommaso Baldovino