HTML5 Audio Tag
-
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 -
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, 2013I'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/[^]
-
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, 2013Use 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
-
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
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 -
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, 2013The 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