I’m using jquery to remove src from an embedded vimeo video by clicking on a certain list item. Works fine when i use this embed code in the src string:
video1.attr('src','http://player.vimeo.com/video/43550778);
However I would rather use a more complex embed code to get rid of some unsightly default embedding settings:
video1.attr('src','http://player.vimeo.com/video/43550778?title=0&byline=0&portrait=0&color=ababab');
This doesn’t work. When the list item that triggers this attr to be removed is clicked, it doesn’t work. All other functions work with the exception of this. Is there something wrong with this embed code? Some illegal characters? I can’t figure it out.
Any help appreciated!
Edit:
I’ve set up my jquery like this:
nav.filter(':nth-child(1)').on( 'click', function(){
images.filter(':nth-child(1)').slideDown(800).siblings().slideUp(50);
video2.attr('src','');
video1.attr('src','http://player.vimeo.com/video/43550778?title=0&byline=0&portrait=0&color=ababab');
});
I’m using the empty src to in effect stop the video as it slides up. As you can see there’s also a different video on the page which is also being kept hidden.
As @TrentSeed suggested, you shouldn’t need to encode your ampersands as HTML entities in your javascript source. Just use a literal ampersand.
http://jsfiddle.net/xdUMN/