Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

problem with the file flashvar and extra params

26 replies [Last post]

Hi guys,
I'm still having trouble connecting to a url with extra parameters. Any suggestions would be most appreciated. I'm trying to connect to this video:

http://simi-s-00.vo.llnwd.net/d1/aloneamong.flv?h=b739f00e0ca4cc0fcf03c684f4acac62

I've tried the code:
--------------------------------

<script type="text/javascript">
var s1 = new SWFObject("flvplayer.swf","single","400","300","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("file","http://simi-s-00.vo.llnwd.net/d1/aloneamong.flv?h=b739f00e0ca4cc0fcf03c684f4acac62");
s1.addVariable("image","http://simi.vo.llnwd.net/d1/content/T071906104.jpg");
s1.write("player1");
</script>

---------------------------

Also tried url encoding the url however the remote server (not ours) rejects the url encoded string:

http://simi-s-00.vo.llnwd.net/d1/aloneamong.flv%3Fh%3Db739f00e0ca4cc0fcf03c684f4acac62

Any further suggestions?

cheers
Andrew

You should indeed use URLEncoded values. The player will de-encode them. The values are:

? » %3F
= » %3D
& » %26

woo hoo, problem solved! After checking the packets I found that when using the URLEncoded string for the 'file' flashvar:

http://simi-s-00.vo.llnwd.net/d1/aloneamong.flv%3Fh%3Db739f00e0ca4cc0fcf03c684f4acac62

the player was connecting to 'http://simi-s-00.vo.llnwd.net' but with the URI of 'crossdomain.xml'. It seemed to be thinking I was looking for a .xml? After adding the flashvar: type=flv it started playing the file fine.

thanks
Andrew

This link helped me a lot.. thanks

Indeed. If there's no .flv extension, the player will presume you load an XML! This also goed for the mp3player and files without .mp3 extension...

This also helped me create dynamic playlists from th URL

Thanks for your effort!!

;o) Anders from Denmark

I wants to play .flv file in my web application. and i m using below script

