如果你#include “ui/UIVideoPlayer.h”
使用/UIVideoPlayer播放游戏视频碰到下面的错误
Undefined symbols for architecture i386:
“_MPMoviePlayerPlaybackDidFinishNotification”, referenced from:
- in libcocos2d iOS.a(UIVideoPlayer-ios.o)
- in libcocos2d iOS.a(UIVideoPlayer-ios.o)
“_MPMoviePlayerPlaybackStateDidChangeNotification”, referenced from:
- in libcocos2d iOS.a(UIVideoPlayer-ios.o)
- in libcocos2d iOS.a(UIVideoPlayer-ios.o)
“OBJC_CLASS$_MPMoviePlayerController”, referenced from:
objc-class-ref in libcocos2d iOS.a(UIVideoPlayer-ios.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
此时做如下操作:
xcode: MyGame -> TARGETS -> MyGame iOS -> Link Binary With Libraries -> 添加MediaPlayer.framework。
//MyGame 为你的项目
问题解决。