From cef4d79925793569c159a51372154c848feb08a7 Mon Sep 17 00:00:00 2001 From: Baggers Date: Wed, 14 Jun 2017 14:10:47 +0200 Subject: [PATCH] Mess with the example some more --- Examples/Basics/Artist.ux | 1 + Examples/Basics/PlayPage.ux | 2 ++ Examples/Basics/TextButton.ux | 2 +- Examples/Basics/play.js | 31 +++++++++++++++++++------------ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Examples/Basics/Artist.ux b/Examples/Basics/Artist.ux index 1d950f4..39f47b5 100644 --- a/Examples/Basics/Artist.ux +++ b/Examples/Basics/Artist.ux @@ -13,5 +13,6 @@ + diff --git a/Examples/Basics/PlayPage.ux b/Examples/Basics/PlayPage.ux index fc91e28..002210f 100644 --- a/Examples/Basics/PlayPage.ux +++ b/Examples/Basics/PlayPage.ux @@ -16,7 +16,9 @@ Padding="20"> + + diff --git a/Examples/Basics/TextButton.ux b/Examples/Basics/TextButton.ux index 0a2ec30..ec1581c 100644 --- a/Examples/Basics/TextButton.ux +++ b/Examples/Basics/TextButton.ux @@ -1,4 +1,4 @@ - + diff --git a/Examples/Basics/play.js b/Examples/Basics/play.js index decee5c..b9551c1 100644 --- a/Examples/Basics/play.js +++ b/Examples/Basics/play.js @@ -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, @@ -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 };