Sha256: 45ffc09abf0c1fb8e230f719ccc1d6b9832b4270762e28287c4df88ab8566ba1

Contents?: true

Size: 1.39 KB

Versions: 38

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.value + '';

        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

38 entries across 38 versions & 1 rubygems

Version Path
promethee-4.1.28 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.27 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.26 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.25 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.24 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.23 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.22 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.21 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.20 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.19 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.18 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.17 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.16 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.15 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.14 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.13 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.12 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.11 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.10 app/views/promethee/components/video/_edit.move.html.erb
promethee-4.1.9 app/views/promethee/components/video/_edit.move.html.erb