0

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.

2 Answers 2

3

Yes, read docs
http://code.google.com/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 complete 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

Sign up to request clarification or add additional context in comments.

Comments

3

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 communicate 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 component called myPlayer
function stopVideoCallback():void
{
    myPlayer.stop();
}
ExternalInterface.addCallback("stopVideo", stopVideoCallback);

JS:

swfobject.getObjectById('mediaplayer').stopVideo();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.