MPMediaPlayback没有音频ios 8

时间:2014-10-30 09:07:50

标签: ios video ios8 video-capture

我的应用程序捕获视频。我已经检查过该视频文件有声音,但在应用程序中它没有播放MPMoviePlayerController。我注意到,对于短视频,不到5秒钟,声音正在播放。

 -(void) showMovie:(NSString*)moviePath{
        [self initializeMoviePlayer:moviePath];
        [self setMoviePath:moviePath];

        [movieController play];   
    }

    -(void) initializeMoviePlayer:(NSString*)moviePath{
        if (movieController == nil) {
            movieController = [[MPMoviePlayerController alloc] initWithContentURL:[[NSURL alloc] initFileURLWithPath:moviePath]];
            movieController.repeatMode = MPMovieRepeatModeOne;

            [movieController prepareToPlay];
            [movieController setUseApplicationAudioSession:NO];
            [movieController setShouldAutoplay:YES];
            [movieController setControlStyle:2];


            movieController.fullscreen = YES;
            movieController.scalingMode =MPMovieScalingModeAspectFill;
            movieController.controlStyle = MPMovieControlStyleNone;
            movieController.view.autoresizingMask = UIViewAutoresizingFlexibleHeight |UIViewAutoresizingFlexibleWidth;

            [movieController.view setFrame: self.frame];

            [self insertSubview:self.movieController.view atIndex:0];
        }
    }
  • 更新: 在id为18823656的苹果bug记者中添加了一个错误

0 个答案:

没有答案