<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
<script type="text/javascript" language="javascript">
var s1 = new SWFObject("flvplayer.swf","single","400","400","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("file","<%=topVideoSrc.toString()%>");
s1.addVariable("image","preview.jpg");
s1.addVariable("width","300");
s1.addVariable("height","170");
s1.write("player1");
</script>

But it don't play video. If i will give static .flv file name then it's play video.

One guy had same problem as me. and he added type=flv in flashvars. and video started to play.

But where to add this parameter.

Thanks in advance.

@John - if you are playing a single file, you can do like this:

s1.addVariable("height","170");
s1.addVariable("type","flv");
s1.write("player1");

if you are using a playlist, you must set the "type" in the playlist items -
for more info on playlists, please see the readme:
http://www.jeroenwijering.com/extras/readme.html

Thanks for your response.

But now i m trying Embedd tag.But also there is a problem in it. My tag is as below

<object>
<embed width="400" height="400" flashvars="file=ObrE0GfWvmM6bBoYLhL2v9fQUlBBt%252BQitui6CbOrpz4%253D&displayheight=300&type=flv" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" src="flvplayer.swf"/>
</object>

Here my file url come from database with encoding. So it don't play file. But if i will give static url as

<object>
<embed width="400" height="400" flashvars="file=video.flv&displayheight=300&type=flv" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" src="flvplayer.swf"/>
</object>

then it play the file.

So i m finding solution for this. Why it happens.
Please give answer as soon as possible. Because i m working on it.

Thanks.

the recommendation is to use the swfobject - it is easier to handle and safe...

when your file has a .flv extension you dont need to set the "type" flashvar - but if the player sees no extension it assumes the file to be a playlist unless the "type" is set -

if the file-string contains "funny" characters they must be url encoded -

from the readme: http://www.jeroenwijering.com/extras/readme.html

type (mp3,flv,rtmp,jpg,png,gif,swf,rbs,3gp,mp4,m4v): The players determine the type of file to play based upon the last three characters of the "file" flashvar. This method doesn't work if you use database id's or mod_rewrite to retrieve the files. Therefore you can set this flashvar to tell the players of which filetype the file you want to play is. The type is also assigned to every item in a playlist. If no match is found, the player assumes it loads a playlist.

Note that you must urlencode any ? = & symbols inside flashvars. The urlencoded values for these symbols are: ? → %3F, = → %3D, & → %26. So if your "file" flashvar has the value of getplaylist.php?id=123, you can set it like this: getplaylist.php%3Fid%3D123.

Still i have same problem. With below script and swf file video play comfortably,

<object>
<param name="movie" value="FLVPlayer_Progressive.swf" />
<param name="salign" value="lt" />
<param name="quality" value="high" />
<param name="menu" value="false"/>
<param name="scale" value="noscale" />
<param name="allowfullscreen" value="true"/>
<param name="FlashVars"
value="&MM_ComponentVersion=1&skinName=clearSkin_3&streamName=<%=topVideoSrc.toString()%>&autoPlay=true&autoRewind=true" />
<embed src="FLVPlayer_Progressive.swf"
lashvars="&MM_ComponentVersion=1&skinName=clearSkin_3&streamName=<%=topVideoSrc.toString()%>&autoPlay=true&autoRewind=false
quality=high"
scale="noscale"
width="480" height="360"
name="FLVPlayer" salign="LT"
menu="false" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
align="left"/>
</object>

But i want to use JW flv player. My video file name come from Database in encoded form. and with above script it play video very well.

But when i use below script it stop to play video. It just show player but don't play video.

<p id="player1"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
<script type="text/javascript" language="javascript">
var s1 = new SWFObject("flvplayer.swf","single","500","400","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("file","<%=topVideoSrc.toString()%>");
s1.addVariable("image","preview.jpg");
s1.addVariable("width","500");
s1.addVariable("height","400");
s1.addVariable("type","flv");
s1.write("player1");
</script>

I m trying this from two days. Give answer as soon as possible.

Thanks

@John - try like this: s1.addVariable("file",<%=topVideoSrc.toString()%>);

or like this:
var tmpFileName=<%=topVideoSrc.toString()%>;
s1.addVariable("file",tmpFileName);

Hi andersen,

First of all thanks to spend your valuable time for me.

Now i wants to customize Right click of my player
.
I want just two options in right click menu of my player.
1.About FLV Player
2.Change Size. And in change size three sub menus are there, like 1) 320x240, 2) 480x360, 3) 640x480 and 4) Full Screen

When user select one of them it shows video in that size.

At present my player shows two options : "About Flash Player" and "Settings..."

How to customize right click of player.

I m using below script
<object>
<param name="movie" value="FLVPlayer_Progressive.swf" />
<param name="salign" value="lt" />
<param name="quality" value="high" />
<param name="menu" value="false"/>
<param name="scale" value="noscale" />
<param name="allowfullscreen" value="true"/>
<param name="FlashVars"
value="&MM_ComponentVersion=1&skinName=clearSkin_3&streamName=<%=topVideoSrc.toString()%>
&autoPlay=true&autoRewind=true" />

<embed src="FLVPlayer_Progressive.swf"
flashvars="&MM_ComponentVersion=1&skinName=clearSkin_3&streamName=<%=topVideoSrc.toString()%>&autoPlay=true&autoRewind=true
quality=high" scale="noscale" width="480" height="360" name="FLVPlayer" salign="LT"
menu="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"
align="left"/>

</object>

Hi,

I'm using an XML playlist but I don't want the buttons backward and forward to appear. Is that possible? if yes, how?

In fact, I just want the player to autostart and read in shuffle mode all the files in the playlist.xml.

Thanks for your help.

JP

Hi,
Pl'z tell me how can be play 2 video one after another dynamically.Now only one flashvars(file) is used to play a video. Thanks in advance

@Vipin - use a playlist.xml - and set the flashvar repeat=true

