Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- directive('VideoDtv', function VideoDtv() {
- var VideoDtv = {
- scope: {
- muted: '='
- },
- controller: function($scope) {
- // controller stuff
- },
- link: function($scope, htmlElement) {
- $scope.$watch('muted', function(currentMutedValue, previousMutedValue) {
- if (currentMutedValue === true) {
- videoElement.mute();
- } else {
- videoElement.unmute();
- }
- });
- }
- };
- });
- <video video-dtv data-muted="booleanScopeVariable" />
- <video data-video-dtv muted="true" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement