html - How to control an SWFObject in javascript? - Stack Overflow

I'm loading an SWFObject within an HTML file.With the next line I create an player within this obj

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 badge
Add a ment  | 

2 Answers 2

Reset to default 3

Yes, 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();

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742332498a4423998.html

相关推荐

  • html - How to control an SWFObject in javascript? - Stack Overflow

    I'm loading an SWFObject within an HTML file.With the next line I create an player within this obj

    13小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信