scriptygoddess

29 Aug, 2011

Embed a vimeo video using swfobject and setting the audio to mute

Posted by: Jennifer In: Javascript|Video

Not too much to explain here – wanted to embed a vimeo video, and wanted it to autoplay, but wanted the volume set to mute to start…
<div id="myvideo"></div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript">
function vimeo_player_loaded() {
moogaloop3 = document.getElementById('myvideo');
moogaloop3.api_setVolume(0);
}
var flashvars = {
'clip_id': '29950141',
'server': 'vimeo.com',
'show_title': 0,
'show_byline': 0,
'show_portrait': 0,
'fullscreen': 0,
'autoplay': 1,
'js_api': 1,
'js_onload': 'vimeo_player_loaded'
}
var parObj = {
'swliveconnect':true,
'fullscreen': 1,
'allowscriptaccess': 'always',
'allowfullscreen':true
};
var attObj = {}
attObj.id="myvideo";
swfobject.embedSWF("http://www.vimeo.com/moogaloop.swf", "myvideo", "343", "193", "9.0.28", '',flashvars,parObj, attObj );
</script>

I actually just dropped this block right into a text widget in WordPress and it worked just fine…

The "29950141" is the video id (you can extract that from the URL you'd normally use to embed your vimeo video with)

The "343" and "193" are the width and height of the video we're displaying.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

1 Response to "Embed a vimeo video using swfobject and setting the audio to mute"

1 | sprashid

October 26th, 2011 at 4:19 pm

Avatar

great post! its workin just fine. if you add a line: loop=1
you have and looped video too. thanx

Comment Form

Featured Sponsors


  • Curt: @Phil Owen I changed the actual link to the comments to just be myurl/mypage/?show=comments and removed the specific comment id It does involve c
  • Phil Owen: I'm writing my first custom theme (partly as a means of learning PHP), and this tutorial worked spectacularly for me. The only challenge I've com
  • DanShea: billyjacks you had the easiest and least intrusive solution. just wrap a span around text you want the underline applied to and the rest has no un

About


Advertisements