Skip to content
This repository has been archived by the owner on Nov 11, 2017. It is now read-only.

Commit

Permalink
added programmatic click on entering current track play state :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Bull committed Jan 30, 2013
1 parent 3295176 commit db006e5
Showing 1 changed file with 43 additions and 14 deletions.
57 changes: 43 additions & 14 deletions js/app.js
Expand Up @@ -17,9 +17,16 @@ App.IndexRoute = Ember.Route.extend({
App.StationsRoute = Ember.Route.extend({
model: function() {
return App.Station.find();
},
}
});

App.StationsTracksPlayingRoute = Ember.Route.extend({
setupController: function(controller, model) {
controller.set('content', model);
setTimeout(function(){
widget = SC.Widget( document.getElementById('sc-widget') );
widget.play();
},1500); // cheating for programmatic click :-)
}
});

Expand All @@ -34,6 +41,9 @@ App.StationsIndexView = Ember.View.extend({
});

App.StationsTracksPlayingView = Ember.View.extend({
//didInsertElement: function(){
//debugger;
//},
scBaseUrl: 'https://w.soundcloud.com/player/',
scTrackSourceUrlBinding: 'controller.model.url',
scIframeSourceUrl: function() {
Expand Down Expand Up @@ -83,29 +93,48 @@ App.Tracks = DS.Model.extend({
url: DS.attr('string')
});

App.Station.FIXTURES = [];
//App.Station.FIXTURES = [
//{
//id: 1,
//name: 'Carl Craig',
//tracks: [100]
//},
//{
//id: 2,
//name: 'Stacey Pullen',
//tracks: [200]
//}
//];
App.Station.FIXTURES = [
{
id: 1,
name: 'Carl Craig',
tracks: [100,101,102]
},
{
id: 2,
name: 'Stacey Pullen',
tracks: [200,201,202]
}
];

App.Tracks.FIXTURES = [
{
id: 100,
title: '20 Years Of Planet E Essential Mix',
url: 'https://api.soundcloud.com/r_co/carl-craig-20-years-of-planet'
},
{
id: 101,
title: 'Live @ Mixmag Live',
url: 'https://api.soundcloud.com/planetedetroit/carl-craig-live-mixmag-live-19'
},
{
id: 102,
title: 'FACT mix 345',
url: 'https://api.soundcloud.com/selftitledmag/carl-craig-fact-mix-345'
},
{
id: 200,
title: 'Stacey Pullen Live',
url: 'https://api.soundcloud.com/staceypullen/stacey-pullen-live'
},
{
id: 201,
title: 'Get Up (Original)',
url: 'https://soundcloud.com/staceypullen/stacey-pullen-get-up-original'
},
{
id: 202,
title: 'Circus Act',
url: 'https://soundcloud.com/staceypullen/sets/bfr007-circus-act-ep'
}
];

0 comments on commit db006e5

Please sign in to comment.