from the [url=http://www.jeroenwijering.com/extras/readme.html]readme[/url]:

repeat (true,false,list): By default, the players will stop playback after every item to preserve bandwidth (repeat=false). You can set this to "list" to playback all items in a playlist once, or to "true" to continously playback your song/movie/playlist.

Hi...

I m using FLVPlayer_Progressive in my Web App. And it's working fine.

But I wants to use Red5 streaming server for streaming of video URL.
And i used

<object align="top">
<param name="movie" value="FLVPlayer_Progressive.swf" />
<param name="salign" value="lt" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param name="menu" value="false"/>
<param name="wmode" value="transparent"/>
<param name="FlashVars"
value="&MM_ComponentVersion=1&skinName=<%=WliConstants.PLAYER_SKIN%>
&streamName=<%="rtmp://localhost/oflaDemo/"+topVideoSrc%>&autoPlay=true&autoRewind=false" />

<embed src="FLVPlayer_Progressive.swf"
flashvars="&MM_ComponentVersion=1&skinName=<%=WliConstants.PLAYER_SKIN%>
&streamName=<%="rtmp://localhost/oflaDemo/"+topVideoSrc%>&autoPlay=true&autoRewind=false
quality="
high" menu="false" scale="noscale" width="640" height="480" name="FLVPlayer" salign="LT"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
align="top" wmode="transparent" />
</object>

And it's not working. here, topVideoSrc is video url which is coming from database and with .flv extension.

Please tell me how to integrate Red5 and FLVPlayer_Progressive.

Thnx in advance.

RTMP streaming with the Red5 server requires two flashvars:file="rtmp://localhost/oflaDemo/streams"andid="...the name of your video file in the streams directory, with or without the extension..."

You will have to figure out how to split topVideoSrc into those two values or if topVideoSrc is only the video file name, use the file flashvar as shown above and use topVideoSrc as your id flashvar value. Without knowing what value is in topVideoSrc, I can't help you anymore.

Hi...

Thnx for ur response. I didn't know that v can use 'id' in flashvars.

topVideoSrc have the encrypted value of the video file coming from database. and it doesn't have .flv extension.

I tried with 'file' and 'id' flashvars. But it is not working. I tried with other players and in that video played very smooth.

Thanks guy's

I m using below script in php but its not working in any browser except mozilla

var s1 = new SWFObject("flvplayer-2.swf","single","216","190","7");
s1.addParam("allowfullscreen","true");
s1.addVariable('type', 'flv');
s1.addVariable('file',<?php echo("'adminpanel/uploadfile/".$video."'"); ?>);

s1.addVariable("image","video_player/preview.jpg");
s1.addVariable("width","216");
s1.addVariable("height","190");
s1.write("player1");
can any one help me?

Hi andersen,

can you post the thumbnail url for supernovatube video in php script.

Thanks.


This is my code....

var s1 = new SWFObject('player.swf','ply','470','320','9','#ffffff');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addVariable('controlbar','over');
s1.addVariable('displayclick','fullscreen');
s1.addParam('wmode','opaque');
s1.addParam('type','flv');
s1.addParam('flashvars','file=Video Upload/<?php echo $vid_video ?>');
s1.write('mediaspace');

Video Upload is folder where all my video uploaded stored....
If u place all your video at the same place with php file...
Replace with this code
s1.addParam('flashvars','file=<?php echo $vid_video ?>');

People ia ma trying to do em audio stream using a flash media server (trial) and Falsh encoder.

Encoder and Server are conected. But my SWF doesnt play. I am only streamming live audio (no video)

the HTML of the embed is:
--------------------
<html>
<head>
</head>
<body>
<embed
src='player-viral.swf'
width='470'
height='20'
bgcolor='#ffffff'
allowscriptaccess='always'
allowfullscreen='true'
flashvars='file=rtmp://_server_addrress_/myliveapp&id=instance1'
/>
</body>
</html>

-------------------------------------------
In the encoder i am conected to:
rtmp://_server_addrress_/myliveapp/instance1

and the aplicantion name is: livestream

Any clue !?
Thankx
--------------------------

See this thread: http://www.longtailvideo.com/support/forum/General-Chat/16066/How-to-stream-live-to-red5-

And also search for: "FME livestream"

For the FMS server, see: http://developer.longtailvideo.com/trac/wiki/FlashFormats#Streamingservers

Most of the major CDNs use FMS, so you might have to use the same livestream settings like: [i]type=fcsubscribe[/i]

I don't have FMS, so this is about all I know about anything...