Created
September 22, 2016 20:01
-
-
Save frostbitten/9eb30306cc81b383517636be7a06ee30 to your computer and use it in GitHub Desktop.
mute vimeo videos with angular
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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