Rio
Rio

Reputation: 14882

jQuery replaceWith on Flash object parameters?

Given a

<div id="dialog" style="display:none; width:100%; vertical-align:middle;">
    <object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="628" height="400">
        <param name="movie" value="../../help/videos/videoplayer.swf" />
        <param name="allowfullscreen" value="true" />
        <param name="allowscriptaccess" value="always" />
        <param name="flashvars" value="file=../../help/videos/video.flv" />
        <object type="application/x-shockwave-flash" data="../../help/videos/videoplayer.swf" width="628" height="400">
            <param name="movie" value="../../help/videos/videoplayer.swf" />
            <param name="allowfullscreen" value="true" />
            <param name="allowscriptaccess" value="always" />
            <param name="flashvars" value="file=../../help/videos/video.flv" />
        </object>
    </object>

Why won't a

$("#dialog").find('<param name="flashvars" value="file=../../help/videos/video.flv" />').replaceWith('<param name="flashvars" value="file=../../help/videos/myfile.flv" />');

work?

Upvotes: 1

Views: 4975

Answers (2)

HanZoong Oh
HanZoong Oh

Reputation: 1

    var flashhtml = $("object").html();
    $('object').before("<div id='mydiv'>내 div</div>");
    $('object').remove();
    var flashattr = 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="583" height="297">';
    $('#mydiv').html('<object ' + flashattr + '<param name="wmode" value="transparent">' + flashhtml + '</object>');

Upvotes: 0

Christian C. Salvad&#243;
Christian C. Salvad&#243;

Reputation: 827316

You are not passing a selector to find, you could do something like this:

$('#player param[name=flashvars]').attr('value','new value');

Upvotes: 3

Related Questions