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

Forums

/

flashvar controlbar => black screen on IE

33 replies [Last post]

Hello,

I have discovered something very ...Hello,

I have discovered something very ridiculous.

If I use the controlbar flash variable while embedding JW FLV Player version 4.5, I sometimes get a black screen with sound. The problem occurs only on some versions of Internet Explorer. (my version is 7.6)

I said "sometimes", because the same page may experience this problem after refreshing.

The problem doesn't occur on Firefox!

Sample code:

<script src="swfobject.js" type="text/javascript"></script>

<div id="container">Install <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a></div>

<script type="text/javascript">
  var so = new SWFObject('player-4.5.swf','playerID','320','240','8');
  so.addParam('allowscriptaccess','always');
  so.addParam('allowfullscreen','true');
  so.addVariable('width','320');
  so.addVariable('height','240');
  so.addVariable('displayheight','240');
  so.addVariable('streamer','rtmp://XXX:1980/simplevideostreaming');
  so.addVariable('file','ahekim-15.06.2009.flv');
  so.addVariable('type','rtmp');
  so.addVariable('controlbar','over');
  so.addVariable('javascriptid','playerID');
  so.addVariable('id','playerID');
  so.addVariable('enablejs','true');
  so.addVariable('autostart','true');
  so.addVariable('kullaniciid','1');
  so.write('container');
</script>

PS: SWFObject v1.5

streaming server is Wowza 1.7.2

 
You have quite a few v3.x JW FLV Media Player flashvars mixed in your player embedding JavaScript code.

1) You should specify a minimum Adobe Flash Player version of v9,0,124,0. Flash9 is required by the JW FLV Player, some of the advanced Flash features require later versions of Flash9.

2) height and width are read-only flashvars, not useful in player code.

3) displayheight is a v3.x flashvar.

4) javascriptid is a v3.x flashvar.

5) enablejs is a v3.x flashvar.

6) I'm assuming that kullaniciid is a custom flashvar that you have added to the player source.

7) The problem that you are experiencing on page reload in Internet Explorer is caused by an incomplete reload of the Flash movie file. It can usually be solved by adding a random number to the Flash movie file, forcing a fresh load from the server. Don't miss the "?" after "player-4.5.swf".

    <script src="swfobject.js"></script>

    <div id="container">Install <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a></div>

    <script type="text/javascript">
      <strong>var rndNum = Math.round(1000 * Math.random());</strong>

      var so = new SWFObject(<strong>'player-4.5.swf?' + rndNum,</strong> 'playerID', '320', '240', <strong>'9.0.124'</strong>);
          so.addParam('allowscriptaccess',   'always');
          so.addParam('allowfullscreen',     'true');
          so.addVariable('streamer',         'rtmp://XXX:1980/simplevideostreaming');
          so.addVariable('file',             'ahekim-15.06.2009.flv');
          so.addVariable('type',             'rtmp');
          so.addVariable('controlbar',       'over');
          so.addVariable('id',               'playerID');
          so.addVariable('autostart',        'true');
          so.addVariable('kullaniciid',      '1');
          so.write('container');
    </script>

hi hobbs,

i have been using jw flv player since a long time ago. and the codes of v3 and v4 were all mixed.

this solved my problem. thanks!

if you set flash vars "stretching" as "fill", jw player will only show balck screen in IE6+;

 
@mustafa,

Good to hear that your player is working well.

    Good Luck!

hello
I'm having an issue in IE as well - the player works fine in Safari, Firefox on the Mac - in IE nothing happens if I click the play button - hope anybody has an idea how to fix this.

thanks

this is my code:
<
var swfObj = new SWFObject(player,'mpl','258','20','9');
swfObj.addParam('allowfullscreen','false');
swfObj.addParam('allowscriptaccess','always');
swfObj.addParam('wmode','opaque');

swfObj.addVariable('duration','5400');
swfObj.addVariable('file', file);
swfObj.addVariable('type', 'sound');
swfObj.addVariable('showicons', 'false');
swfObj.write(target);
>
and this:
<// toggle play
this.playEl.addEvent('click', function(e) {
var src = this.play ? 'btn-play.png' : 'btn-pause.png';
this.playEl.set('src', path + src);
this.player.sendEvent('PLAY'); // toggle PLAY
this.play = this.play ? false : true;
}.bind(this));>

 
@mmj,

showicons is not a supported flashvar.

Review the v4 player supported flashvars here: http://developer.longtailvideo.com/trac/wiki/FlashVars

It's impossible to determine what might be causing your issue just by looking at the snippets of code that you have posted. Post a link to your Test Page so someone can help you further. We can't guess.

