Update panel and timer pausing video in WMP
I in a web form i need to display images as well as videos.For displaying images i have used a asp image control and using ajax update panel and timer i will be showing list of imageson regular interval of time.for displaying videos i am using object type windows media player and assigning a playlist to it.My problem is when image is being updated i.e timer tick event ,video is getting paused and resuming .
aspx code:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="BannerPanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Image ID="Image1" runat="server" Height="360px" Width="425px" Visible="true" />
<asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="5000" >
</asp:Timer>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Panel ID="Panel2" runat="server" Height="370px" Width="428px" CssClass="floatright">
<object id="VIDEO" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
style="position:absolute; top: 76px; left: 446px; height: 374px; width: 474px;" >
<param name="url" value="<%=mySrc %>" />
<param name="src" value="<%=mySrc %>" />
<param name="SendPlayStateChangeEvents" value="True" />
<param name="animationatstart" value="true" />
<param name="autostart" value="true" />
<%--<param name="autostart" value="true" />--%>
<param name="showcontrols" value="true" />
<param name="ShowStatusBar" value="true" />
<param name ="playCount" value="999999999" />
</object>
</asp:Panel>
code behind code:
protected void Timer1_Tick(object sender, EventArgs e)
{
NameValueCollection list = Session["ImagesLIst"] as NameValueCollection;
if(list != null)
{
IndexTmr= Convert.ToInt16(Session["tmrindex"]);
if (IndexTmr <= list.Count )
{
string ext = ".bmp";
string localstr = list[IndexTmr];
Byte[] bytes = File.ReadAllBytes(localstr);
string base64String = Convert.ToBase64String(bytes, 0, bytes.Length);
Image1.ImageUrl = "data:image/" + ext + ";base64," + base64String;
IndexTmr = Convert.ToInt16(Session["tmrindex"]);
IndexTmr = IndexTmr + 1;
Session["tmrindex"] = IndexTmr;
}
else
{
IndexTmr = 1;
Session["tmrindex"] = IndexTmr;
}
}
}
protected void btnPlay_Click(object sender, EventArgs e)
{
mySrc=@"E:\AspEx\bin\Images\Playlist1.wpl";
}