1

I get an unrecognized selector error when trying to create an AVPlayer from external source. From what I can see, I'm following Apple's guidelines by the book.

What I'm trying to do is simply:

#import <AVKit/AVKit.h> // Not sure if these are both necessary but they can't hurt
#import <AVFoundation/AVFoundation.h>

NSURL *videoURL = [NSURL URLWithString:@"https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"];
AVPlayer *player = [AVPlayer playerWithURL:videoURL];

And I get this error on the last line:

+[AVPlayer playerWithURL:]: unrecognized selector sent to class 0x1000f30c8
Daniel Larsson
  • 6,278
  • 5
  • 44
  • 82

1 Answers1

0

There is nothing wrong with your code. It compiles and executes correctly both in the simulator, and on a non-jailbroken iOS 9 iPhone.

I would advise trying it in the simulator and/or on a different device. Simply put, if AVPlayer doesn't implement playerWithURL: , you're not operating in a working development environment. Jailbreaking really is the only thing that comes to mind. If that's not the case, perhaps reinstall iOS. What you're seeing is not normal.

TyR
  • 718
  • 4
  • 9