Sha256: 96c75e2c1bb52d28b0a3f5150106227b7cc3ce79d96e64fda1b92f64251c63f5

Contents?: true

Size: 1.39 KB

Versions: 112

Compression:

Stored size: 1.39 KB

Contents

<script type="text/ng-template" id="promethee/components/video/edit/move">
  <%= render 'promethee/edit/move.header', type: 'video' %>
      <div ng-controller="VideoController">
        <div class="embed-responsive embed-responsive-16by9">
          <iframe ng-if="embed" 
                  frameborder="0" 
                  webkitallowfullscreen="" 
                  mozallowfullscreen="" 
                  allowfullscreen="allowfullscreen" 
                  ng-src="{{embed | urlSafe}}"></iframe>
          <div class="video-neutralizing-overlay"></div>
        </div>
      </div>
    </div>
  </div>
</script>

<script>
  promethee.controller('VideoController', ['$scope', function($scope) {
    Object.defineProperty($scope, 'embed', {
      get: function() {
        var embed = null;
        var url = this.component.attributes.url + '';

        if(url.includes('vimeo')) {
          var id = url.replace(/^(?:https?:)?\/\/(?:(?:www|player)\.)?vimeo\.com\/(?:video\/)?(\d+).*?$/, '$1');
          embed = 'https://player.vimeo.com/video/' + id + '?color=ffffff&title=0&byline=0&portrait=0';
        }
        else if(url.includes('youtube')) {
          var parts = url.split('watch?v=');
          var id = parts[parts.length - 1];
          embed = 'https://www.youtube.com/embed/' + id;
        }
        elseĀ {
          var embed = url;
        }

        return embed;
      }
    })
  }]);
</script>

Version data entries

112 entries across 112 versions & 1 rubygems

Version Path
promethee-3.0.2 app/views/promethee/components/video/_edit.move.html.erb
promethee-3.0.1 app/views/promethee/components/video/_edit.move.html.erb
promethee-3.0.0 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.1.3 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.1.2 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.1.1 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.1.0 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.9 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.8 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.7 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.6 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.5 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.4 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.3 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.2 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.1 app/views/promethee/components/video/_edit.move.html.erb
promethee-2.0.0 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.11.29 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.11.28 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.11.27 app/views/promethee/components/video/_edit.move.html.erb