Jump to content

should this work, or am i stupid?


flemingmike

Recommended Posts

hello,

 

i was going through a tutorial on how to display xml data on a website.  here is my xml output from my music player:

 

  <?xml version="1.0" encoding="UTF-8" ?> 
- <hmm status="ok">
- <tracks>
- <track>
  <album>Sixteen Stone</album> 
  <bpm>0</bpm> 
  <database-id>4</database-id> 
  <exists>false</exists> 
  <filename>D:\Temp\Music\h07 - Machinehead.mp3</filename> 
  <index>0</index> 
  <length>256</length> 
  <mood /> 
  <popularity>0</popularity> 
  <recording-year>1994</recording-year> 
  <release-year>1994</release-year> 
  <situation /> 
  <publisher /> 
  <format>MPEG Audio 128 kbps</format> 
  <is-subtrack>false</is-subtrack> 
  <is-favourite>false</is-favourite> 
  <release-type>0</release-type> 
  <subtrack-index>-1</subtrack-index> 
  <artist>Bush</artist> 
  <genre>Rock</genre> 
  <rating>0</rating> 
  <title>Machinehead</title> 
  </track>
  </tracks>
  </hmm>

 

here is the code that i thought would display the artists name:

 

<xml ID="music" src="http://localhost:8181/1.0/?method=player.getNowPlayingData"></xml>		
Artist:
<span datasrc="music" datafld="artist"></span>

 

 

 

should this work?

Link to comment
https://forums.phpfreaks.com/topic/204234-should-this-work-or-am-i-stupid/
Share on other sites

Good song.  I am willing to bet that the media player isn't attached to a publicly facing server.  I'd bet you are using localhost for this. 

 

Throw

http://localhost:8181/1.0/?method=player.getNowPlayingData

into your browser window to make sure you get the xml out.

 

Then fix your problem and replace:

 

<span datasrc="music" datafld="artist"></span>

 

with:

 

<span datasrc="#music" datafld="artist"></span>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.