Link to home
Start Free TrialLog in
Avatar of shahjagat
shahjagatFlag for United States of America

asked on

How to autoplay the link in Anchor tag

Hello all,

    I have to play a audio file on my web page automatically. I am using Yahoo Media Player.

Right now I am playing the audio like this....

    <script type="text/javascript" src="http://mediaplayer.yahoo.com/js"></script>

<td>  <a  id= "songlink" runat = "server"  visible ="false" >Play Advertisement</a>
                            </td>

I am giving the href in code behind( based on the user location)

Code Behind:

                        songlink.HRef = "Media/song1.mp3"
                        songlink.Visible = True

With this method, I have to click on the link, to play the song..

But, I would like to play the song automatically( without any click) . Is it possible to do so from code behind?

Appreciate the help

Thanks
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Avatar of shahjagat

ASKER

Hello CodeCruiser,

  The song comes from my side, I am just using the yahoo media player to play the song.

I am changing the Href of the anchor tag from code behind.
Song1.mp3 comes from the Media folder of my project.

Thanks
check this solution
http://www.entheosweb.com/website_design/play_sound.asp

just check if you can change the source of embed object from code behind
Hello gurvinder,

  This web app will be used in the tablets, so there will be now mouseover and I would like to have the audio played without any click . Is it possible?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of shahjagat
shahjagat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
autoplay using javascript worked fine.