Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. directive('VideoDtv', function VideoDtv() {
  2.    
  3.     var VideoDtv = {
  4.         scope: {
  5.             muted: '='
  6.         },
  7.         controller: function($scope) {
  8.             // controller stuff
  9.         },
  10.         link: function($scope, htmlElement) {
  11.             $scope.$watch('muted', function(currentMutedValue, previousMutedValue) {
  12.  
  13.                 if (currentMutedValue === true) {
  14.                     videoElement.mute();
  15.                 } else {
  16.                     videoElement.unmute();
  17.                 }
  18.                
  19.             });
  20.         }
  21.     };
  22.  
  23. });
  24.  
  25.  
  26. <video video-dtv data-muted="booleanScopeVariable" />
  27. <video data-video-dtv muted="true" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement