admin管理员组文章数量:1333413
I'm loading an SWFObject within an HTML file.
With the next line I create an player within this object.
var s1 = SWFObject( '.swf',
'mediaplayer', '480', '388', '7');
How can I control this player, like play/pause or fullscreen the player with a seperate function? So I can control it from JAVA?
Thanks.
I'm loading an SWFObject within an HTML file.
With the next line I create an player within this object.
var s1 = SWFObject( 'http://www.dumpert.nl/mediabase/player4.swf',
'mediaplayer', '480', '388', '7');
How can I control this player, like play/pause or fullscreen the player with a seperate function? So I can control it from JAVA?
Thanks.
Share Improve this question edited Oct 29, 2011 at 17:33 Bakudan 19.5k9 gold badges55 silver badges75 bronze badges asked Aug 30, 2011 at 16:09 IonIon 11 silver badge1 bronze badge2 Answers
Reset to default 3Yes, read docs
http://code.google./p/swfobject/wiki/api
SWFObject JavaScript API documentation
SWFObject 2 contains an API that allows JavaScript developers to reuse SWFObject's internal functions and aims to deliver a plete tool set for publishing SWF's and retrieving Flash player related information.
but it also depends on what API provides the final SWF (Flash) app, if it cannot be controlled from outside, you cannot do anything via Javascript
SWFObject is only a means to embedding a Flash object in an HTML page. If you want the ability to control the functionality of a Flash based video player, You need to municate with it using ExternalInterface.
You will need to ensure that functionality is written into the video player to catch calls from the JavaScript and act on them. Here's a really simple example:
AS3:
//assume an FLVPlayback ponent called myPlayer
function stopVideoCallback():void
{
myPlayer.stop();
}
ExternalInterface.addCallback("stopVideo", stopVideoCallback);
JS:
swfobject.getObjectById('mediaplayer').stopVideo();
本文标签: htmlHow to control an SWFObject in javascriptStack Overflow
版权声明:本文标题:html - How to control an SWFObject in javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742332497a2454973.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论