SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1
    SitePoint Zealot barleytwist's Avatar
    Join Date
    Dec 2005
    Location
    Lulworth, Dorset, UK
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Continuous Music

    Does anyone know how I could paly continuous background music as someone navigates around a website? This is wthout the music restarting when a page is reloaded and preferably without interuption.

    I want to avoid non accessible methods like I-frames and yes, I know some are going to say it's not friendly to force music on a viewer but just bear with me on that point and consider it an acedemic issue.

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If you want to avoid popup windows and iframes, I think the only other solution (bar Flash) is to use AJAX. This would mean the music-playing stuff stays static on the page and the page contents are changed via AJAX. Naturally this means the use of JavaScript and a lot of extra work, which are pretty non-negligible shortcomings! I suppose it would be OK if the "basic" version of the page was a static HTML page without the music, while the enhanced version used AJAX to load the changing content.

  3. #3
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by barleytwist View Post
    I want to avoid non accessible methods like I-frames and yes, I know some are going to say it's not friendly to force music on a viewer but just bear with me on that point and consider it an acedemic issue.
    That is a paradoxical statement, having music playing in the background without the visitors permission is by definition making the page inaccessible, it inteferes with screen readers for the visually impaired so they cannot hear speech over the noise (loosing the ability to "see" the website), it can perpetuate the condition of someone with tinnitus or an auditory impairment (ones that don't limit hearing but intefere or give sensitivity) and for those with cognitive impairments (who have poor concentration like ADHD or have impairments which affect focus) it can seriously disturb or force them to dislodge their train of thought or ability to concentrate.

    So if you are looking for an accessible way to achieve this, your unfortunately digging yourself a hole

  4. #4
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alex, those are all trivial reasons not to have music on the site. The real, over-riding reason that even the hypothetical discussion of music on the web site is evil is … I already have Muddy Waters and Howlin' Wolf playing, and damned if I want somebody else's idea of good music to butt in.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  5. #5
    SitePoint Guru
    Join Date
    Oct 2008
    Location
    Melbourne
    Posts
    754
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AlexDawson View Post
    That is a paradoxical statement, having music playing in the background without the visitors permission is by definition making the page inaccessible ...
    There is also a severe accessibility situation which can arise when one throws their machine out the nearest window.

    In all seriousness, barleytwist -- what is this for?
    "I'm Commander Shepard, and this is
    my favourite post on the internet."

    We'll miss you, Dan Schulz.

  6. #6
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by gary.turner View Post
    Alex, those are all trivial reasons not to have music on the site. The real, over-riding reason that even the hypothetical discussion of music on the web site is evil is I already have Muddy Waters and Howlin' Wolf playing, and damned if I want somebody else's idea of good music to butt in.
    While it's a good point (and I hate it when that happens too), I wouldn't consider any accessibility reason trivial, while you can pause or get over the music blasting pretty effortlessly (even if your angry) a disabled person could suffer distress, inability to resolve the problem or actually suffer symptoms related to the noise pollution which is far more serious

    Quote Originally Posted by raena View Post
    There is also a severe accessibility situation which can arise when one throws their machine out the nearest window.
    Correction: It's a usability situation, it's only an accessibility issue if you attempt to jump out the window after it

  7. #7
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I think barleytwist made the point in the original post that he's aware of how irritating autoplaying music is on websites. He asked to be beared with, as it could well be for some academic, humour or game-like purpose, where (hopefully) the user is aware of what is going to happen before the music starts playing.

  8. #8
    Resident curmudgeon bronze trophy gary.turner's Avatar
    Join Date
    Jan 2009
    Location
    Dallas
    Posts
    990
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alex, it's called being facetious; tongue in cheek.

    cheers,

    gary
    Anyone can build a usable website. It takes a graphic
    designer to make it slow, confusing, and painful to use.

    Simple minded html & css demos and tutorials

  9. #9
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If your navigation is not too complex and you don't have a complicated CMS backend, then it would be fairly straightforward to use a simple tabber script to control your navigation, and display each "page" as a separate tab. This way users don't actually need to change pages. If you have the tabber load up each tab from a separate HTML file, then the search engines will follow that just like a regular link. If you load each tab from content stored on the page, then the search engines can simply index that one page for all of the content, but they might not like that they can't link directly to the content since they probably won't be able to link directly to the tab in question (even if it is possible, the search engine probably won't figure out how).

    The only thing it will screw up for the majority of your actual site visitorsis the ability to grab the URL for a specific page from the address bar ... and the constant, annoying music.

    Although like Alex mentioned, your original question is kinda paradoxical since this isn't possible to do in an "accessible" way.


    I had to create something similar for a WordPress theme a while ago. It was a total nightmare to setup as I couldn't use a basic tabber script to do it and actually had to load each new page the old fashioned way via iframes.

  10. #10
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FYI, the tabber script idea would work fine with screen readers.

    I forgot to also mention that this is essentially what Raffles suggested earlier. I'm just pointing out that a standard tabber script takes care of all of the complicated javascript that would go along with it and makes sure it is all done in an as "accessible way" as possible. Or at least as accessible as it can be where javascript/Ajax comes into it.

  11. #11
    Trash Boat mkoenig's Avatar
    Join Date
    Aug 2007
    Posts
    1,232
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would suggest against it.

    A nice alternative would be to use ajax to post newer pages to a frame and keep the bg audio in the main page.

    Google ajax tabs.

  12. #12
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mkoenig View Post
    I would suggest against it.

    A nice alternative would be to use ajax to post newer pages to a frame and keep the bg audio in the main page.

    Google ajax tabs.
    Why would you prefer to use ajax to load a page in a frame? I've always figured the regular method of loading pages into the existing page via ajax was a better idea.

  13. #13
    Trash Boat mkoenig's Avatar
    Join Date
    Aug 2007
    Posts
    1,232
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ryanhellyer View Post
    Why would you prefer to use ajax to load a page in a frame? I've always figured the regular method of loading pages into the existing page via ajax was a better idea.
    That loads it into a hidden frame. I've not seen anything but that.

    See where it says "Demo #3- All contents fetched via "IFRAME""
    http://www.dynamicdrive.com/dynamici...axtabscontent/

    If there is another method maybe thats better.

  14. #14
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, you can just load the content into the existing page via ajax. Something like this would do it ... http://stilbuero.de/jquery/tabs/#fragment-1

    You could add the navigation in via javascript, then have a non-javascript menu sitting below it which links to slight different URLs which can load separate pages. This would make it work fine without javascript (in which case the music probably isn't playing anyway) and it would give search engines something better to navigate via.

    There also might be ways to open up tabber scripts onto a certain tab, perhaps via a #link? Although I'm not sure about that. It's not something I've tried doing before.

  15. #15
    Trash Boat mkoenig's Avatar
    Join Date
    Aug 2007
    Posts
    1,232
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    O sweet! Thought they where all frames. Yeah thats nice.

    I have the Professional Ajax book from a few years back and they where using frames.

    I like yours better however.

  16. #16
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,809
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    There is a really simple solution to what the OP wants to do so that the music will play continuously AND where it first asks the visitor's permission before it starts.

    <a href="music-filename-goes-here">Play Music</a>
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  17. #17
    Trash Boat mkoenig's Avatar
    Join Date
    Aug 2007
    Posts
    1,232
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And the music opens in a media player. ok. Sounds realistic to me

  18. #18
    SitePoint Guru glenngould's Avatar
    Join Date
    Nov 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    There is a really simple solution to what the OP wants to do so that the music will play continuously AND where it first asks the visitor's permission before it starts.

    <a href="music-filename-goes-here">Play Music</a>
    This is the greatest solution which also avoids confusion: users may not detect the source of the playing music, especially if they have a couple of tabs open in their browser.

    If music really adds to the user experience in your case, you might still load a track when page loads and offer the link for continuous playback.
    Tweep List adds an avatar menu to Twitter (open source)
    Word Stats shows your most used words on Twitter

  19. #19
    Trash Boat mkoenig's Avatar
    Join Date
    Aug 2007
    Posts
    1,232
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yea, people always over analyze everything and the best solution is often the most basic and overlooked.

  20. #20
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,276
    Mentioned
    50 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by gary
    I already have Muddy Waters and Howlin' Wolf playing, and damned if I want somebody else's idea of good music to butt in.
    ++ both the music and the sentiment.

    More than a few times I have opened someone's link, only to hear the strange combination of whatever my Amarok's playing and the crap the new site is playing.

  21. #21
    SitePoint Enthusiast exoticshawls's Avatar
    Join Date
    Aug 2009
    Posts
    67
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the continuous music will make your contents and page very heavy..

  22. #22
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,809
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by exoticshawls View Post
    the continuous music will make your contents and page very heavy..
    Yes but if the visitor has to click a link to download and play the music then it doesn't matter because only those who want to hear the music have that overhead.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  23. #23
    Non-Member Musicbox's Avatar
    Join Date
    Nov 2004
    Location
    india
    Posts
    1,331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can use a frame and insert play button and load music url within this frame and the other frame will be content.

  24. #24
    SitePoint Enthusiast zonker720's Avatar
    Join Date
    Oct 2007
    Location
    Sydney
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just use an i-frame. It's easy and will work. If you really want to force music on your viewers, do it! Obviously if it's a commercial "customer is king" type website, then it's a bad idea, but if it's your personal website, make them listen to whatever you want, and remove the volume control! It's your house ;-)

  25. #25
    SitePoint Wizard ryanhellyer's Avatar
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    2,323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why are you guys suggesting an iframe instead of just loading the pages via ajax?


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
  •