Skip to content
Permalink
Browse files

WIP

  • Loading branch information...
Chase McCarthy and Jonathan Jackson
Chase McCarthy and Jonathan Jackson committed May 24, 2015
1 parent 1daa8ae commit 5ed7d8a87ef170e02eeb008f409eed51244d7133
Showing with 49 additions and 37 deletions.
  1. +3 −0 .gitignore
  2. +0 −5 Brocfile.js
  3. +1 −1 app/components/seek-to.js
  4. +0 −16 app/routes/application.js
  5. +26 −4 app/services/player.js
  6. +5 −3 bower.json
  7. +1 −1 config/environment.js
  8. +13 −7 package.json
@@ -3,6 +3,7 @@
# compiled output
/dist
/tmp
/fastboot-dist

# dependencies
/node_modules
@@ -18,3 +19,5 @@ testem.log

# podcast media
/media

.env
@@ -17,11 +17,6 @@ var app = new EmberApp();
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
app.import(app.bowerDirectory + '/moment/moment.js');
app.import(app.bowerDirectory + '/ember-cli-moment-shim/moment-shim.js', {
exports: {
moment: ['default']
}
});

var fs = require('fs');
var appTree;
@@ -1,5 +1,5 @@
/* globals moment */
import Ember from 'ember';
import moment from 'moment';

export default Ember.Component.extend({
player: Ember.inject.service(),

This file was deleted.

Oops, something went wrong.
@@ -1,13 +1,35 @@
/* globals moment */
import Ember from 'ember';
import moment from 'moment';

let hasNativeAudio = (typeof Audio !== 'undefined');

function extend(proto) {
function Ctor() { }
Ctor.prototype = proto;
return new Ctor();
}

class AudioWrapper {};

if(hasNativeAudio){
AudioWrapper = Audio;
}else{
AudioWrapper.prototype = extend({
addEventListener(){}
});
}

function isNumeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}

export default Ember.Service.extend({
episode: null,
title: Ember.computed.alias('episode.title'),
releaseDate: Ember.computed.alias('episode.releaseDate'),
playing: Ember.computed.alias('episode.playing'),
audio: Ember.computed(function(){
var audio = new Audio();
var audio = new AudioWrapper();
audio.addEventListener('timeupdate', () => {
var seconds = parseInt(audio.currentTime, 10);
this.set('currentTimeSeconds', seconds);
@@ -53,7 +75,7 @@ export default Ember.Service.extend({
},
currentTime: Ember.computed('currentTimeSeconds', function(){
var seconds = this.get('currentTimeSeconds');
if(Ember.$.isNumeric(seconds)){
if(isNumeric(seconds)){
var duration = moment.duration({seconds: seconds});
return moment.utc(duration.asMilliseconds()).format('mm:ss');
}else{
@@ -64,6 +86,6 @@ export default Ember.Service.extend({
var duration = this.get('audio').duration || 0;
var seconds = this.get('currentTimeSeconds');
var percent = (seconds/duration) * 100;
return Ember.$.isNumeric(percent) ? percent : 0;
return isNumeric(percent) ? percent : 0;
})
});
@@ -4,6 +4,7 @@
"ember": "canary",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "canary",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4",
"ember-qunit": "0.3.3",
"ember-qunit-notifications": "0.0.7",
@@ -13,8 +14,9 @@
"qunit": "~1.17.1",
"bourbon": "3.2.1",
"sinon": "http://sinonjs.org/releases/sinon-1.12.2.js",
"ember-cli-moment-shim": "~0.0.3",
"moment": "~2.9.0",
"mousetrap": "~1.4.6"
"moment": "~2.9.0"
},
"resolutions": {
"ember": "canary"
}
}
@@ -5,7 +5,7 @@ module.exports = function(environment) {
modulePrefix: 'ember-weekend',
environment: environment,
baseURL: '/',
locationType: 'auto',
locationType: 'none',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
@@ -8,9 +8,10 @@
"test": "tests"
},
"scripts": {
"start": "ember server",
"start": "ember fastboot --port $PORT --no-build --serve-assets --environment=production",
"build": "ember build",
"test": "ember test"
"test": "ember test",
"postinstall": "bower install && ember fastboot:build --environment=production"
},
"repository": "",
"engines": {
@@ -19,20 +20,22 @@
"author": "",
"license": "MIT",
"devDependencies": {
"bower": "^1.4.1",
"broccoli-asset-rev": "^2.0.2",
"ember-cli": "0.2.5",
"ember-cli-app-version": "0.3.3",
"ember-cli-autoprefixer": "^0.3.0",
"ember-cli-babel": "^5.0.0",
"ember-cli-dependency-checker": "1.0.0",
"ember-cli-dependency-checker": "0.0.8",
"ember-cli-fastboot": "tildeio/ember-cli-fastboot",
"ember-cli-font-awesome": "0.0.9",
"ember-cli-heroku": "git://github.com/hone/ember-cli-heroku.git",
"ember-cli-htmlbars": "0.7.6",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-qunit": "0.3.13",
"ember-cli-uglify": "1.0.1",
"ember-export-application-global": "^1.0.2",
"ember-mousetrap": "0.2.0"
"ember-export-application-global": "^1.0.2"
},
"dependencies": {
"broccoli-babel-transpiler": "^5.0.0",
@@ -43,7 +46,6 @@
"ember-cli-hbars": "^0.1.6",
"ember-cli-sass": "^3.1.1",
"ember-sinon": "0.0.3",
"liquid-fire": "0.20.0",
"moment": "^2.9.0",
"quick-temp": "^0.1.2",
"rss": "^1.1.1",
@@ -53,5 +55,9 @@
"paths": [
"lib/font-includer"
]
}
},
"cacheDirectories": [
"node_modules",
"bower_components"
]
}

0 comments on commit 5ed7d8a

Please sign in to comment.
You can’t perform that action at this time.