playing video from remote URL with AVPlayer
<p>I'm trying to play a video from a remote URL using AVPlayer. It is a very simple setup: Load the view controller, and in the viewDidLoad, setup the AVPlayer with the url and play it. This is my code, in viewDidLoad:</p>

<pre><code>NSString *urlString = @"http://download.wavetlan.com/SVV/Media/HTTP/MOV/ConvertedFiles/MediaConvert/MediaConvert_test4_1m10s_MPEG4SP_VBR_383kbps_320x240_30fps_AACLC_VBR_60kbps_Stereo_44100Hz.mov";
NSURL *url = [NSURL fileURLWithPath:urlString];
self.item = [AVPlayerItem playerItemWithURL:url];
self.player = [[AVPlayer alloc] initWithPlayerItem:self.item];
AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoFinished:) name:AVPlayerItemDidPlayToEndTimeNotification object:self.item];
playerLayer.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
playerLayer.backgroundColor = [UIColor greenColor].CGColor;
[self.view.layer addSublayer:playerLayer];
playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
[self.player play];
self.player.actionAtItemEnd = AVPlayerActionAtItemEndNone;
</code></pre>

<p>But when the view loads, nothing happens. The screen is just green (because I set the playerLayer to be green), so I know it's there. It just isn't playing. You can test that urlString too, it is a valid url. The size of the file is 3.8 MB. I got the url from some test URLs here: <a href="http://download.wavetlan.com/SVV/Media/HTTP/http-mov.htm" rel="nofollow noreferrer">http://download.wavetlan.com/SVV/Media/HTTP/http-mov.htm</a></p>

<p>So, I have initialized the player, the playerLayer, the item, and the URL is correct. But nothing appear on screen. One thing I noticed in the debugger is that the NSURL and the actual string of the url are different at the end. So maybe that could be of some help, but I'm not sure how to change that. Here is a photo:</p>

<p><a href="https://i.stack.imgur.com/H2jds.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H2jds.png" alt="enter image description here"></a></p>

<p>Also, I'm testing this on an iOS 8.4 device, so I know it is not the app transport security that is blocking the HTTP address. </p>

<p>what could I be doing wrong here?? any help is appreciated. thanks. </p>