Go
Not registered? Sign up!

flashvar controlbar => black screen on IE

Google Translate
27 posts | return to the Bug Reports forum | get the rss feed for this thread

Nov. 02, 2009mustafa

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

Nov. 02, 2009mustafa

streaming server is Wowza 1.7.2

Nov. 02, 2009hobbs

 
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">
      var rndNum = Math.round(1000 * Math.random());

      var so = new SWFObject('player-4.5.swf?' + rndNum, 'playerID', '320', '240', '9.0.124');
          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>

Nov. 03, 2009mustafa

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!

Nov. 03, 2009FuDesign2008

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

Nov. 03, 2009hobbs

 
@mustafa,

Good to hear that your player is working well.

    Good Luck!

Nov. 06, 2009mmj

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

Nov. 06, 2009hobbs

 
@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.

Nov. 06, 2009mmj

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

Nov. 06, 2009mmj

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

Nov. 06, 2009hobbs

 
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

Nov. 06, 2009mmj

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?

Nov. 06, 2009hobbs

 
You need to use the same name/id for the object attributes and the id flashvar.
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);

Nov. 06, 2009mmj

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

Nov. 06, 2009mmj

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.

Nov. 06, 2009hobbs

 
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.

Nov. 06, 2009mmj

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

Nov. 08, 2009Jay

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?

Nov. 08, 2009hobbs

 

<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>

Nov. 09, 2009Jay

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

Nov. 09, 2009hobbs

 
@Jay,

You're welcome.

          Good Luck!

Nov. 12, 2009Nico.riv

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)

Nov. 12, 2009hobbs

 
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.

Nov. 12, 2009Nico.riv

Sorry, I forget...

http://www.extrabat.org/temoignages

thanks

Nov. 12, 2009hobbs

 
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://www.extrabat.org/hip/videos/player-2.swf', 'player1', '720', '456', '9.0.124');

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'><a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Get the Adobe Flash Player to see this video.</a></div>
  </div>
</div>

Nov. 13, 2009Nico.riv

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...

Nov. 18, 2009r1_lad

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

Add a reaction

You can also return to the category or try this search for related threads.


 

Search the Forums

Go

Support

Support Here are some helpful links to learn more about the JW Player™:

Monetize Your Video

Monetize Your Video Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!

Why Buy a License?

Why Buy a License? 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.