Skip to content
Browse files

better algo to find moment of track-change

  • Loading branch information...
1 parent 2dc573c commit 8c7afed32e0f6e941fb10b838772751b1ff62a92 @indeyets indeyets committed Apr 9, 2012
Showing with 4 additions and 2 deletions.
  1. +3 −1 code.js
  2. +1 −1 tmradio.manifest
View
4 code.js
@@ -64,7 +64,9 @@ tmradio.iphone = {
.done(function(data){
var now = Math.round(Date.now() / 1000);
var end_of_play = data.last_played + data.length;
- var time_to_check = 1000 * (end_of_play - now + tmradio.iphone.delay + 5);
+ var left_to_play = end_of_play - data.current_ts;
+
+ var time_to_check = 1000 * (left_to_play + tmradio.iphone.delay);
if (time_to_check <= 0) {
time_to_check = 1000 * 5;
}
View
2 tmradio.manifest
@@ -1,6 +1,6 @@
CACHE MANIFEST
#
-# Cache manifest version 22
+# Cache manifest version 23
#
code.js
cover.png

0 comments on commit 8c7afed

Please sign in to comment.
Something went wrong with that request. Please try again.