2 * Copyright (c) 2012, Intel Corporation.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 (function(app, Ember) {
11 var MediaItem = Ember.Object.extend({
17 durationString: function() {
18 return moment("0", "ss").add('milliseconds', this.duration).format("mm:ss");
19 }.property('duration')
23 MediaItem.reopenClass({
27 console.log("MediaItem.findAll: entered.");
28 app.Store.getMediaItems().done(function(data) {
29 if (data !== undefined) {
30 data.forEach(function(item) {
31 console.log("MediaItem.findAll: pushing object.");
32 items.pushObject(app.MediaItem.create(item));
40 find: function(item_id) {
43 console.log("MediaItem.find: entered.");
44 app.Store.getMediaItem(item_id).done(function(data) {
45 item = app.MediaItem.create(data);
52 app.MediaItem = MediaItem;
53 })(window.Hoofbeats, window.Ember);