Click here to Skip to main content
15,895,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

I have number of audio files added in my project for particular time.
for a fixed time period i have one audio file assigned to play.
my problem is how to play these files continuously.i will get files for a particular time from db.how to play automatically one after another..
which player is best iam using windows media player but i cant play next file automatically..is there any property for it ...Is Any solution for this..

Thanks in advance

Amrutha
Posted

1 solution

Hi,

If you know the exact time of that audio files you can use my code for your requirement.

with some changes.

HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script language ="javascript" >
        var timp;
        function strt() {
            timp = setTimeout("f2()", 300);
        }
        function f2() {

            document.getElementById("imgid").src = "Images/Sunset.jpg";
            timp = setTimeout("f3()", 300);
       }
       function f3() {
           document.getElementById("imgid").src = "Images/Winter.jpg";
           timp = setTimeout("f4()", 300);
       }
       function f4() {
           document.getElementById("imgid").src = "Images/Waterlilies.jpg";
           timp = setTimeout("f2()", 300);
       }
    </script>
</head>
<body onload ="strt()" >
    <form id="form1" runat="server">
    <div id="divimg">
 

        <img id="imgid" src="Images/Blue%20hills.jpg" width="400" height="400" />
    </div>
    </form>
</body>
</html>


Here I used Image tag for images you can use audio files in embedded tag to play repeatedly.

I hope you know we can play audio files using embedded tag.

You've to change my code based on your requirement.

I just gave idea only.


All the Best
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900