1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Where exactly to play a background music html code

Discussion in 'Styling and Customization Questions' started by Core Freedom, Dec 29, 2011.

  1. Core Freedom

    Core Freedom Well-Known Member

    The instruction say:
    copy and paste the following code immediately under the beginning of the <body> tag (i.e. on top of webpage content)

    I'm in Admin/Styles/Default Style but I can't quite figure out where to find the 'top of the web page content' and this <body> tag.

    Can anyone help please?

    Happy New Year!
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Edit the PAGE_CONTAINER template.
    Core Freedom likes this.
  3. Core Freedom

    Core Freedom Well-Known Member

    Hi Brogen, it worked, thank you, although it did something funny with the website. So this may not be a good solution. Alternatively can I put a code staring with <iframe... in the default template?

    I had placed it in an html box on the right side bar with the <iframe code in it and it worked but from there the music will stop as soon as someone leaves the page.
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Background music... that takes me back. :p

    That is normal unless you create a frame set such that one frame of the page is always present. But frames are sort of... yucky.
    Core Freedom likes this.
  5. Core Freedom

    Core Freedom Well-Known Member

    Thanks, Jake. :) Can iframes be embedded into the template though to play background music? Or does it have to be html?
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    iframes don't persist. The music will still be reset on each page load. A regular frameset is needed, but frames are yucky and I don't recommend them. I don't have a good solution for you.

    Core Freedom likes this.
  7. EQnoble

    EQnoble Well-Known Member

    The only thing I can even think of to do is to create an option to popout the player standalone to a new window on click of a button you would have to make and place somewhere on your forum for those who like the ambiance. If they want the music to persist they can click, popout the player...minimize that window and go back to browsing without having the music interrupted on navigation to another page.

    Besides that...there really is no simple way to accomplish what you are trying to accomplish. The above is very possible, you would just need some basic html css and possibly some js. It is an idea...a last chance no other choice idea...alas an idea though. At any rate I hope you come up with something that works for you.
    Core Freedom likes this.
  8. Core Freedom

    Core Freedom Well-Known Member

    Very sweet of you, EQnoble. That might be an option although I'm using podsnack right now (iframe) and if I get the upgraded account I can have the player in html format, which I think I should be able to put in the template to play as background music, if they so choose. An alternative is to tell people to play the music and simply open a second window to browse the website. A bit tedious and unprofessional though.

    If I come up with a perfect solution I'll post it here. :)

    Thank you! :notworthy:
  9. Hoffi

    Hoffi Well-Known Member

    Or the ugly way. Build an startpage with a 0% Frame on to pwith the player, and load the forum in the 100% frame. But this is really ugly, and if someone uses a permalink, the frame is still not there.

    But... Background Music? think about it, if you really need it.
  10. dieketzer

    dieketzer Well-Known Member

    any attempt to minimise the visibility of the frame will result in a lack of audio controls, meaning people wont be able to stop the music.
    frames are bad enough, but embedded music... it takes me back to geocities circa 1997.
    i reckon you should rethink the music idea. it likely annoys 98% of your potential members.
  11. madmartigan

    madmartigan Active Member

    I did it like this in page_container but it dosent work what am i doing wrong?

    <embed name="lostmojo"
  12. Hoffi

    Hoffi Well-Known Member

    I think the src parameter is wrong.
  13. madmartigan

    madmartigan Active Member

    What should it be?
  14. Hoffi

    Hoffi Well-Known Member

    I think this could work, but i don't know your structure. But public_html should not be a part of that. It's a client action, and this don't know your server path.
  15. madmartigan

    madmartigan Active Member

    I would appreciate som help here how exactly can i have background music on my forum_page what code and what link should i use?
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I don't know of any good or easy way to add music to a web page. A regular embed has the problem of the music restarting on each page load. A frameset would work, but frames are crappy. Other more advanced solutions using AJAX and flash can't be implemented without reengineering the whole site.
    madmartigan likes this.
  17. Crispy

    Crispy Member

    It can't really be done. And neither should it - for very good reasons!

Share This Page