So swfobject just embeds your swf onto the page. The implementation of whether you can control a certain swf (to play/pause etc) is down to the individual swf player and if it has a JS API callable through ExternalInterface<http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html>methods.
Some video players like the JW media player have a JS API which you can call from the host page. Others, likie the default Adobe FLVplayeback do not, and the author whould have to roll their own external interface methods in their swf file before embedding onto t a page. Here are some JW media player JS api tuts (which use swfobject 2.x) : http://home5.inet.tele.dk/nyboe/flash/mediaplayer4/JW_API_TEC.html Here is the official API wiki page: http://developer.longtailvideo.com/trac/wiki/FlashApi Cheers, Aran On Thu, Sep 3, 2009 at 8:53 AM, teamz <b...@zimbio.com> wrote: > > i'm just getting my feet wet, and running into a fundamental problem. > i'm simply trying to control the flash player from javascript, and all > the old controls i used to use (player.play(), player.pause(), etc) > seem to be undefined for the object. all i want to do is load the > flash player and then mute or unmute it from javascript, and i'm > hoping not to muck with flash code (which I don't know). > > here is what i'm doing: > > > <div id="myObject"></div> > <script type="text/javascript" src="http://ajax.googleapis.com/ajax/ > libs/swfobject/2.2/swfobject_src.js"></script> > <script> > function playerCallback(e){ > //i'm trying to play, pause, or mute the player > //var obj == document.getElementById("myObject"); > //i've tried obj.play(), obj.pause(), obj.mute(), obj.sendEvent(), > they're all not existing properties. > } > > (function(){ > var config = { > player: "{$swf_file}", > div: "myObject", > width: "300", > height: "250", > version: "9.0.0", > express: "{$swf_file}" > }; > var flashvars = { > File: "{$flv_file}", > Mode: "ondemand", > AutoPlay: "true" > }; > var params = { > allowFullScreen: "true", > allowScriptAccess: "always" > }; > var attributes = { > id: "myId" > }; > swfobject.embedSWF(config.player, config.div, config.width, > config.height, config.version, config.express, flashvars, params, > attributes, playerCallback); > })(); > > the player and flv file load just fine, but no matter i try a callback > function, window onload event, grab myObject or myId, i just can't > figure out how to get to the basic player controls. i enumerate > through the object tag properties and don't see any relevant methods > or properties to use. i also tried this using traditional embeds > instead of swfObject and i'm running into the same basic problem, so > probably i either don't understand the new flash api, or the > functionality has been removed somehow. i have flash 10 installed, > running firefox 3.5. > > thanks in advance. > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to swfobject@googlegroups.com To unsubscribe from this group, send email to swfobject+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/swfobject?hl=en -~----------~----~----~----~------~----~------~--~---