Skip to content

Commit

Permalink
Mess with the example some more
Browse files Browse the repository at this point in the history
  • Loading branch information
cbaggers committed Jun 14, 2017
1 parent a99ba24 commit cef4d79
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions Examples/Basics/Artist.ux
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
</Each>
</StackPanel>
</ScrollView>
<BottomBarBackground Dock="Bottom" />
</DockPanel>
</Page>
2 changes: 2 additions & 0 deletions Examples/Basics/PlayPage.ux
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
Padding="20">
<TextButton Value="Prev" Clicked="{prevClicked}" />
<TextButton Value="Stop" Clicked="{backClicked}" />
<TextButton Value="Play" Clicked="{playClicked}" />
<TextButton Value="Next" Clicked="{nextClicked}" />
</StackPanel>
<BottomBarBackground Dock="Bottom" />
</DockPanel>
</Page>
2 changes: 1 addition & 1 deletion Examples/Basics/TextButton.ux
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Text ux:Class="TextButton" Value="Next" Clicked="{nextClicked}" >
<Text ux:Class="TextButton" Value="Next" >
<Pressed>
<Scale Factor="1.2" Duration="0.1" />
</Pressed>
Expand Down
31 changes: 19 additions & 12 deletions Examples/Basics/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var StreamingPlayer = require("FuseJS/StreamingPlayer");
var tracks = Observable();

var paramObs = this.Parameter.onValueChanged(module, function(param) {
MediaQuery.tracks({ "artist": param["artistID"] }).then(function(tracksArray) {
MediaQuery.tracks({ "artist": param["artistID"] }).then(function(tracksArray) {
var tmp = tracksArray.map(function(track, index) {
return {
"id": index,
Expand All @@ -16,32 +16,39 @@ var paramObs = this.Parameter.onValueChanged(module, function(param) {
"duration": track["duration"]
};
});
tracks.addAll(tmp);
tracks.addAll(tmp);
StreamingPlayer.setPlaylist(tmp);
// StreamingPlayer.resume();
// StreamingPlayer.play(tmp[0]);
}).catch(function(e) {
console.log("Well damn:" + e);
});
StreamingPlayer.play();
}).catch(function(e) {
console.log("Well damn:" + e);
});
});

var backClicked = function() {
// stop stuff
console.log("JS BACK CLICKED");
StreamingPlayer.stop();
router.goto("artists");
router.goto("artists");
};

var prevClicked = function() {
StreamingPlayer.previous();
console.log("JS PREV CLICKED");
StreamingPlayer.previous();
};

var nextClicked = function() {
console.log("JS NEXT CLICKED");
StreamingPlayer.next();
};

var playClicked = function() {
console.log("JS PLAY CLICKED");
StreamingPlayer.play();
};

module.exports = {
backClicked: backClicked,
backClicked: backClicked,
prevClicked: prevClicked,
nextClicked: nextClicked,
tracks: tracks
playClicked: playClicked,
tracks: tracks
};

0 comments on commit cef4d79

Please sign in to comment.