How to stream video over secure connection on iOS

2019-06-05 05:25发布

问题:

I can play a video from a local resource (on the device). I can stream a video from the unprotected internet. I can't stream from the company intranet (either from internal or externally)

Typical secure company network. Videos are stored in SharePoint 2007 lists (but I have url to the video file).

I've tried:

  • MPMoviePlayerController
  • MPMoviePlayerViewController
  • UIViewView (creating html on fly using the <video> tag and video url)

and I can't get anything to work. Heck, I can't even get it to work going directly to the link in Safari on the iPad. The only thing I haven't tried doing is downloading it as a file then playing locally. Due to a host of usability issue this would not be a preferred option.

回答1:

There were 2 problems.

  1. MPMoviePlayerController doesn't support all the challenge authentication which exists in NSURLConnection. The solution is to just do a "dummy" NSURLConnection somewhere inside your secure area, have it handle all the challenges and set it to store the information for the session. From here on out, MPMoviePlayerController or other connections which don't support the ins and outs of SSL requests will use the existing session.
  2. A valid intermediate certificate had to be installed on the server. Something I never would have figured out myself. It exists as a small item in one of the guides under Secure connections.