Ios YTPlayerView在模拟器中工作,但不在Objective C中的Iphone设备中工作
我的代码:Ios YTPlayerView在模拟器中工作,但不在Objective C中的Iphone设备中工作,ios,objective-c,Ios,Objective C,我的代码: @property(nonatomic, strong) IBOutlet YTPlayerView *playerView; [self.playerView loadWithVideoId:@"M7lc1UVf-VE"]; 我正在处理youtube上的playvideo。但这段代码在模拟器中运行得很好,但在设备中却不行。。任何人都知道出现此问题的原因。添加委派
@property(nonatomic, strong) IBOutlet YTPlayerView *playerView;
[self.playerView loadWithVideoId:@"M7lc1UVf-VE"];
我正在处理youtube上的playvideo。但这段代码在模拟器中运行得很好,但在设备中却不行。。任何人都知道出现此问题的原因。添加
委派
和委派等方法
- (void)playerViewDidBecomeReady:(nonnull YTPlayerView *)playerView;
- (void)playerView:(nonnull YTPlayerView *)playerView receivedError:
- (YTPlayerError)error;
可能你可以在这里找到答案。什么不起作用,你有错误吗?我从youtube上传的视频在模拟器中工作,但当我在iphone设备中运行时,它不会出错,只显示白色屏幕。你有没有逐级检查代码,loadWithVideoId
是否执行时没有问题?是的,我尝试了loadWithVideoId执行时没有问题,但没有视频结果确保您的设备连接到了正确的internet…如果您连接了wifi,请确保wifi可以访问youtube视频