我正在使用MPMovieViewController播放器在我的应用中显示视频,但也需要显示.Srt
我使用了以下代码
if(self.livePlayer)
{
[self.livePlayer.view removeFromSuperview];
[self.livePlayer stop];
self.livePlayer=nil;
}
self.livePlayer = [[MPMoviePlayerController alloc] init];
[self.view addSubview:self.livePlayer.view];
self.livePlayer.view.frame = CGRectMake(5.0, 64.0, [[UIScreen mainScreen] bounds].size.width - 10.0, viwVideo.frame.size.height - 10.0);
self.livePlayer.view.autoresizingMask=UIViewAutoresizingFlexibleWidth;
[self.livePlayer.view setTranslatesAutoresizingMaskIntoConstraints:true];
self.livePlayer.controlStyle = MPMovieControlStyleDefault;
self.livePlayer.movieSourceType = MPMovieSourceTypeStreaming;
self.livePlayer.shouldAutoplay = NO;
frame = self.livePlayer.view.frame;