You must Sign In to post a response.
  • Category: ASP.NET

    How do you stop a previous audio file when another audio file starts

    Hi

    i want to now that, How do i am stop a previous audio file when another audio file starts in datalist. Below is my code for datalist. Here bold area shows my audio file binding control.

    <b>My problem is when i play one audio file and then play next audio file previous file is not stopped. </b>



    <asp:DataList ID="dlbrowsevents" OnItemDataBound="dlbrowsevents_ItemDataBound" RepeatColumns="3" runat="server">
    <ItemTemplate>
    <div class="col-xs-12 col-sm-12 event1">
    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Image") %>' class="img-responsive" Width="700px" Height="250px" />

    <asp:Panel ID="pnltime" Visible="true" runat="server">
    <p>
    <asp:Label ID="lblStartDate" runat="server" Text='<%# Eval("StartDate","{0:dd/MM/yyyy}") %>'></asp:Label>
    <asp:Label ID="lblStartTime" runat="server" Text='<%# Eval("StartTime") %>'></asp:Label><br />
    </p></asp:Panel>
    <asp:Panel ID="pnlmusic" Visible="false" runat="server">
    <div id="divmusic" runat="server">
    <div class="form-group">
    <audio controls="controls" loop="loop" style="height:25px; width:100%" >
    <source src='<%# Eval("MusicUpload") %>' type="audio/ogg" /> </audio>
    </div>
    </div>
    </asp:Panel>
    <h5>
    <b>
    <asp:Label ID="lblLocation" runat="server" Text='<%# Eval("EventTitle") %>'></asp:Label>
    </b>
    </h5>
    <asp:HiddenField ID="hdfdStatusType" Value='<%# Eval("StatusType") %>' runat="server" />
    <hr>
    </div>
    </div>
    </ItemTemplate>
    </asp:DataList>
  • #766376
    Hi Gaurav,

    Please refer below link, here they were explain how to read all the audio files and how to run only current selected audio file from the list and how to stop the existing audio file etc.

    http://stackoverflow.com/questions/30030123/stopping-pausing-audio-when-another-audio-file-is-clicking-using-jquery

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


Sign In to post your comments