I have the fallowing code for running the video while clicking on the Thumbnail of the video . iam binding the thumbnail via Datalst control like below
Now Problem is that how i call the RunVideo() method on image click ??? and an other issue is regarding page postback ? is there any other way to run the video on same page without Postback???
Hope Hear from you.
Regards
life is name of learning!
Mark as an answer if it helps
IFRAME is nothingbut a html control,you will assign page source to this. put your video player on seperate page and assign this page as IFRAME source.
When you click on your thumbimage, pass video id or video file name as query string to this new sepearte page. so that you can assign this as player's source.
or
if you going to maintain your thumbimage and player in a same page means, use the same IFRAME technique but pass the source of video(file name) in different manner.., like using session variable...
ask me if you have any doubt on this...
Mani
Please Mark as Answer If this is helpful.
Marked as answer by Rameezwaheed on Aug 06, 2010 10:13 AM
I met the same situation and I have used that IFRAME technique succesfully. my problem was when user click on any button in player page, Postback was occured and it stopped my playing video.
So I put Player in seperate page and call this page within an IFRAME. so no pbm, It's working fine for me.......
If my solution helped to you please mark your answer.
Rameezwaheed
Contributor
3730 Points
1595 Posts
Running the video on the same page without postback ????
Aug 04, 2010 11:53 AM|LINK
Hi all ,
I have the fallowing code for running the video while clicking on the Thumbnail of the video . iam binding the thumbnail via Datalst control like below
<asp:DataList ID="dtlstVideo" runat="server" GridLines="Horizontal" RepeatDirection="Horizontal" BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="5" Width="622px" Height="181px"> <ItemTemplate> <td><a href="VideoDataList.aspx?vid=<%# DataBinder.Eval(Container.DataItem, "Video_ID") %>" > <img src="Video/Thumb/<%# DataBinder.Eval(Container.DataItem, "Video_Image") %>" border="0" width = "150px" height = "150px"> </a> </td> </ItemTemplate> <FooterStyle BackColor="#CCCCCC" ForeColor="Black" /> <AlternatingItemStyle BackColor="#DCDCDC" /> <ItemStyle BackColor="#EEEEEE" ForeColor="Black" /> <SelectedItemStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" /> </asp:DataList> </tr>and i have the fallowing code behind Function
public void RunVideo() { vid = Request.QueryString["vid"].ToString(); DataSet dst = (DataSet)ViewState["videods"]; DataRow[] dw = dst.Tables[0].Select("Video_ID= '" + vid + "'"); if (dw.Length > 0) { vfname = dw[0]["Video_File"].ToString(); } string plyr = "<embed src='Players/flvplayer.swf' width='425' height='355' bgcolor='#FFFFFF' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' flashvars='file=Video/SWF/" + vfname + "&autostart=false&frontcolor=0xCCCCCC&backcolor=0x000000&lightcolor=0x996600&showdownload=false&showeq=false&repeat=false&volume=100&useaudio=false&usecaptions=false&usefullscreen=true&usekeys=true'></embed>"; plh.Visible = true; plh.Controls.Add(new LiteralControl(plyr)); }Now Problem is that how i call the RunVideo() method on image click ??? and an other issue is regarding page postback ? is there any other way to run the video on same page without Postback???
Hope Hear from you.
Regards
Mark as an answer if it helps
g_mani
Contributor
2055 Points
586 Posts
Re: Running the video on the same page without postback ????
Aug 04, 2010 12:47 PM|LINK
Use UpdatePanel or put your video player in seperate IFRAME and pass video file to this seperate page and assign to player.
Please Mark as Answer If this is helpful.
Rameezwaheed
Contributor
3730 Points
1595 Posts
Re: Running the video on the same page without postback ????
Aug 04, 2010 12:56 PM|LINK
Thanks for the suggestion . I have a difficulty while assigning the RunVideo() to image link i mean href.
how i pass the Id of Video to IFrame and run the video on the same click then how????
Best Regards
Mark as an answer if it helps
UziNutt99
Member
438 Points
84 Posts
Re: Running the video on the same page without postback ????
Aug 04, 2010 01:10 PM|LINK
This is how you can use iframe. Make another page VideoPlayer.aspx and put table into it. Pass values through querystring in iframe.
<iframe src="VideoPlayer.aspx?Video_ID=<%# DataBinder.Eval(Container.DataItem, "Video_ID") %>&Image=<%# DataBinder.Eval(Container.DataItem, "Video_Image") %>" width="500" height="500"> </iframe> <table> <tr> <td><a href="VideoDataList.aspx?vid=<%= Request.QueryString["Video_ID"] %>" > <img src="Video/Thumb/<%= Request.QueryString["Image"] %>" border="0" width = "150px" height = "150px"> </a> </td> </tr> </table>g_mani
Contributor
2055 Points
586 Posts
Re: Running the video on the same page without postback ????
Aug 04, 2010 01:15 PM|LINK
IFRAME is nothingbut a html control,you will assign page source to this. put your video player on seperate page and assign this page as IFRAME source.
When you click on your thumbimage, pass video id or video file name as query string to this new sepearte page. so that you can assign this as player's source.
or
if you going to maintain your thumbimage and player in a same page means, use the same IFRAME technique but pass the source of video(file name) in different manner.., like using session variable...
ask me if you have any doubt on this...
Please Mark as Answer If this is helpful.
Rameezwaheed
Contributor
3730 Points
1595 Posts
Re: Running the video on the same page without postback ????
Aug 05, 2010 05:08 AM|LINK
Thanks for reply and suggestion
Is there any alternative of using IFrame like JQUERY or some thing else ??????
Best Regards
Mark as an answer if it helps
UziNutt99
Member
438 Points
84 Posts
Re: Running the video on the same page without postback ????
Aug 05, 2010 05:15 AM|LINK
Why don't you use AJAX...
g_mani
Contributor
2055 Points
586 Posts
Re: Running the video on the same page without postback ????
Aug 05, 2010 05:23 AM|LINK
Have you tried my updatepanel solution?
Please Mark as Answer If this is helpful.
Rameezwaheed
Contributor
3730 Points
1595 Posts
Re: Running the video on the same page without postback ????
Aug 05, 2010 05:41 AM|LINK
Yes i tired and it is working correctly, just want to know is there any alternative beside using IFRAME technique.
Else Thanks for reply and support .
Best Regards
Mark as an answer if it helps
g_mani
Contributor
2055 Points
586 Posts
Re: Running the video on the same page without postback ????
Aug 05, 2010 06:07 AM|LINK
Hi,
I met the same situation and I have used that IFRAME technique succesfully. my problem was when user click on any button in player page, Postback was occured and it stopped my playing video.
So I put Player in seperate page and call this page within an IFRAME. so no pbm, It's working fine for me.......
If my solution helped to you please mark your answer.
Please Mark as Answer If this is helpful.