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

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


    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">
    <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">
    <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 />
    <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>
    <asp:Label ID="lblLocation" runat="server" Text='<%# Eval("EventTitle") %>'></asp:Label>
    <asp:HiddenField ID="hdfdStatusType" Value='<%# Eval("StatusType") %>' runat="server" />
  • #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.

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

    Blog :

  • Sign In to post your comments