iPadアプリケーションで動作しないmpmovieviewcontroller?

以下はmpmoviecontrollerを設定するための私のコードです。私はビデオの音を聞くことができますが、私はビデオの写真を見ることができません。私はインターネットで検索しましたが、自分のコードでエラーが見つかりませんでした。誰かがこのジレンマから抜け出すのを助けることができますか?

(パスとURLが正しいことに注意してください〜:)

- (IBAction)playClicked:(id)sender {
NSString *path=[[NSBundle mainBundle] bundlePath];
path=[path stringByAppendingPathComponent:@"movies.bundle"];
path=[path stringByAppendingPathComponent:@"mean.mp4"];

NSURL *url=[NSURL fileURLWithPath:path];
NSFileManager *filemanager=[NSFileManager defaultManager];

if([filemanager fileExistsAtPath:path]){
    NSLog(@"File exists at %@! You should be able to see the movie!:)",path);
    MPMoviePlayerController *player=[[MPMoviePlayerController alloc] initWithContentURL:url];
    if(player){
        player.scalingMode = MPMovieScalingModeNone;
        player.controlStyle=MPMovieControlStyleFullscreen;
        player.movieSourceType=MPMovieSourceTypeFile;
        [player.view setFrame:CGRectMake(0, navigationBar.bounds.size.height, self.view.bounds.size.width, self.view.bounds.size.height-navigationBar.bounds.size.height)];
        [self.view addSubview:player.view];
        [player prepareToPlay];
        NSLog(@"Ready to play for %@!",player.duration);
        [player play];
        NSLog(@"Played!");
    }
}else{
    NSLog(@"File does not exist!:(");
}

}

ランタイムエラー:

    2012-02-06 08:54:40.248 Board[1604:11f03] File exists at /Users/admin/Library/Application Support/iPhone Simulator/5.0/Applications/C468351E-3150-4397-B73A-8505D099B2C5/Board.app/movies.bundle/mean.mp4! You should be able to see the movie!:)
    2012-02-06 08:54:40.276 Board[1604:11f03] Ready to play for (null)!
    2012-02-06 08:54:40.277 Board[1604:11f03] Played!
    [Switching to process 1604 thread 0x13e03]
    [Switching to process 1604 thread 0x11f03]
    2012-02-06 08:54:40.733 Board[1604:11f03] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:  dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
    Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    in /System/Library/Frameworks/Security.framework/Versions/A/Security
    2012-02-06 08:54:40.740 Board[1604:11f03] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:  dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
    Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
   in /System/Library/Frameworks/Security.framework/Versions/A/Security
   2012-02-06 08:54:40.886 Board[1604:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
    Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
   in /System/Library/Frameworks/Security.framework/Versions/A/Security
   2012-02-06 08:54:40.894 Board[1604:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
    Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    in /System/Library/Frameworks/Security.framework/Versions/A/Security
    2012-02-06 08:54:40.905 Board[1604:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
    Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    in /System/Library/Frameworks/Security.framework/Versions/A/Security
    2012-02-06 08:54:40.928 Board[1604:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
    Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    in /System/Library/Frameworks/Security.framework/Versions/A/Security
    2012-02-06 08:54:40.940 Board[1604:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
    Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    in /System/Library/Frameworks/Security.framework/Versions/A/Security
    2012-02-06 08:54:40.947 Board[1604:11f03] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
    Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
    Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
    in /System/Library/Frameworks/Security.framework/Versions/A/Security
0

1 答え

下のコードを追加すると作業が行われるようです。

player.movieSourceType=MPMovieSourceTypeFile;
[self.view addSubview:player.view];
[player setFullscreen:YES];
0
追加された