Skip to content

Instantly share code, notes, and snippets.

@frostbitten
Created September 22, 2016 20:01
Show Gist options
  • Save frostbitten/9eb30306cc81b383517636be7a06ee30 to your computer and use it in GitHub Desktop.
Save frostbitten/9eb30306cc81b383517636be7a06ee30 to your computer and use it in GitHub Desktop.
mute vimeo videos with angular
// derived from http://stackoverflow.com/a/38815215/1713528
yourAppVar.directive('vimeoMuted', function () {
return {
restrict: 'A',
scope: {
},
link: function (scope, elem, attr) {
//Select the #embeddedVideo element
// var video = document.getElementById('vimeo_player');
//Create a new Vimeo.Player object
var player = new Vimeo.Player(elem);
//When the player is ready, set the volume to 0
player.ready().then(function() {
player.setVolume(0);
});
}
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment