This is an examples of the youtube embed code on my site:
<object width="525" height="320"><param name="wmode" value="opaque">
<param name="movie" value="http://www.youtube.com/v/yciTqWafKPU?version=3">
<param name="allowFullScreen" value="true">
<param name="allowscriptaccess" value="always">
<embed src="http://www.youtube.com/v/yciTqWafKPU?version=3" type="application/x-shockwave-flash" width="525" height="320" allowscriptaccess="always" allowfullscreen="true" wmode="opaque">
</object>
I believe I need to add &autoplay=1 to this: <param name="movie" value="http://www.youtube.com/v/yciTqWafKPU?version=3&autoplay=1"> and this: <embed src="http://www.youtube.com/v/yciTqWafKPU?version=3&autoplay=1" type="application/x-shockwave-flash" width="525" height="320" allowscriptaccess="always" allowfullscreen="true" wmode="opaque">
I need to do this dynamically with JQuery. How would I do this?
Without too much difficulty, I would have thought…
You might prefer to do a slightly more specific selector, for instance
$('embed[src^="http://www.youtube.com/"]')or perhaps$('object param[name="movie"]')— it depends on what your page contains elsewhere…See the API reference:
attribute-equalsselectorvalprop