so this could break IE but still works in Safari and Firefox - unfortunately, that wasn't the issue.

any other idea what to check for IE - by the way, the website can be found here: http://www.net4visions.com/istream.html

by the way, is there a way to programmatically hide the flash control bar?

 
The location/visibility of the player's control bar is controlled by the controlbar flashvar.

See: http://developer.longtailvideo.com/trac/wiki/FlashVars#Layout

There's no player code on the link that you posted and I'm not interested in searching through a lot of files to find it.

Anyway, some of your links fail with 404 errors, like this one:
http://www.net4visions.com/assets/site/js/moosound/MooSound.js

I kind of figured out what the problem is: my button events are not being set because in IE the following function does NOT get processed:

function playerReady(playerObj) {
alert('playerReady');
Site.setPlayer(playerObj);
}

any idea why in Safari, Firefox this is working but not IE?

 
You need to use the same name/id for the object attributes and the id flashvar.

var swfObj = new SWFObject(player, <strong>'jwPlayer'</strong>, '258', '20', '9.0.124');
swfObj.addParam('allowfullscreen', 'false');
swfObj.addParam('allowscriptaccess', 'always');
swfObj.addParam('wmode', 'opaque');
swfObj.addVariable('id', <strong>'jwPlayer'</strong>);
swfObj.addVariable('controlbar', 'none');
swfObj.addVariable('duration', '5400');
swfObj.addVariable('file', file);
swfObj.addVariable('type', 'sound');
swfObj.write(target);

I'm so sorry hobbs for being such a pain - still no luck in IE

this is what I have now:
var swfObj = new SWFObject(player,'jwPlayer','258','20','9.0.124');
swfObj.addParam('allowfullscreen', 'false');
swfObj.addParam('allowscriptaccess', 'always');
swfObj.addParam('wmode', 'opaque');

swfObj.addVariable('id', 'jwPlayer');
swfObj.addVariable('controlbar', 'none');
swfObj.addVariable('duration', '5400');
swfObj.addVariable('file', file);
swfObj.addVariable('type', 'sound');
swfObj.write(target);

Finally,
figured out what the issue is:

<
var target = new Element('div', {
styles: { height: 0, visibility: 'hidden', overflow: 'hidden' }
}).inject($('soundControls'));

//var target = new Element('div').inject($('soundControls'));
>

hiding the target element and inserting the player fails in IE8 - unfortunately, even setting controlbar to none, there is still some player stuff visible - at least it works now.

 
Yeah, for Flash content, "hidden" really means hidden.

You can always set the player to 1x1 pixel or just move it offscreen instead of hiding it.

hidden yes, but obviously only in IE?! Thanks for your patience and help.

I'm having a very similar problem but I've boiled it down to just a few lines:

<div id='preview'>The player will show in this paragraph</div>
<script type='text/javascript' src='swfobject.js'></script>
<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player','363','462','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars','file=anim.flv&autostart=true&repeat=always');
s1.addVariable('id', 'player');
s1.addVariable('controlbar', 'none');
s1.write('preview');
</script>

This code works but displays a control bar in both IE and FF. If I take out the controlbar variable and instead add &controlbar=none to the flashvars line, it works in FF but is black in IE. I tried adding the random number code but that did not seem to work. Suggestions?

 

<div id='preview'>The player will show in this paragraph</div>

<script type='text/javascript' src='swfobject.js'></script>

<script type='text/javascript'>
  var s1 = new SWFObject('player.swf', 'player', '363', '462', '9');
      s1.addParam('allowfullscreen',     'true');
      s1.addParam('allowscriptaccess',   'always');
      s1.addVariable('file',             'anim.flv');
      s1.addVariable('autostart',        'true');
      s1.addVariable('repeat',           'always');
      s1.addVariable('id',               'player');
      s1.addVariable('controlbar',       'none');
      s1.write('preview');
</script>

That got it Hobbs. I messed with that thing for hours. Thanks a mil!

 
@Jay,

You're welcome.

          [i]Good Luck![/i]

Hi,

So, my problem is with IE...

I use a jquery "popup" effect before loading my video, in FF no problem, but in IE the player is not loading in the preview div...

Anyone have solution ?

(Sorry for my english)

 
The best (and about the only way) to get useful, effective help is to post a link to your Test Page. We can't guess.

Sorry, I forget...

http://www.extrabat.org/temoignages

thanks

 
1) You have a mistake in the player URI:var s1 = new SWFObject('http://127.0.0.1/extrabat.org/hip/videos/player-2.swf', 'player1', '720', '456', '9');remove the 127.0.0.1 Always use www.

