JW Player: cross-browser “display:none” player behavior

放肆的年华 提交于 2019-12-01 00:43:37

This is an issue with Internet Explorer. While FF, Chrome, and Safari will kill Flash, IE doesn't. The only way we've been able to ensure that the player stops is to keep track of all active players on the page and call stop.

Best,

Zach

Developer, LongTail Video

If you're using JavaScript to change tabs, why are you hoping for a pure CSS/HTML solution for your problem?

I think you have to use JavaScript.

Take a look at the JW Player API: http://developer.longtailvideo.com/trac/wiki/Player5Api

You can call the stop() method on the player.

player.stop();

Sorry my friend. I've a big trouble that doesn't make me sleep... I've a site with: - a div with a video (jwplayer) - a div with a gallery (lightbox, on click popover of image)

If video play and a user (only with IE) click on a image, the popover appears over video, the video continues to play (ok!) but video goes blank! When I close image popover, video timeline play normally but video is still blank (all black).

I've been try to use what you wrote here but without success. This is the script I must use to insert 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>

I tried also to stop via js video before open popover (player1.sendEvent('STOP');): video stops, but if I click on play button, remains black.

I tried also to remove video element via jquery, saving it in a variable. Then I insert a button "restore video": in Chrome works, in IE reappear video object, it play but all black. Thanks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!