English 中文(简体)
MPMoviePlayerViewController andpinch out for full Screen
原标题:MPMoviePlayerViewController and pinch out for full screen

i) 搜索现场,但一吨 t发现的问题与地雷一样。

我在录像上播放时,要求通知“MPMoviePlayerPlaybackDidFinishNotification”。

之后,“单子” but子将录像带在pa中,参与者的作品坏......

我不理解为什么这一通知被称作......。

这是我的法典。

    - (id) init
{
    self = [super init];

    movie=[[MPMoviePlayerViewController alloc] init]; 
    //we init the frame here and after the view rotate the video
    [movie.view setFrame: CGRectMake(0, 0, 1024,768)];

    return self;
}

+ (MoviePlayerManager*) getInstance
{

    static MoviePlayerManager *movieSingleton;

    if (movieSingleton==nil) 
    {
        movieSingleton = [[MoviePlayerManager alloc]init];

    }

    return movieSingleton;

}

- (void) load:(NSURL*) a_videoFile withType:(VideoType)a_type
{

    type = a_type;

    [movie.moviePlayer setContentURL:a_videoFile];

        switch (type) {
        case VT_INTRO:
            [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallbackIntro:) name:MPMoviePlayerPlaybackDidFinishNotification object:movie.moviePlayer]; 
            break;

        case VT_RESPONSE:
            [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallbackResponse:) name:MPMoviePlayerPlaybackDidFinishNotification object:movie.moviePlayer]; 
            break;

        default:
            NSLog(@"video Type not initialised");
            break;
    }

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieIsReadyToPlay:) name:MPMediaPlaybackIsPreparedToPlayDidChangeNotification object:movie.moviePlayer]; 


    [movie.moviePlayer prepareToPlay];


}


-(void)myMovieIsReadyToPlay:(NSNotification*)aNotification 
{
    [gsDelegate.view addSubview:movie.view];
    [movie.moviePlayer play]; 

    movie.moviePlayer.controlStyle = MPMovieControlStyleFullscreen;

}

- (void) myMovieFinishedCallbackIntro:(NSNotification*)aNotification 
{
    NSNumber* reason = [[aNotification userInfo] objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];

    NSLog(@"%d",reason);

    if(aNotification != nil)
    {

        [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:movie.moviePlayer];

        [gsDelegate movieIntroDidStop];

    }
}

NSNumber*êt = [[通知用户Info] ObjectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey];

pin或“one”

帮助的th(和为我的坏english官 s;op)

问题回答
NSNumber* reason = [[aNotification userInfo] objectForKey:MPMoviePlayerPlaybackDidFinishReasonUserInfoKey]; 
NSLog(@"%d",reason);

NSNumber是一种客观的C目标,而不是一种原始的C类。 你们正在展示目标,而不是价值。

更正:

NSLog(@"%@", reason);

或改为:

int reason = [[userInfo objectForKey:@"MPMoviePlayerPlaybackDidFinishReasonUserInfoKey"] intValue];
NSLog(@"%d", reason);




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签