Sha256: 75005e5a70d937740970d0be8cae3f4d6cb75be1ec5702c6f8ba91f3bdcbeaca

Contents?: true

Size: 1.24 KB

Versions: 73

Compression:

Stored size: 1.24 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 = 'http://www.youtube.com/embed/' + id;
        }

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

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
promethee-1.6.14 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.13 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.12 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.11 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.10 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.8 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.7 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.6 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.5 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.4 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.3 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.2 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.1 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.6.0 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.5.4 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.5.3 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.5.2 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.5.0 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.4.29 app/views/promethee/components/video/_edit.move.html.erb
promethee-1.4.28 app/views/promethee/components/video/_edit.move.html.erb