cms/app-client/app/services/player.js
author Chloe Laisne <chloe.laisne@gmail.com>
Wed, 03 Aug 2016 22:47:49 +0200
changeset 249 e4204b1a579a
parent 248 256272c33349
child 251 ac320de33ec7
permissions -rw-r--r--
Quickfix micro-cuts

import Ember from 'ember';

export default Ember.Service.extend(Ember.Evented, {

    items: [],
    item: null,
    model: null,

    window: '',
    playing: false,
    progress: 0, // In Milliseconds
    reduce: false,

    init: function() {
        this.on('reset', Ember.run.bind(this, this.get('reset')));
    },

    setProgress: function(time) {
        this.set('progress', time);
    },

    play: function(id) {
        this.set('item', id);
        this.set('playing', true);
    },

    pause: function() {
        this.set('playing', false);
    },

    reset: function(id) {
        this.set('item', id);
    }
});