How to add videoPlayer as a subtitle?

Hello, I ran into a problem related to adding subview; I follow the code:

        NSString *urlStr  = [NSString  stringWithFormat:@"http:x/iphone0.m3u8"];
        NSURL *videoURL   = [NSURL URLWithString:urlStr];
        MPMoviePlayerController *iVideoPlayer = [[MPMoviePlayerController alloc]initWithContentURL:videoURL];
        [self.view addSubview:iVideoPlayer.view ];  

        if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
        {
            // The device is an iPad running iPhone 3.2 or later.
             iVideoPlayer.view.frame = CGRectMake(353,258,320,240);
        }
        else
        {
             iVideoPlayer.view.frame = CGRectMake(156,96,168,148);
        }                   
        [iVideoPlayer play];

In this code, I like to add a video player as a subtitle. I successfully added videoPlayer.but the problem is that during video playback, if I click on the specified area (CGRectMake (353,258,320,240), the video stops. I like to use the VideoPlayer function (hereinafter, Pause, Volume up / down), which are not executed How to resolve this.?

+3
source share
1 answer

MPMoviePlayerController. controlStyle , (, , ..).

MPMovieControlStyleNone,
MPMovieControlStyleEmbedded,
MPMovieControlStyleFullscreen,
MPMovieControlStyleDefault

: MPMoviePlayerController

, .

[iVideoPlayer setControlStyle:MPMovieControlStyleEmbedded]
0

All Articles