Note that there are some explanatory texts on larger screens.

plurals
  1. POSwfobject is changing "&"(ampersand) to "&" How do I stop it?
    primarykey
    data
    text
    <p>This is the object, generated by <code>swfobject</code>, that I want to embed.</p> <pre><code>&lt;object type="application/x-shockwave-flash" name="player" id="player" data="StrobeMediaPlayback.swf?ID=89.41153136547655" width="470" height="320"&gt; &lt;param name="flashvars" value="verbose=true&amp;amp;src=rtmp://s161ki0ys7euuz.cloudfront.net/cfx/st/_definst_/vid_cdntest001?Signature=q-ZT9mWcIorCwGS4xgOysTyRXoUB2yza~JGITwCwx5O0JObgvlvS728vGXaI0iaow4OA8JRdFOBWYeeLQ5klYcjsWtgjzqH37ZVyV-5pyEUgT80DzWOOM9ZVfd2xBaZjISdn4cNk03FRBZ85~Z4zoEkp8MweE2HEzfrHnzZjoXlaulsPuphg59ANZCGQFneGfSI33dYhzTRDnbZbTZAGilLeu8gjtvfgm9hQ80E1zVd7wuHR8hX7or2ZjTgmDBaq4i-Nj8rJI0w3CIKAOu7JBggvclltbDnzMvy76s4Ef~GowYS7GB0p07Whi512GmGB9W1n6TqUBS-m8QK4vvqC~w__&amp;amp;Key-Pair-Id=APKAJSRQXYNPUENHF6HQ&amp;amp;Expires=1387470161&amp;amp;urlIncludesFMSApplicationInstance=true"&gt; &lt;/object&gt; </code></pre> <p>It embeds the swf, but the swf isn't functioning as intended. My code is passing extra flashvars into the swf.</p> <p>I'm tracing all the parameters/flashvars that are sent to the swf. I get this:</p> <pre><code>PARAMS: = verbose PARAMS: = Expires PARAMS: = src PARAMS: = ID PARAMS: = urlIncludesFMSApplicationInstance PARAMS: = Key-Pair-Id </code></pre> <p>It's reading <code>Expires</code>, <code>ID</code> and <code>Key-Pair-Id</code> as flashvars, when those should all be part of the <code>src</code> param.</p> <p>The cause is the value of the <code>src</code> flashvar:</p> <pre><code>rtmp://s161ki0ys7euuz.cloudfront.net/cfx/st/vid_cdntest2?Signature=rlBXiKxXRHwSha9YB~GZjyojy8gWZXO18Ea5JLZf1PHvuJFfQE617Ea-5aq8QVoVANaSetnoHQMja76ERxBowjG8cIYxWTGP-UBzP2v-k0hZghNGTtn~qSaFRaSHJGMG59ZKW2EobOHDQxV4r7k-ZG3vAJJpFRm7SoP980DRoJM7J6oAhCUKzZOgv6uRT-StsPORU2Ny3iUx7dIf~QWYBbzfcP1cPrZnzlSx~TqnWK4oYJCGmNHjYlVbCvmYAFCRc3oFzdywzGQKeQpwqHMhR1DSrEnzMjC48mFyFXyDp5TL1qhMVNUDX~d6Ds6PoysCXV7zG8QawSdWhzwDoj4Gng__&amp;Key-Pair-Id=APKAJSRQXYNPUENHF6HQ&amp;Expires=1387556045" </code></pre> <p>If you compare the rtmp url with my malformed code, It's changing <code>&amp;</code> into <code>&amp;amp;</code> for some reason.</p> <p>At these semicolon locations, it must be breaking apart the string and reading the following values as a different flashvar.</p> <p>How can I stop this?</p> <hr> <p>This is what I'm doing to build the malformed html:</p> <pre><code>$(document).ready(function(){ callPlayer("rtmp://s161ki0ys7euuz.cloudfront.net/cfx/st/_definst_/vid_cdntest001?Signature=q-ZT9mWcIorCwGS4xgOysTyRXoUB2yza~JGITwCwx5O0JObgvlvS728vGXaI0iaow4OA8JRdFOBWYeeLQ5klYcjsWtgjzqH37ZVyV-5pyEUgT80DzWOOM9ZVfd2xBaZjISdn4cNk03FRBZ85~Z4zoEkp8MweE2HEzfrHnzZjoXlaulsPuphg59ANZCGQFneGfSI33dYhzTRDnbZbTZAGilLeu8gjtvfgm9hQ80E1zVd7wuHR8hX7or2ZjTgmDBaq4i-Nj8rJI0w3CIKAOu7JBggvclltbDnzMvy76s4Ef~GowYS7GB0p07Whi512GmGB9W1n6TqUBS-m8QK4vvqC~w__&amp;Key-Pair-Id=APKAJSRQXYNPUENHF6HQ&amp;Expires=1387470161"); }); function callPlayer(x){ $("#PlayerHolder").html("&lt;span id='PlayerDiv'&gt;&lt;/span&gt;"); var flashvars = { verbose:true, src: x, urlIncludesFMSApplicationInstance:true }; var parameters = {}; var attributes = {}; attributes.name="player"; attributes.id="player"; swfobject.embedSWF("StrobeMediaPlayback.swf?ID="+Math.random()*100,"PlayerDiv","470","320","11.2","scripts/expressInstall.swf", flashvars, parameters, attributes); } </code></pre> <p>The correct html is generated by <a href="http://osmf.org/dev/2.0gm/setup.html" rel="nofollow">this page</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload