Skip to content

Commit

Permalink
put link to stream URL in settings. closes #69
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Oct 6, 2012
1 parent fff4566 commit 3ab3b52
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/client/app.coffee
Expand Up @@ -233,6 +233,8 @@ renderSettings = ->
password: localStorage.auth_password
show_edit: not localStorage.auth_password? or settings_ui.auth.show_edit
permissions: permissions
misc:
stream_url: getStreamUrl()

$settings.html Handlebars.templates.settings(context)
$settings.find(".signout").button()
Expand Down Expand Up @@ -538,17 +540,19 @@ toggleStreamStatus = ->
updateStreamingPlayer()
return false

getStreamUrl = ->
port = server_status?.stream_httpd_port
format = server_status.stream_httpd_format
"#{location.protocol}//#{location.hostname}:#{port}/stream.#{format}"

updateStreamingPlayer = ->
should_stream = trying_to_stream and mpd.status.state is "play"
return if actually_streaming is should_stream
if should_stream
format = server_status.stream_httpd_format
port = server_status?.stream_httpd_port
stream_url = "#{location.protocol}//#{location.hostname}:#{port}/stream.#{format}"
soundManager.destroySound('stream')
sound = soundManager.createSound
id: 'stream'
url: stream_url
url: getStreamUrl()
onbufferchange: ->
streaming_buffering = sound.isBuffering
renderStreamButton()
Expand Down
7 changes: 7 additions & 0 deletions src/client/views/settings.handlebars
Expand Up @@ -46,3 +46,10 @@
</p>
{{/if}}
</div>
<div class="section">
<h1>About</h1>
<ul>
<li><a href="{{misc.stream_url}}">Stream URL</a></li>
<li><a href="http://github.com/superjoe30/groovebasin">GrooveBasin on GitHub</a></li>
</ul>
</div>

0 comments on commit 3ab3b52

Please sign in to comment.