How to draw text on video to show subtitle on iOS?
How to s开发者_Python百科how subtitle above video with an overlay view on iOS?
You can create an overlay view using UILabel to show subtitle as below
//Overlay View
UILabel *lblOverlayView = [[UILabel alloc] init];
lblOverlayView.frame = CGRectMake(0, 459, 320, 21);
lblOverlayView.backgroundColor = [UIColor yellowColor];
lblOverlayView.alpha = 0.3f;
lblOverlayView.text = @"Video Subtitle";
then you can add it as a subview to the view of MPMoviePlayerController to show a subtitle while playing the video.
[_mpMoviePlayerController.view addSubview:lblOverlayView];
here, _mpMoviePlayerController is an object of MPMoviePlayerController. Hope this will help you to fulfill the requirements.
Add a subview to the view showing the video and put it in front. This might help:
[myView bringSubviewToFront: subtitleView];
精彩评论