Alan
Alan

Reputation: 7

iOS - video not playing

When I follow this tutorial: http://www.youtube.com/watch?v=cYXAHRvHbQE It gives me an error on the [playercontroller release]; line, so I remove it, and then it gives me these errors when I try to run it

Here is the image: (it wont let me post it) http://aftermathgame.webs.com/ss1.png

Upvotes: 0

Views: 239

Answers (2)

bitmapdata.com
bitmapdata.com

Reputation: 9600

If you simply must not add the header files only.

First, a framework must be added to your project.

Second, you should a following header. #import <MediaPlayer/MediaPlayer.h>

refer a following process.

  1. In Xcode, click your project file at the top of the Project Navigator.

  2. Click 'YourProjectName' under "Targets"

  3. Click the "Build Phases" tab.

  4. Click the plus in the "Link Binary With Libraries" window.

  5. Add the MediaPlayer.Framework library

  6. Add #import <MediaPlayer/MediaPlyer.h>

enter image description here

Upvotes: 4

Carlton Gibson
Carlton Gibson

Reputation: 7386

I'd guess this bit:

Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MPMoviePlayerViewController", referenced from:
      objc-class-ref in ViewController.o

... means you failed to link against the MediaPlayer framework.

Click on your project file in the navigator find the Linked Frameworks panel and add the the missing framework.

The semantic error you're also getting means you didn't declare your view controller as conforming to the AVAudioPlayerDelegate protocol. (Add this in angle brackets <AVAudioPlayerDelegate> after the class declaration.)

Upvotes: 1

Related Questions