2) You should specify a minimum flash version of 9,0,124,0:var s1 = new SWFObject('http://<strong>www</strong>.extrabat.org/hip/videos/player-2.swf', 'player1', '720', '456', <strong>'9.0.124'</strong>);

3) The relative URL for all of your video files is wrong.
Your video files are here:http://www.extrabat.org/videos/extrabat1.flv
The relative URL should be:s1.addVariable('file',             '../../videos/extrabat1.flv');

Review the Tutorial Embedding Flash here:

    http://www.longtailvideo.com/support/tutorials

Relative URLs for FLV files ONLY, begin at the location of the Flash movie.

4) The JavaScript Flash-content embedding code should NOT be wrapped in the target div. Move the two div ending tags up above the JS, like this:

<div id="extrabat1" style="display:none">
  <div id='preview_extrabat1'>This text will be replaced</div>
  </div>
</div>

5) Use a more informative alternate content message:

<div id="extrabat1" style="display:none">
  <div id='preview_extrabat1'><strong><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a></strong></div>
  </div>
</div>

Hello,

ok, I do the correction (for the first video on the page), It's work fine in FF but still not working in IE...

Hi

I am having similar trouble to the guys in this forum. Again, the issue only occurs in IE (all versions). I think it is a caching issue perhaps as the flv plays fine on first load but then if you refresh the page or navigate away and return within a short time the flv doesn't restart. I have the controlbar set to none, but if I have it set visible it is possible to manually start the flv. Another odd trait is that if you open another tab in IE and return to your original tab and refresh it, it plays fine. Also if you wait a few minutes and refresh, again it plays fine.

The code I am using is :

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="homePageFlashVideo.ascx.cs" Inherits="resources_control_homePageFlashVideo" %>

<h2 class="logoBackgroundRight">Cruz Vision</h2>
<div class="flashHomePageVideo" id='mediaspace' align="center">Where is the video
</div>
<script type='text/javascript'>
var so = new SWFObject('/resources/flash/player.swf', 'mpl', '373', '209', '9');
so.addParam('allowfullscreen', 'false');
so.addParam('allowscriptaccess', 'always');
so.addParam('wmode', 'opaque');
so.addVariable('file', '/flash/novWeb.flv');
so.addVariable('image', '/images/flashTemp.jpg');
so.addVariable('autostart', 'true');
so.addVariable('icons', 'false');
so.addVariable('mute', 'true');
so.addVariable('repeat', 'always');
so.addVariable('controlbar', 'none');
so.write('mediaspace');
</script>

The site is http://preview.cruz101.com

Any suggestions gratefully appreciated.

Gerrard

Hi,

Your page works in IE6 and 7 for me, I have not been able to test with 8 though.

Best,
-Ethan

Hi Ethan

The page does work in IE but when you refresh the page the video doesn't replay. It does in Firefox, and if you set the controlbar to on it also plays - just not if it is set to none and refresh the page.

Thanks

G

Fixed!! Thanks for everyone's help.

G

Hi r1_lad,

What did you do to fix it?

Thanks,
-Ethan

Hi, i have the same problem
my code is

<div id='reproductorvideo'>Descarga flash player para ver este video </div>

<script type='text/javascript'>
var so = new SWFObject('player.swf','ply','474','356','9','#ffffff');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addParam('wmode','transparent');
so.addVariable('file','video.flv');
so.addVariable('skin','skin.swf');
so.addVariable('logo','logo.png');
so.addVariable('image','preview.jpg');
so.addVariable('controlbar','over');
so.addVariable('autostart','true');
so.write('reproductorvideo');
</script>

Hi, I'm also having problems with this. Everything's fine in Firefox but when I set controlbar to none the video isn't playing in IE.

Here's a link showing the problem (upper vid has controlbar and works in both browser, the one below doesn't):

http://www.enigma-interactive.co.uk/external/marianas/rugs/vidtest.html

And here's my code:

var s2 = new SWFObject('http://discover.planetstream.net/player/4-6/player4-6.swf','mpl','174','98','9.0.124');
s2.addParam('allowfullscreen',     'false');
s2.addParam('allowscriptaccess',   'always');
s2.addVariable('file',             'small01.f4v');
s2.addVariable('streamer',         'rtmp://fms.2170.planetstream.net/002170/modernrugs/');
s2.addVariable('autostart',        'true');
s2.addVariable('repeat',           'always');
s2.addVariable('id',               'mpl');
s2.addVariable('controlbar',       'none');
s2.write('videocontent2');

Hope you can help! Thanks, Mariana

@mariana -

Please update to the latest player version (5.3). This issue has been fixed.