Also Stigmata, I'm not sure if you have an XBOX with XBMC or are just scripting this specifically for Horscht, but it is worth noting that in order to do this the user must first enable the Web Server (which is by default disabled) on their XBMC dashboard by going to
Settings > Network > Servers then checking the 'Enable Web Server' checkbox and having the following settings;
Web Server Port: 80
Web Server Password: No Pass
(Otherwise the script will need to be able to handle these)
Also like Horscht suggested being able to change the IP from which the data is retrieved from a User Interface as opposed to editing the code would be good as each LAN is bound to have different IP ranges assigned eg. my XBOX is
http://10.0.0.2/....
Also, if
no song is playing the following HTML is returned;
code:
<html>
<li>Filename:[Nothing Playing]</html>
If a
video is playing the following was returned;
code:
<html>
<li>Filename:E:\videos\Star Wars Clone Wars - Volume 1.avi
<li>SongNo:0
<li>Type:Video
<li>Titletar Wars Clone Wars - Volume 1.avi
<li>Time:00:00:04
<li>Duration:01:09:30
<li>Percentage:0</html>
If an
image is being viewed (even whilst music is playing);
code:
<html>
<li>Filename:Q:\screenshots\screenshot000.bmp
<li>Typeicture
<li>Width:720
<li>Height:576
<li>Thumb:Q:\thumbs\2\24de9116.tbn</html>
If a
DVD Video is being played;
code:
<html>
<li>Filenamevd://1
<li>SongNo:-1
<li>Type:Video
<li>Title:LONGEST_YARD
<li>Time:00:00:03
<li>Duration:00:00:22
<li>Percentage:15</html>
(I think this would just use the same code as other videos and i imagine VCDs etc. would yield the same)
No data is retrieved whilst playing
games (and I'm
assuming with other applications as well) since the dashboard (and hence its webserver) is no longer running whilst this is happening.
Anyway, the key to this would be determining the 'Type' field first and then determining which fields to get (eg. videos dont have Artist fields whereas songs do). You would also have to 'remember' which songs are playing because if the user is browsing images whilst listening to music the music details will not be displayed on the page (this is probably the biggest problem).
PS: Sorry if you already have an xbox and know all this, meaning I've just wasted the last 10 minutes
EDIT: Did code tags always have emoticons enabled? =/
quote:
Originally posted by Horscht
Even after playing 5 Songs on xbmc the script still tells me "Atrey right side of the be" whenever i deactive-activate it...
This sounds a lot like a caching issue but I have not tried the script yet so I cannot confirm.
EDIT2: Have now tried the script and can confirm that this is an issue and that it is indeed a caching issue, after deleting Temporary Internet Files from Internet Explorer the song is properly updated but then remains the same again. A cheap work around for this is editing the URL every time it is retrieved by adding a random number at the end eg;
code:
var rndNum = Math.random()*1000;
...
http.open('GET', url + '&rand=' + rndNum, true);
quote:
Originally posted by Horscht
Also, it cuts of the last letter of the Artist and the Song title
This is because there is only a Line Feed character between lines, there is no Carriage Return whereas the script acts as though there is both control characters present, this should be relatively easily fixed.