Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,22 @@
</div>
<div id="playerControls">
<form id="form">
<input id="input" placeholder="Paste Soundcloud URL here (https://soundcloud.com/artist/track)">
<input type="url" id="input" placeholder="Paste Soundcloud URL here (https://soundcloud.com/artist/track)" autofocus required>
<button type="submit" id="submit"><i class="icon-play"></i></button><br>
</form>
<audio id="player" controls="" autoplay="" preload autobuffer></audio>
<audio id="player" controls autoplay preload autobuffer></audio>
</div>
</div>

<div id="messageBox" class="hidden">
</div>
<div id="messageBox" class="hidden"></div>

<footer>
<a href="#" id="credit"> <i class="icon-info"></i> About</a>
<span id="github"><a href="https://github.com/michaelbromley/soundcloud-visualizer"><i class="icon-github"></i> Source on Github</a></span>
<span id="scLogo"><a href="http://soundcloud.com/"><img src="assets/powered_by_white.png"></a></span>
</footer>

<script src="http://connect.soundcloud.com/sdk.js"></script>
<script src="https://connect.soundcloud.com/sdk.js"></script>
<script src="js/app.js"></script>
</body>
</html>
</html>
10 changes: 5 additions & 5 deletions js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ var SoundCloudAudioSource = function(player) {
// public properties and methods
this.volume = 0;
this.streamData = new Uint8Array(128);
this.playStream = function(streamUrl) {
this.playStream = function(loader) {
// get the input stream from the audio element
player.addEventListener('ended', function(){
self.directStream('coasting');
loader.directStream('coasting');
});
player.setAttribute('src', streamUrl);
player.setAttribute('src', loader.streamUrl());
player.play();
}
};
Expand Down Expand Up @@ -604,7 +604,7 @@ window.onload = function init() {
loader.loadStream(trackUrl,
function() {
uiUpdater.clearInfoPanel();
audioSource.playStream(loader.streamUrl());
audioSource.playStream(loader);
uiUpdater.update(loader);
setTimeout(uiUpdater.toggleControlPanel, 3000); // auto-hide the control panel
},
Expand Down Expand Up @@ -664,4 +664,4 @@ window.onload = function init() {
}


};
};