Not logged in. · Lost password · Register

All posts by duncanbeevers (3)

topic: Additional <#> flags  in the forum: Features request
duncanbeevers #1
Member since Dec 2005 · 3 posts
Group memberships: Members
Show profile · Link to this post
There are a number of statistics about winamp / browseamp it would be useful to have access to from a  parse browseamp page.

For example, having access to a playlist history (though not necessarily intrinsically tracking in Winamp) would be awesome.

Unless something else comes along, I'll probably just query the XMLstats generated by ShoutCast for building the play history.
topic: JavaScript stuff (Time-checking in dynamic skins)  in the forum: Skins
duncanbeevers #2
Member since Dec 2005 · 3 posts
Group memberships: Members
Show profile · Link to this post
Looked over Fred's and Gugenheim skins and noticed the time-detection is a bit janky.  For the skin / functionality I'm working on, I decided to just go ahead and rework.  Apologies for the language modifications, but I was having a hard time with sekund.

<script language="JavaScript" type="text/JavaScript">
window.onload = begin_progress_update;
function begin_progress_update(){
    var current_time = new Date();
    timeout_time = current_time.valueOf() + remaining_time * 1000;
    countDown();
}

//Modified code from    Brett Taylor ([email protected])
//    Dynamic Drive for NS4, NS6+ (http://www.dynamicdrive.com)
//    Fred ([email protected])

//configure refresh interval (in seconds)
var elapsed_minutes    = <#SongPositionMin>;
var elapsed_seconds    = <#SongPositionSec>;
var remaining_minutes    = <#SongRemainMin>;
var remaining_seconds    = <#SongRemainSec>;
var progress  = elapsed_minutes * 60 + elapsed_seconds;
var status      = <#status on_play=0 on_stop=1 on_pause=2>;
var duration  = <#SongLengthMin> * 60 + <#SongLengthSec>;
var remaining_time    = remaining_minutes * 60 + remaining_seconds;

var timeout_time; // defined by begin_progress_update

function countDown() {
    var current_time = new Date();
    remaining_time = Math.floor((timeout_time - current_time.valueOf()) / 1000);
    if (status==0) {
  remaining_seconds = remaining_time % 60;
  remaining_minutes = Math.floor((remaining_time - remaining_seconds) / 60);
  var elapsed_time    = duration - remaining_time;
  elapsed_seconds    = elapsed_time % 60;
  elapsed_minutes    = Math.floor((elapsed_time - elapsed_seconds) / 60);
  progress  = elapsed_minutes * 60 + elapsed_seconds;
    }

    if (remaining_time < 0){
  window.location.href = lokace;
  return;
    }

    if (String(elapsed_seconds).length < 2) { elapsed_seconds = "0" + elapsed_seconds; }
    if (String(remaining_seconds).length < 2) { remaining_seconds = "0" + remaining_seconds; }
    var time_update_string = elapsed_minutes + ":" + elapsed_seconds + " / -" + remaining_minutes + ":" + remaining_seconds + " (<#SongLengthMin>:<#SongLengthSec>)";
    if (document.all) { //if IE 4+
  document.all.countDownText.innerText = time_remaining_string;
    }
    else if (document.getElementById) { //else if NS6+
  document.getElementById("countDownText").innerHTML= time_update_string;
    }
    updatePos();

    counter=setTimeout("countDown()", 200);
}

function updatePos() {
    var Position = parseInt(100 * progress / duration);

    if (isNaN(Position)) {
  Position = 1;
    }

    // define the width of the left side
    // of the progress bar
    if (Position == 0) {
  Position = 1;
    }
    // determine which procent field should
    // receive the percent text
    var procent1_text = "";
    var procent2_text = "";
    if (Position > 50) {
  var procent1_text = Position + "%";
    }
    else {
  var procent2_text = Position + "%";
    }

    if (document.all) {
  //if IE 4+
  progressBarLeft.width = Position + "%";
  procent1.innerText = procent1_text;
  procent2.innerText = procent2_text;
    }
    else if (document.getElementById) {
  //else if NS6+
  document.getElementById("progressBarLeft").width = Position + "%";
  document.getElementById("procent1").innerHTML= procent1_text;
  document.getElementById("procent2").innerHTML= procent2_text;
    }

    if (status == 1) {
  Position = 0;
    }
}
</script>

You should be able to essentially overwrite Fred's tempates/fPlayer.html second <script> section with this code and achieve the same functionality, but with more accurate time-tracking.  Don't chop without looking, I wrote this for my skin, not Fred's.
topic: What is everyone using BrowseAmp for?  in the forum: General discussion
duncanbeevers #3
Member since Dec 2005 · 3 posts
Group memberships: Members
Show profile · Link to this post
I just set up a my first ShoutCast server in order to listen to my collection while I'm housesitting for my girlfriend.  I was frustrated with not being able to control the playback well and stumbled on BrowseAmp, wow.

So are most people using BrowseAmp in a ShoutCast / BrowseAmp pairing?  If not, how else are you using it?
Close Smaller – Larger + Reply to this post:
Special characters:
Special queries
Go to forum
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Page created in 124.7 ms (66.4 ms) · 50 database queries in 60.6 ms
Current time: 2020-02-20, 03:14:51 (UTC +00:00)