locked
Playing video from external link in https asp.net website RRS feed

  • Question

  • User1392093625 posted

    Hi,

    I do have my site (developed in asp.net) running on https, and I need to have some embed video links from external domains which may be running on http. I do have exernal video links from vimeo or other sites. To make secure data transfer I want to write the response of the external video link url in the response of httphandler of my site. This approach works fine when I display any image or static html, but incase of video, it doesnt get streamed.

    Could any one please direct that what could be the appropriate approach to achieve this.

    Thanks and regards,

    Arvind

    Monday, November 5, 2012 7:54 AM

All replies

  • User1779161005 posted

    Perhaps the site you're loading the video from doesn't support https?

    Monday, November 5, 2012 9:22 AM
  • User1392093625 posted

    Thanks a lot for reply.

    Yes it is the case that the site we're loading the video from might not be on https. I need to load the videos which are on http sites (not on https). When I load the video It throws the alert of non-secure content as our site is running on https. Is there any way to load these videos in secure way so that user can not experience that alert of insecure content. I had used httphandler to get images/documents in our application securely but in case of video this approach doesnt sem efficient or may be i am missing something. What could be the efficient way to stream these kind of videos in our application with keeping in mind that it should verify the SSL certificate so that it couldnt alert for insecure content.

    Thanks and regards,

    Arvind

     

    Tuesday, November 6, 2012 1:02 AM
  • User1779161005 posted

    Well if the target site doesn't have SSL then you're going to get those errors/warnings. You could try to tunnel the data back thru your site, but that might not be ideal.

    Wednesday, November 7, 2012 10:07 AM
  • User1392093625 posted

    Hi BrockAllen

    Thanks for the reply.

    Yes It is exactly what I want to do, but dont know how can I achieve this. Could you please direct me how can I tunnel the data back thru my site for some specific external sites which are not having SSL.

    Thanks and regards,

    Arvind

     

    Thursday, November 8, 2012 1:28 AM
  • User1779161005 posted

    I don't know of any samples that so this already. It's something you'd have to build yourself.

    Thursday, November 8, 2012 9:58 AM
  • User1392093625 posted

    Hi,

    Thanks for the reply.

    I tried it by following this approach-

    Here is the code snippet where HTTPWebRequest is gotton from the url and then HttpWebResponse is written.

    But problem is that it is the case of live streaming and by this way video doesnt get streamed.

    Honestly I dont expect for any exact code but could you please direct me in the steps so that I can achieve this.


    string url=http://somedomain/link; /*some external link on http*/

    string response = MakeRequest(url);

                    Response.Write(response);

     private static string MakeRequest(string uri)         {   

              HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(uri);      

           webRequest.AllowAutoRedirect = true;            

     webRequest.Method = WebRequestMethods.Http.Post;   

              string output = "";       

          HttpWebResponse response = null;       

          try             {                 response = (HttpWebResponse)webRequest.GetResponse();    

                 StreamReader reader = new StreamReader(response.GetResponseStream());     

                output = reader.ReadToEnd();      

               response.Close();    

             }           

      finally       

          {        

             if (response != null)    

                     response.Close();     

            }

                return output;     

        }

     

     Thanks and regards,

    Arvind Chamoli

     

     

    Friday, November 9, 2012 12:31 AM