SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jan 2012
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting up HTML5 Audio Player

    How do I output the song title when it plays in my player instead of having it just say "Song Name by Artist"
    Also I'm having trouble figuring out how to hook up the next song button.
    Here's the site live: http://test.shibagames.com

    Code:
    music.js
    var xml = '' + 
    '<?xml version="1.0"?>\n' + 
    '<music>\n' + 
    '	<composition>\n' + 
    '		<title>First Song</title>\n' + 
    '		<composer>Puccini</composer>\n' + 
    '		<time>2:12</time>\n' + 
    '		<filename>maid.mp3</filename>\n' + 
    '	</composition>\n' + 
    '	<composition>\n' + 
    '		<title>Second Song</title>\n' + 
    '		<composer>Joe</composer>\n' + 
    '		<time>2:22</time>\n' + 
    '		<filename>Sleep Away.mp3</filename>\n' + 
    '	</composition>\n' + 
    '	<composition>\n' + 
    '		<title>Third Song</title>\n' + 
    '		<composer>Gershwin</composer>\n' + 
    '		<time>2:57</time>\n' + 
    '		<filename>Kalimba.mp3</filename>\n' + 
    '	</composition>\n' + 
    '	<composition>\n' + 
    '		<title>2:57</title>\n' + 
    '		<composer>Smith</composer>\n' + 
    '		<time>2:57</time>\n' + 
    '		<filename>gershwin.mp3</filename>\n' + 
    '	</composition>\n' + 
    '	<composition>\n' + 
    '		<title>Allegro</title>\n' + 
    '		<composer>Beethoven</composer>\n' + 
    '		<time>3:45</time>\n' + 
    '		<filename>piano.mp3</filename>\n' + 
    '	</composition>\n' + 
    '</music>\n';
    Last edited by Pullo; Feb 7, 2014 at 09:52. Reason: Added code tags

  2. #2
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,401
    Mentioned
    45 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    I took a look at the link you provided. If you open the console on your browser, you'll see there are some errors that need to be resolved before the script will run:

    • GET http://test.shibagames.com/menu_source/styles.css 404 (Not Found) test.shibagames.com/:7
    • Uncaught Error: Bootstrap requires jQuery bootstrap.min.js:7
    • Uncaught ReferenceError: angular is not defined example.js:3
    • GET http://test.shibagames.com/style.css 404 (Not Found) (index):23
    • Uncaught SyntaxError: Unexpected identifier /javascript/main.js:14
    • Uncaught SyntaxError: Unexpected identifier (index):220
    • Uncaught TypeError: Cannot set property 'innerHTML' of null (index):144


    Also I see that you're using Angular.js.. I'm not sure how well Angular will play with the bootstrap and vanilla JS you're including in your page.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •