0

我想知道它是否可以在 Flash 播放器控制器的某些部分上删除或自定义。我有一个嵌入标签,可以从 Ustream 生成视频。情况是有一个共享按钮,我不希望它在那里。目前,流媒体提供商不允许用户禁用它。

在此处输入图像描述

我也试过在 jwplayer 上播放视频,但他们不支持,这是因为一些跨域限制。所以我在想Javascript是否有能力为我删除按钮。如果没有,谁能给我一些替代方案?

这是我生成的嵌入标签

<object width="320" height="260">
<param name="flashvars" value="autoplay=false&amp;vid=1234" />
<param name="allowfullscreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="src" value="http://www.ustream.tv/flash/viewer.swf" />
<embed 
    flashvars="autoplay=false&amp;vid=1234" 
    width="320" 
    height="260" 
    allowfullscreen="true" 
    allowscriptaccess="always" 
    src="http://www.ustream.tv/flash/viewer.swf" 
    type="application/x-shockwave-flash" />
</object>
4

1 回答 1

1

You can't hide the button through JavaScript unless the player has some kind of ExternalInterface API for you to work with (unlikely). You could load their entire player inside another swf of your own, for example using a Loader component (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.html):

var url:String = "http://www.ustream.tv/flash/viewer.swf?autoplay=false&vid=1234";
var urlReq:URLRequest = new URLRequest(url);
ldr.load(urlReq);
addChild(ldr);

Once the player has loaded, you will have access to it via the loader's content property. How much access may depend on the swf's version and security settings, and you may need to set the security and app domain's of the LoaderContext before loading the url request.

Assuming you can get access to the loaded swf, you then need to walk down the tree of DisplayObjects until you find the button you want to hide. This is probably going to be a case of trial and error. Once you get to it, it's just a case of setting visible=false;

Alternatively, you could use CSS to position a bit of coloured DIV over the top of the button. That's not likely to look very good, though.

于 2012-10-02T08:51:59.487 回答