code: function clVideo(Cloudinary) {
          return {
              restrict: 'E',
              replace: true,
              transclude: true,
              template: '<video ng-transclude></video>',
              scope: {},
              priority: 99,
              controller: ["$scope", function ($scope) {
                  this.addTransformation = function (ts) {
                      $scope.transformations = $scope.transformations || [];
                      $scope.transformations.push(ts);
                  };
              }],
              link: function (scope, element, attrs) {
                  var attributes = getAttributes(attrs);
                  if (scope.transformations) {
                      attributes.transformation = scope.transformations;
                  }
                  var deregisterObserver = attrs.$observe('publicId', function (publicId) {
                      if (!publicId)
                          return;
                      if (!attributes.hasOwnProperty('poster')) {
                          element.attr('poster', Cloudinary.video_thumbnail_url(publicId, attributes));
                      }
                      attributes['format'] = 'webm';
                      var webm = angular.element("<source src=\"" + Cloudinary.video_url(publicId, attributes) + "\" type=\"video/webm\" />");
                      element.append(webm);
                      attributes['format'] = 'mp4';
                      var mp4 = angular.element("<source src=\"" + Cloudinary.video_url(publicId, attributes) + "\" type=\"video/mp4\" />");
                      element.append(mp4);
                      attributes['format'] = 'ogg';
                      var ogg = angular.element("<source src=\"" + Cloudinary.video_url(publicId, attributes) + "\" type=\"video/ogg\" />");
                      element.append(ogg);
                      //deregisterObserver();
                  });
              }
          };
      }
docs: /* @ngInject