大佬教程收集整理的这篇文章主要介绍了ios – 声音仅通过MPMoviePlayerController在某些设备上通过耳机播放,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
@H_139_5@mPMoviePlayerController正在播放视频,音频只能通过耳机播放.
真正的拖累是,这只发生在一些iPad和iPhone上,甚至是同样的模型
运行相同的系统!
http://www.porcaro.org/MPMoviePlayerController/TestMovie.zip
我已经看到它在iPhone 4S,iPhone 4和iPad 2上运行正常并且失败了.
这是最相关的代码.感谢您的任何见解,我也将向Apple提交一个错误:
(void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; moviePath = [NSString StringWithFormat:@"%@/intro.m4v",[[NSBundle mainBundle] bundlePath]]; NSURL *movieURL = [NSURL fileURLWithPath:moviePath]; theMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; controlStyle = MPMovieControlStyleEmbedded; movieView = [self view]; movieRect = [[self view] frame]; controlStyle = MPMovieControlStyleFullscreen; theMoviePlayer.controlStyle = controlStyle; theMoviePlayer.view.userInteractionEnabled = YES; if (1) { NSLog(@"Created theMoviePlayer: %@. Playing: %@",theMoviePlayer,moviePath); } [[NsnotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlayBACkStateDidChangeNotification object:nil]; [[NsnotificationCenter defaultCenter] addObserver:self SELEctor:@SELEctor(checkForEndOfMovie:) name:MPMoviePlayerPlayBACkStateDidChangeNotification object:theMoviePlayer]; // this line doesn't fix the problem //[theMoviePlayer prepareToPlay]; [[theMoviePlayer view] setFrame:movieRect]; [movieView addSubview: [theMoviePlayer view]]; [theMoviePlayer play]; }
以上是大佬教程为你收集整理的ios – 声音仅通过MPMoviePlayerController在某些设备上通过耳机播放全部内容,希望文章能够帮你解决ios – 声音仅通过MPMoviePlayerController在某些设备上通过耳机播放所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。