SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking How to control a swf player in an iframe? Any Smart Takers?

    Hey everyone ,

    Does anyone knows how to control a swf player in an iframe?
    Eg. I have a website that automatically plays video at
    http://www.web1.com
    and I have another website where web1.com is inserted as an iframe
    how can i control the swf player in web1.com from another website?
    eg. web2.com

    Here's the swf player code in web1.com
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="571" height="429" id="player" align="">
    <param name="allowScriptAccess" value="always" />
    <param name="movie" value="player.swf" />
    <param name="quality" value="high" />
    <param NAME=scale VALUE=noscale>
    <param NAME=salign VALUE="LT">
    <param NAME=FlashVars VALUE="contentPath=FLWL.flv&affiliateID=12332&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=true&hasVideoChrome=true">
    <param name="bgcolor" value="#ffffff" />
    <embed src="player.swf" FlashVars="contentPath=DAWL.flv&affiliateID=573413&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=true&hasVideoChrome=true" quality="high" scale=noscale bgcolor="#ffffff" width="571" height="429" name="player" salign="lt" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    <!-- END FLVProducer code -->

    Anyone one smart enought to solve this?

    Been cracking my head at it

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    JavaScript isn't able to touch the content of an iframe on a different domain; security built into the browser. If you can get that object code from the second domain server-side and inject it into the page on the same domain, then you can use JavaScript to try some things.

  3. #3
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what if it is the same domain?

    I tried a few ways within the same page...

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="571" height="429" id="player" align="">
    <param name="allowScriptAccess" value="always" />
    <param name="movie" value="player.swf" />
    <param name="quality" value="high" />
    <param NAME=scale VALUE=noscale>
    <param NAME=salign VALUE="LT">
    <param NAME=FlashVars VALUE="contentPath=FLWL.flv&affiliateID=573413&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=true&hasVideoChrome=true">
    <param name="bgcolor" value="#ffffff" />
    <embed src="player.swf" FlashVars="contentPath=FLWL.flv&affiliateID=573413&bufferTime=5&autoPlay=true&startStreaming=true&hasInfoButton=true&hasVideoChrome=true" quality="high" scale=noscale bgcolor="#ffffff" width="571" height="429" name="player" salign="lt" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    <!-- END FLVProducer code -->

    I tried

    <script language="JavaScript"><!--
    document.getElementById("player").autoPlay="false";
    //--></script>

    but it does not work

    i realized that when i change <object....VALUE="autoPlay=false...>
    it still plays

    but when i change
    <object....<embed....FlashVars="autoPlay=false"...>
    it works...

    how can i access <embed....FlashVars="autoPlay=false"...> within a javascript and change it to autoplay=false?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •