Click here to Skip to main content
16,016,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am working on a portal that will allow the authorized users to watch different TV channels. The TV channels details along with its basic info and video link also saved in the database. In the TVChannels form, I am using GridView to display the channels. When user click on a channel, I am getting ChannelLink string variable (which is video link) on ClickEvent from Database and then add flash player controls to a panel along with link in below code:
C#
Panel1.Controls.Add(new LiteralControl("<object width=\"100%\" height=\"100%\">"));
Panel1.Controls.Add(new LiteralControl("<param name=\"movie\" value=\"http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf\"></param>"));
Panel1.Controls.Add(new LiteralControl("<param name=\"flashvars\" value=\"src=" + ChannelLink+ "&controlBarMode=floating&autoPlay=true&streamType=live&scaleMode=stretch\"></param>"));
Panel1.Controls.Add(new LiteralControl("<param name=\"allowFullScreen\" value=\"true\"></param>"));
Panel1.Controls.Add(new LiteralControl("<param name=\"allowscriptaccess\" value=\"always\"></param>"));
Panel1.Controls.Add(new LiteralControl("<embed src=\"http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"100%\" height=\"100%\" flashvars=\"src=" +ChannelLink + "&controlBarMode=floating&autoPlay=true&streamType=live&scaleMode=stretch\"></embed></object>"));


The Video embed and played successfully in this way. BUT the problem is my Video Links are exposed to any one and that can be reused easily by viewing the html source of Flash player. So please help me how to secure my video links?
Posted
Comments
Zahid Khan Kakar 16-Feb-14 7:13am    
I am already using authorized users to view the channels. But a user can check the video/channel link by inspecting element or html source. So I want to safe link in embedded video player src.

1 solution

You should put a check that the user is authenticated or not. You should have authentication be checked on a Page_Load event,
Refer
HttpRequest[^] and
HttpRequest.IsAuthenticated[^]

Good Luck :)
-KR
 
Share this answer
 
v2

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