Reputation: 913
I am using a video carousel to browse through videos and would like the current video to auto play.
All the videos are defaulted to "autoplay=false". What I am looking for is; if the class="current" then "autoplay=true"
<li class="NOT-current">
<object data="http://view.vzaar.com/12345" type="application/x-shockwave-flash">
<param value="showplaybutton=rollover&border=none&autoplay=flase" />
</object>
</li>
<li class="current">
<object data="http://view.vzaar.com/12345" type="application/x-shockwave-flash">
<param value="showplaybutton=rollover&border=none&autoplay=TRUE" />
</object>
</li>
<li class="NOT-current">
<object data="http://view.vzaar.com/12345" type="application/x-shockwave-flash">
<param value="showplaybutton=rollover&border=none&autoplay=false" />
</object>
</li>
I know there must be a very simple line of js to change this, maybe using find and replace, but I cant figure it out
Upvotes: 1
Views: 476
Reputation: 28131
If you're using jQuery, you could try this:
$("li.current object").context.play();
Upvotes: 0
Reputation: 6092
There must be some javascript you are using to change the class to current video object there only add a line $(videoObject).play();
to play the video
Upvotes: 0
Reputation: 410
I don't know about pure js, but you could try something like that with jQuery :
var object = $(".current").find("object");
object.children().attr("value", "showplaybutton=rollover&border=none&autoplay=TRUE");
Upvotes: 2