Skip to content

Commit

Permalink
Final fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
millenomi committed Sep 17, 2011
1 parent 814ed98 commit 48f08b3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
44 changes: 43 additions & 1 deletion app/assets/javascripts/player.js.coffee
Expand Up @@ -253,4 +253,46 @@ $(document).ready ->
overlay.updateChannelPicker() overlay.updateChannelPicker()
overlay.hide() overlay.hide()



remote = ->
$.ajax
url: '/poll'
method: 'GET'
dataType: 'json'
success: (x) ->
console.log 'tick', x.action
if x and x.action
switch x.action
when 'next'
index = player.currentChannelIndex
index++
if index >= player.channels.length
index = 0

player.loadChannel player.channels[index]

if inside
window.clearTimeout(mouseTimeout)
hide = -> overlay.hide()
mouseTimeout = window.setTimeout(hide, 5000)

overlay.show() unless overlay.visible

when 'prev'
index = player.currentChannelIndex
index--
if index < 0
index = player.channels.length - 1

player.loadChannel player.channels[index]

if inside
window.clearTimeout(mouseTimeout)
hide = -> overlay.hide()
mouseTimeout = window.setTimeout(hide, 5000)

overlay.show() unless overlay.visible



window.setInterval remote, 2000

3 changes: 3 additions & 0 deletions app/assets/stylesheets/player.css.scss
Expand Up @@ -91,7 +91,10 @@


#overlay #channel-picker .channel h1 { #overlay #channel-picker .channel h1 {
color: white; color: white;
line-height: 53px;
height: 53px;
font: 3em "D-SC", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; font: 3em "D-SC", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
text-overflow: ellipsis-word;
} }


#overlay #channel-picker .channel img { #overlay #channel-picker .channel img {
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/youtubes_controller.rb
Expand Up @@ -119,8 +119,7 @@ def login
@body_id = 'login' @body_id = 'login'


client = GData::Client::YouTube.new client = GData::Client::YouTube.new
next_url = 'http://localhost:3000/sign_up' next_url = 'http://primetime-dev2.infinite-labs.net/sign_up'
next_url = 'http://primetime-dev2.infinite-labs.net/sign_up' if request.user_agent =~ /Mobile|webOS/
secure = false # set secure = true for signed AuthSub requests secure = false # set secure = true for signed AuthSub requests
sess = true sess = true
@authsub_link = client.authsub_url(next_url, secure, sess) @authsub_link = client.authsub_url(next_url, secure, sess)
Expand Down

0 comments on commit 48f08b3

Please sign in to comment.