Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. HTML5 Audio Tag

HTML5 Audio Tag

Scheduled Pinned Locked Moved ASP.NET
questionhtmlhelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • realJSOPR Offline
    realJSOPR Offline
    realJSOP
    wrote on last edited by
    #1

    I am building a web site for someone that wants to play background music while the user is browsing. The problem is tat every time a post-back occurs, the audio control resets itself (from paused to running, and restarts at the beginning of the media). How can I prevent it from resetting itself like that, essentially ignoring a post-back?

    ".45 ACP - because shooting twice is just silly" - JSOP, 2010
    -----
    You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
    -----
    When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

    D J 2 Replies Last reply
    0
    • realJSOPR realJSOP

      I am building a web site for someone that wants to play background music while the user is browsing. The problem is tat every time a post-back occurs, the audio control resets itself (from paused to running, and restarts at the beginning of the media). How can I prevent it from resetting itself like that, essentially ignoring a post-back?

      ".45 ACP - because shooting twice is just silly" - JSOP, 2010
      -----
      You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
      -----
      When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

      D Offline
      D Offline
      DRAYKKO777
      wrote on last edited by
      #2

      I'm still learning about HTML5/CSS3, but here's an article I found that might help (scroll down to the "Controlling Playback with Javascript" section): http://www.elated.com/articles/html5-audio/[^]

      1 Reply Last reply
      0
      • realJSOPR realJSOP

        I am building a web site for someone that wants to play background music while the user is browsing. The problem is tat every time a post-back occurs, the audio control resets itself (from paused to running, and restarts at the beginning of the media). How can I prevent it from resetting itself like that, essentially ignoring a post-back?

        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
        -----
        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
        -----
        When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

        J Offline
        J Offline
        Jorgen Andersson
        wrote on last edited by
        #3

        Use AJAX and an updatepanel and put the Music control OUTSIDE the panel. Or use callbacks.

        Politicians are always realistically manoeuvering for the next election. They are obsolete as fundamental problem-solvers. Buckminster Fuller

        realJSOPR 1 Reply Last reply
        0
        • J Jorgen Andersson

          Use AJAX and an updatepanel and put the Music control OUTSIDE the panel. Or use callbacks.

          Politicians are always realistically manoeuvering for the next election. They are obsolete as fundamental problem-solvers. Buckminster Fuller

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          I changed the site so that the "home" page is the only one with music. Problem solved.

          ".45 ACP - because shooting twice is just silly" - JSOP, 2010
          -----
          You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
          -----
          When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

          J 1 Reply Last reply
          0
          • realJSOPR realJSOP

            I changed the site so that the "home" page is the only one with music. Problem solved.

            ".45 ACP - because shooting twice is just silly" - JSOP, 2010
            -----
            You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
            -----
            When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

            J Offline
            J Offline
            Jorgen Andersson
            wrote on last edited by
            #5

            The KISS principle, I like that. It wasn't apparent to me that you wanted to keep it playing after a page redirect. I don't know of any way to achieve that. You would have to use just one default page, and create all other "pages" as dynamic controls and update them using AJAX or callbacks. If this is done for a friend it's probably not worth the fuzz, unless you're doing it for the learning.

            Politicians are always realistically manoeuvering for the next election. They are obsolete as fundamental problem-solvers. Buckminster Fuller

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups