English 中文(简体)
• 播放有关3.0和4.0OS/SDK的录像?
原标题:iPhone - Play a video on both 3.0 and 4.0 OS / SDK?
  • 时间:2010-04-21 09:53:49
  •  标签:
  • iphone
  • video

自3.2起 视频会议实际上不同。

因此,我很想知道,是否有办法用兼容的密码(两者兼有;3.2)进行全方位的视频游戏,而不为这两个案件制定书面守则。

我认为,我们不得不撰写两本处理视频游戏的班次。

!!

最佳回答

我基本上认为,杰尔·凯利在3.1和3.1以上,我注意到这种情况。 答复ToSelector呼吁:

// Initialize a movie player object with the specified URL
MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
if (mp)
{

    // Register to receive a notification when the movie has finished playing. 
    [[NSNotificationCenter defaultCenter] addObserver:self 
                                             selector:@selector(moviePlayBackDidFinish:) 
                                                 name:MPMoviePlayerPlaybackDidFinishNotification 
                                               object:nil];


    //Will only run this code for >= OS 3.2 
    if ([MPMoviePlayerController instancesRespondToSelector:@selector(setFullscreen:animated:)]){   

        [[NSNotificationCenter defaultCenter] addObserver:self 
                                                 selector:@selector(moviePlayBackStateDidChange:) 
                                                     name:MPMoviePlayerPlaybackStateDidChangeNotification 
                                                   object:nil];
        [[NSNotificationCenter defaultCenter] addObserver:self 
                                                 selector:@selector(nowPlayingMovieDidChange:) 
                                                     name:MPMoviePlayerNowPlayingMovieDidChangeNotification 
                                                   object:nil];
        [[NSNotificationCenter defaultCenter] addObserver:self 
                                                 selector:@selector(moviePlayBackDidFinish:) 
                                                     name:MPMoviePlayerDidExitFullscreenNotification 
                                                   object:nil];

        mp.controlStyle = MPMovieControlStyleFullscreen;


        [mp setScalingMode:MPMovieScalingModeAspectFit];

                    //change mainMenu here to whatever your parent view is
        [mp.view setFrame:mainMenu.frame];
        [self.view addSubview:mp.view];



        [mp setFullscreen:YES animated:NO];
    }
//continue as normal

之后,在电影院中担任过职务 我利用同样的方法撤销通知。

问题回答

一种可能性是,为此采用一种帮助方法。 因此,你只需要一劳永逸地写字,并具备这一能力。

为了书写助手方法本身,如果能提供MoviePlayerViewController的话,你就希望检查。 如果是的话,则使用该软件,然后提交该屏幕。 否则,只能使用常备的MPMoviePlayerController。

因此,基本框架是:

-(void)playMovie:(NSURL *)movieURL
{
    Class mpVC = NCClassFromString("MPMoviePlayerViewController");
    if(mpVC)
    {
        // Generate MPPlayerViewController here and use accordingly
    }
    else
    {
        // Generate MPPlayerController here and use accordingly
    }
}

您可能必须使用Napif/else/ >,并汇编一份可在特定的O/S级别上加以执行的通用手册。





相关问题
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风格的解决办法,只是一个简单的袖珍流程......

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

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

热门标签