Jump to content

Three things I discovered (by trial-and-error) about the html <audio> tag.


Recommended Posts

1.    In a mobile or tablet PC, an <audio> tag will not be enabled until after a hyperlink has been employed.

So I used a silent "Welcome" screen inviting the user to "click" in order to proceed further.


2.    If  a background audio file is required to survive page transition, then a solution is to use the 
<frameset> tag.  I created two frames called "Left" and "Right".  "Left" width = 0% and "Right" 
width = 100%.  Hence "Left" cannot be displayed.
    The "Left" frame sources a page containing the <audio> tag, while the "Right" frame sources 

    NOTE:  The <frameset> tag was supported in HTML4 but allegedly not in HTML5.


3.    If it is required to stop an audio file playing (after it has started), this may be done by employing any 
hyperlink.  (I am not sure whether this applies to hyperlinks where the href attribute is an external 
URL, eg. a network).  But the condition is that the hyperlink must have the attribute target=_top.  
Such hyperlinks may reference a page containing an alternative <audio> tag and an alternative audio 
file which therefore will replace the one that was stopped.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...