Nov. 05, 2007Paul
Hi,
I created a single video as it was written in the manual, Seems I checked everything and video works good in IE6 and IE7. But...
if I just hit Refresh (F5) button on the same page, video player disappears. I checked this in IE6 and IE7. Why it so? It looks like a crazy thing.
Ok. I checked this in FF2.0 and everything works pretty good even when I refresh the page. But in IE6/7 it works weird. Why?
Has anyone faced this strange behaviour?
Thanks.
Paul
Nov. 05, 2007Will
If you would post your code or a link, we could probably tell you what is wrong. Since you didn't do either, I'm going to give you 100 guesses.
The first one:
You didn't set the width & height.
Like this:
s123.addVariable('width', '320');
s123.addvariable('height', '240');
Nov. 06, 2007Terry
Great player but I have that problem too, as well as the video being way off to the right of center. I have tried setting different widths and heights, then I end up with a huge white box thing round the player.All is well in FF but not IE7. Can you please advise?
Cheers
Terry
Nov. 06, 2007Will
Setting the height & width always solves that problem. Post your code, maybe you have something else wrong.
Nov. 06, 2007Terry
I didn't post this again because of the white box. by the way, the code tries to cater for IE as well as NON IE browswers....but here is the code and thanks for your time. I have seen this white box on other sites using the player, but my main problem is that people are seeing my videos all off center to the right.
<p id="player2" style="float:top; text-align: center"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
<script type="text/javascript">
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
var s2;
if ( msie > 0 ) {
// Internet Explorer
s2 = new SWFObject("flvplayer.swf","playlist","335","313","7");
// // Only explicitly set width and height for Internet Explorer
s2.addVariable("width","420");
s2.addVariable("height","480");
s2.addVariable("displayheight","230");
}
else {
// Not Internet Explorer
s2 = new SWFObject("flvplayer.swf","playlist","310","360","7");
s2.addVariable("displayheight","205");
}
s2.addParam("allowfullscreen","true");
s2.addVariable("file","playlist2.xml");
s2.addVariable("backcolor","0x000000");
s2.addVariable("frontcolor","0xFFCCFF");
s2.addVariable("lightcolor","0xCCFFFF");
s2.write("player2");
</script>
Cheers
Terry
Nov. 06, 2007andersen
@Terry
but my main problem is that people are seeing my videos all off center to the right.
no wonder!
you dont need to differentiate between the browsers, just set width and height regardless of browser-
BUT, what you do need is to set width and height consistantly!
this is really really BAD:
s2 = new SWFObject("flvplayer.swf","playlist","335","313","7");
s2.addVariable("width","420");
s2.addVariable("height","480");
this would be ok (for all browsers):
s2 = new SWFObject("flvplayer.swf","playlist","420","480","7");
s2.addVariable("width","420");
s2.addVariable("height","480");
if this doesnt fix your problem, please see the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/minimal_but_safe.htm]minimal but safe[/url] demo from the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/]demopage[/url]
it has the creating script in the head and trigger the creation in the <body onload="...
this is the absolutely safest way!
Nov. 06, 2007Terry
Thank you for your comment. However, the reason I was trying all the different widths and heights was always to get rid of the 'white box' round the player.
But I now realise after seeing everyone else's players, including this site, that the white box round the player seems to be the normal in IE.
My mate Peter Pilgrim advised me to add my site's background color code in the first set-up line, and now the white unsightly box is now invisible.
I did this
...("flvplayer.swf","single","320","240","7", "#E0E0FF");
that combined with creating the 'div', which is considered the full proof method of creating the player, everything is now working brilliantly.
*Terry*
Nov. 06, 2007andersen
@Terry
glad you got it working -
now if we had seen a link to your testpage to begin with, it had been clearer that the problem was the newline that a <p> produces and which a <div> doesnt...
Nov. 06, 2007Terry
Ok...my wrist has been slapped! I will never <p> again.
But the color code also helped to hide the offending box, so hope that was at least a wee bit helpful for others...us lassies are fussy about our design.
Thanks again for your time and energy.
*Terry*
Nov. 06, 2007Peter
A web design question @Anderson and @jw
Is it true that <p> produces an implicit newline, whereas a <div> does not do this?
In any case this does not solve the issue of the IE7 rendering, which appears to be "off". I examined closely the pixel width and height of rendering of the FLV Player in Firefox 2 and Internet Explorer 7. The actual players appear to have the same dimensions by the naked eye. Right now, I do not have explanation for why the pixel dimensions of IE7 are incorrect. I do know some IE7 users have the bug and some other IE7 user do not see this issue at all.
The workaround for it is to hide the white box that appears on the lower bottom and right of the FLV Player, if you have non-white background web site. As I explained to Terry introducing the Sixth parameter in the JavaScript object constructor changes the background color of the Flash canvas, which is inside the FLV player.
This is the full code I used to test this below:
(Here, I changed the flash canvas colour to steel blue ("#D0D0FF"), where as the web page has a white background colour. If you can see the steel blue colour in IE7 and understand the HTML code, then you can see the rendering bug!
)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>FLV Player Test</title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
function createPlayer1() {
alert("Testing");
var s1 = new SWFObject("flvplayer.swf","single","300","170","7", "#D0D0FF" );
s1.addParam("allowfullscreen","true");
s1.addVariable("file","video.flv");
s1.addVariable("image","preview.jpg");
s1.addVariable("width","300");
s1.addVariable("height","170");
s1.write("player1");
}
</script>
</head>
<body onLoad="createPlayer1()" bgcolor="#FFFFFF">
<h1>FLV Player Test</h1>
<div style="background-color: #FF0000; color: #FFFFFF; width: 300px; height: 260px; padding: 0px; margin: 0px;" >
test rectangle
</div>
<br clear="all" />
<div id="player1" style="float:top; text-align: left; background-color: #CCFFCC; width: 600px;"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<br clear="all" />
<hr>
</body>
</html>
HTH somebody!
Nov. 06, 2007andersen
Is it true that <p> produces an implicit newline, whereas a <div> does not do this?
absolutely!
when i try your code i see no blue color in my ie7 (flash9)
it is a fact that there are differences in how the various browsers interprete stylesheets in particular
Dec. 16, 2007Carlos
please helpme.
this code works for me in Mozilla Firefox, but not in Internet Explorer 7.
<script type="text/javascript" src="swfobject.js"></script>
<p id="video1"><a target="_blank" href="http://www.adobe.com/go/getflashplayer">Instale Adobe Flash Player</a> y/o active Javascript en su navegador para poder ver los videos.</p>
<br>
<p>----------</p>
<script type="text/javascript">
var s1 = new SWFObject("player.swf","single","352","240","7");
s1.addParam("allowfullscreen","false");
s1.addVariable("file","videos/video1.flv");
s1.addVariable("width","352");
s1.addVariable("height","240");
s1.write("video1");
</script>
Dec. 16, 2007Carlos
at last, i have found a solution:
<object type="application/x-shockwave-flash" data="player.swf" id="player" height="240" width="352">
<param name="allowScriptAccess" value="sameDomain">
<param name="movie" value="player.swf"><param name="quality" value="high">
<param name="scale" value="noScale">
<param name="wmode" value="transparent">
<param name="menu" value="false">
<param name="flashvars" value="&file=videos/video1.flv&height=240&width=352&allowfullscreen=false">
</object>
Dec. 16, 2007andersen
@Carlos
your first code works fine when i test it in IE ! - so the problem must be something else than the code you have posted...
Dec. 18, 2007Naveen
Due to some security reasons of the files i was forced to write the code in a slightly different manner.
Because of this i'm not able to show the player on IE6. This works fine in IE7 and firefox.
This is how i have written my code.
I was forced to make two files.
This is the first file which contains the following code.
File1.php:
<?php
$html .= "<script type='text/javascript' src='swfobject.js'></script>";
$html .= "<div id='player1'></div>";
$html .= "<script type='text/javascript' >";
$html .= "var s1 = new SWFObject('flvplayer.swf','single','400','320','0');";
$html .= "s1.addVariable('shownavigation','true');";
$html .= "s1.addVariable('file','file.flv');";
$html .= "s1.addVariable('height','320');";
$html .= "s1.addVariable('width','400');";
$html .= "s1.write('player1');";
$html .= "</script>";
print 'document.write("'.$html.'")';
?>
This is my second file from where i call the first file.
file2.php
<html>
<head>
</head>
<body>
<div>
<script type='text/javascript' src='swfobject.js'></script>
<script src="File1.php" ></script>
</div>
</body>
</html>
When i access file2.php from any browser it works fine but in IE6 it just shows a blank page. When I right click on the location where player whould appear it shows "Movie Not Loaded";
Can someone look into this
Dec. 20, 2007Serious IE probs
Same here: upgraded from 3.12 to 3.13. Could not get it to show in IE, FF worked OK. Adding extra width and height parameters solved issue for IE7 but IE6 is still a mess. I have the player installed in a directory, btw, which always complicates things a bit. Usually experimenting with some slashes works OK. But not now.
Noticed a few other things:
s1 in variables had been replaced by so.
'single' in player script has been replaced by 'player'. Unclear why, and wondering whether this should change with the id, too. (player1, player2).
Double quotes in player script have become single quotes. Is this necessary?
The result is a player that is not usable any more for my sites so I'll try to revert to 3.12.
Dec. 20, 2007andersen
@Serious IE probs
s1 or so - 'single' or 'player' are just names and can be almost anything as long as you keep it consistant -
wondering whether this should change with the id - no!
Double quotes in player script have become single quotes. Is this necessary? no! - as long as you keep it consistant and doesnt nest them...
do you have the player code inline in the page? or placed proper in the head wrapped in a function?
please see the (source of the) [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/minimal_but_safe.htm]minimal but safe[/url] demo on the [url=http://home5.inet.tele.dk/nyboe/flash/mediaplayer/]demopage[/url] - does that show in your ie6 ?
also make sure your flash plugin is up to date: [url=http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507]adobe version test[/url] (dec. 07 - v.9.0.115)
Dec. 21, 2007Naveen
@andersen
an you please look into my previous post?
Dec. 21, 2007andersen
@Naveen
sorry, i dont know enough php, and dont have an ie6 -
but what happens if you try make an experiment without the php stuff, can you then make it play?
have you checked the plugin version in your ie6 (see link above)
Dec. 22, 2007Hans
@andersen
do you have the player code inline in the page? or placed proper in the head wrapped in a function?
please see the (source of the) minimal but safe demo on the demopage - does that show in your ie6 ?
http://www.hansvandenberk.com/?q=node/8
I use a CMS and it is difficult to put the swfobject code in head for one type of content only. So I just put both scripts in pure unfiltered html pages. I have been using the code given by Jeroen this way for five versions of the player, always worked OK. It suddenly stopped with 3.13.
The safe example you pointed me to is funny, als the code is different and the player is 3.12 :o)
Dec. 24, 2007astgtciv
Jeroen changed something with the way the player does its initialization/layout (2.99 was fine but 3.13 is affected, don't know about between) which caused the IE caching bug to start affecting it (when a swf is loaded from the cache by IE (and when you refresh a page in IE, everything gets loaded from the cache), somehow it's "not ready" at the very beginning). In any case, I worked around this problem by changing the code in the first frame of the flvplayer.fla:
Change
var mpl = new com.jeroenwijering.players.MediaPlayer(this.player);
to
function launch() {
// show everything and launch
_root._visible = true;
this.mpl = new com.jeroenwijering.players.MediaPlayer(this.player);
}
// hide everything until we launch
_root._visible = false;
// launch in 10 milliseconds when things are initialized
setTimeout(mx.utils.Delegate.create(this, launch), 10);
Joeroen might want to do a "proper fix" for this though
Jan. 06, 2008Cesar Nino
Hi,
astgtciv , great solution!
Thx.
Mar. 01, 2008astgtciv
Actually, maybe make that setTimeout(mx.utils.Delegate.create(this, launch), 100);
I think the timeout has to be longer than one frame of the video... doesn't matter much from the visual perspective.
Mar. 15, 2008mp
I'm not able to check with ie... is the error still present with 3.15 version?
Thanks
Mar. 17, 2008laci
Hi,
My player works ok on ff but on ie7 i get a runtime error: Error 'mpl' is undefined.
here is my code:
var so = new SWFObject('flash/mediaplayer.swf','mpl','360','252','8');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addVariable('height','252');
so.addVariable('width','360');
so.addVariable('file','flash/playlist.xml');
so.addVariable('javascriptid','mplayer');
so.addVariable('autostart','true');
so.addVariable('repeat','true');
so.addVariable('enablejs','true');
so.write('adv1');
pelease help me!
thanks
Mar. 17, 2008andersen
@laci
try change addVariable('javascriptid','mplayer') to addVariable('javascriptid','mpl') - make sure you use the same id everywhere
Mar. 17, 2008laci
I changed addVariable('javascriptid','mplayer') to addVariable('javascriptid','mpl') and I get the same javascript error.
Mar. 17, 2008andersen
@laci - do you have the function thisMovie(swf)? also remember the javascript api only works online! please see this [url=http://www.jeroenwijering.com/?thread=3523#msg57537]thread[/url]
Jan. 19, 2009Jethro
The defer="defer" worked on getting the player to show up in my html page. but now I am noticing on refresh (F5) that the player comes up every other time(refresh). if I have my player on IE6 page, hit F5, I get the error: "Cannot open the page, operation aborted" if I hit ok, then F5 again, I see the movie player and it works! any thoughts? FF works just fine all day. here is my code in the page for the player.
<div align="center"><div id="player">
<div align="center">
<div align="left">
<div align="center">
<!--<script type="text/javascript" defer="defer" src="http://centresportsman.com/movies/swfobject.js"></script>--> <div id="player">This text will be replaced</div>
<script type="text/javascript" defer="defer">
var so = new SWFObject('http://centresportsman.com/movies/player.swf','mpl','450','420','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=http://centresportsman.com/movies/Big_Cat3.flv');
so.write('player');
</script>
</div>
</div>
</div>
</div> </div>
Jan. 19, 2009lefTy
Upgrade to swfobject v2.1.
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
<script type='text/javascript'>
var flashvars =
{
'file': 'http://centresportsman.com/movies/Big_Cat3.flv'
};
var params =
{
'allowscriptaccess': 'always',
'allowfullscreen': 'false'
};
var attributes =
{
'id': 'mpl',
'name': 'mpl'
};
swfobject.embedSWF('player.swf', 'player', '450', '420', '9.0.124', false, flashvars, params, attributes);
</script>
</head>
<body>
<div id="playercontainer" class="playercontainer" align="center">
<a id="player" class="player" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Flash Player to see these videos.</a>
</div>
</body>
Feb. 05, 2009syd
hi
i get "operation aborted" error message in ie6 and ie7
how can i fix that.
thanks
<style type="text/css">
#copyright {display:none;}
</style>
<div id="videoplayer<?php echo $count ?>"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript" src="<?php echo JURI::base();;?>modules/mod_simple_video_flash_player/swfobject.js"></script></html>
<script type="text/javascript">
var s1 = new SWFObject("<?php echo JURI::base();;?>modules/mod_simple_video_flash_player/<?php echo $player ?>","ply<?php echo $count ?>","<?php echo $width ?>","<?php echo $height ?>","<?php echo $version ?>","#FFFFFF");
s1.addParam("allowfullscreen","true");
s1.addParam("allowscriptaccess","always");
s1.addParam('wmode','opaque');
s1.addParam("flashvars","file=<?php echo $video ?><?php echo $preview ?><?php echo $logo ?><?php echo $link ?><?php echo $repeat ?><?php echo $shuffle ?><?php echo $autostart ?>");
s1.write("videoplayer<?php echo $count ?>");
</script>
<div id="copyright">Support: <a href="http://www.time2online.de">Simple Video Flash Player Module</a></div>
Feb. 05, 2009lefTy
Looks like you ended your HTML document a little early???
<style type="text/css">
#copyright {display:none;}
</style>
<div id="videoplayer<?php echo $count ?>">
<a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.
</div>
<script type="text/javascript" src="<?php echo JURI::base();;?>modules/mod_simple_video_flash_player/swfobject.js"></script>
</html>
<script type="text/javascript">
var s1 = new SWFObject("<?php echo JURI::base();;?>modules/mod_simple_video_flash_player/<?php echo $player ?>", "ply<?php echo $count ?>", "<?php echo $width ?>", "<?php echo $height ?>","<?php echo $version ?>", "#FFFFFF");
s1.addParam("allowfullscreen", "true");
s1.addParam("allowscriptaccess", "always");
s1.addParam('wmode', 'opaque');
s1.addParam("flashvars", "file=<?php echo $video ?><?php echo $preview ?><?php echo $logo ?><?php echo $link ?><?php echo $repeat ?><?php echo $shuffle ?><?php echo $autostart ?>");
s1.write("videoplayer<?php echo $count ?>");
</script>
<div id="copyright">
Support:
<a href="http://www.time2online.de">Simple Video Flash Player Module</a>
</div>
Mar. 09, 2009ceylan1000
@syd
Put this code in your html page and disable the Simple Video Flash Player Module and test it again.
Do you have the same problem?
<script type="text/javascript" src="http://www.jeroenwijering.com/embed/swfobject.js"></script>
<div id="player">This text will be replaced</div>
<script type="text/javascript">
var so = new SWFObject('http://www.longtailvideo.com/jw/embed/player.swf','mpl','470','320','9');
so.addParam('allowscriptaccess','always');
so.addParam('allowfullscreen','true');
so.addParam('flashvars','&file=http://content.bitsontherun.com/videos/3ta6fhJQ.flv');
so.write('player');
</script>
Mar. 17, 2009Matt
I'm having the same issue in IE7 (js error 'mpl is undefined'). I've tried using the code listed in ceylan1000's post.
I do not get the error in FF3 or Chrome (latest dev channel)
Mar. 17, 2009Matt
I don't get the error after updating to Flash 10, but I don't think that's an acceptable solution here. I tried swfobject 2.1 too, which did not change the error.
Here are some helpful links to learn more about the JW Player™:
Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!
If you don’t buy a commercial license, you cannot use a JW Player™ on (i) a site that has ads; (ii) a corporate site; or a (iii) CMS. Our licenses are very inexpensive, so what are you waiting for? Buy a license today.