HTML Embed object has a grey background. Can it be

2019-07-09 13:32发布

问题:

I'm using Firefox with an opensource plugin to playback video. The video is scaled "as good as possible" to fit the available space defined in the width and height of the embed object. But sometimes there is a little grey border on the right and/or bottom.

It seems this isn't the bgcolor of my parent div as changing it has no effect at all.

This is the HTML:

<div id="videoHolder" style="position: absolute; left: 50px; top: 50px; width: 300px; height: 150px;">
 <embed id="player" width="300" height="150" border="0" type="application/x-gbp" x-gbp-uri="">
</div>

Anyone knows of a way to define an embed to be transparent? Setting wmode=transparent as with Flash has no effect...

Thanks, Frank

回答1:

There is no general way to tell plugin elements to be transparent from the browser-side, plugins need to support that themselves in their native code.

For Flash setting the wmode="transparent" works, but only because Flash implements that itself.



回答2:

Try adding the "wmode" attribute and setting it's value to "transparent":

<div id="videoHolder" style="position: absolute; left: 50px; top: 50px; width: 300px; height: 150px;">
    <embed WMODE="transparent" id="player" width="300" height="150" border="0" type="application/x-gbp" x-gbp-uri="">
</div>