cms/app-client/app/components/transcript-annotation-component.js
author ymh <ymh.work@gmail.com>
Fri, 02 Dec 2016 03:30:51 +0100
changeset 455 a8bed1c7df8e
parent 454 710a2ae08a74
child 456 3a32d2f57429
permissions -rw-r--r--
move the transcript highlight and autoscroll logic to the base component

import Ember from 'ember';

export default Ember.Component.extend({

  // classNameBindings: ['isPlaying:active'],

  hasPlayer: Ember.computed.bool('player'),

  begin: Ember.computed.readOnly('annotation.begin'),
  end: Ember.computed.readOnly('annotation.end'),
  title: Ember.computed.readOnly('annotation.title'),
  original: Ember.computed.readOnly('annotation.original'),
  speaker: Ember.computed.readOnly('annotation.speaker'),
  showSpeaker: Ember.computed.readOnly('annotation.showSpeaker'),
  literal: Ember.computed.readOnly('annotation.literal'),
  translation: Ember.computed.readOnly('annotation.translation'),

  // isPlaying: Ember.computed("hasPlayer","player.progress", "begin", "end", function() {
  //   var progress = this.get('player.progress');
  //   return this.get('hasPlayer') && progress && (progress >= this.get('begin')) && (progress < this.get('end'));
  // }),

  didInsertElement: function() {
    if(this.get('hasPlayer') && this.get('intervals')) {
      this.get('intervals').add(this.get('begin'), this.get('end'), this.get('elementId'), this.$());
    }
  },


});