JW Player: cross-browser mode "display: none"

Is there a simple, preliminary method for FF and IE to treat hidden JW players the same way?

I place different player instances dynamically in bookmarks created by jQuery. In fact, the switch tabs hide each player’s parent div. In FireFox, the tab switch and the accompanying “display” replace the player. This does not happen in IE. I would like that.

What is the easiest way to get both browsers to act the same? I hope for a CSS / HTML solution, either carefully, as the players are embedded, or a style rule. Otherwise, I suppose I will need to add an element listener that compares the currently selected tab id with the active players at the moment ... but I'd rather not go this route.

Thanks for your advice!

EDIT . Thus, I would rather change the CSS player or layout when changing tabs, than send stop events to all players, but to the player in the current active tab.

+3
source share
3 answers

Internet Explorer. FF, Chrome Safari Flash, IE . , , , - .

,

, LongTail Video

+3

JavaScript , CSS/HTML ?

, JavaScript.

API JW Player: http://developer.longtailvideo.com/trac/wiki/Player5Api

stop() .

player.stop();
0

, . , ... : - div (jwplayer) - div (, )

( IE) , popover , (!), ! , , - ( ).

, , . script, jwplayer.

<div id="Player">player should load here</div>
    <script language="javascript" type="text/javascript">
    var flashvars = {};
    flashvars.linkfromdisplay = "true";
    flashvars.autostart = "false";
    flashvars.height = "' . $h . '";
    flashvars.controlbar = "over";
    flashvars.width = "' . $w . '";
    flashvars.repeat = "false";
    flashvars.bufferlength = "5";
    flashvars.displayheight = "' . $h . '";
    flashvars.displaywidth = "' . $w . '";
    flashvars.file = "http://blablabla.com";
    flashvars.type = "vdox";
    flashvars.provider = "vdox";
    var params = {};
    params.menu = "true";
    params.allowscriptaccess = "always";
    params.allowfullscreen = "true";
    params.wmode = "transparent";
    params.windowless="true";
    var attributes = {};
    attributes.id = "Player";
    attributes.name = "Player";
    swfobject.embedSWF("' . get_bloginfo("template_directory") . '/embed/mediaplayer.swf", "Player", "' . $w . '", "' . $h . '", "8","expressInstall.swf", flashvars, params, attributes);
    </script>

js- popover (player1.sendEvent('STOP');): , , .

I also tried removing the video element using jquery, storing it in a variable. Then I insert the “restore video” button: it works in Chrome, the video object appears in IE again, it plays, but everything is black. Thanks

0
source

Source: https://habr.com/ru/post/1743226/


All Articles