मैं यह समझने के लिए संघर्ष कर रहा हूं कि यह क्यों काम नहीं कर रहा है:/हर बार जब मैं प्रोजेक्ट चलाता हूं तो ऐप क्रैश करता है जो मुझे 'एनएसआईएनवालिडअर्गमेंट एक्सेप्शन' फेंक देता है, कारण: '* - [NSURL initFileURLWithPath:]: nil string पैरामीटर 'वीडियो प्लेबैक विफल रहता है - [NSURL initFileURLWithPath:]: nil स्ट्रिंग पैरामीटर
मैंने एक ट्यूटोरियल का पालन किया है (मैं इसके लिए बहुत नया हूं) और यह उसके लिए काम करता है और कोड बिल्कुल वही है .. क्या कोई यह बता सकता है कि क्या चल रहा है पर?
ज फ़ाइल
#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h>
#import <QuartzCore/QuartzCore.h>
@interface FirstViewController : UIViewController {
MPMoviePlayerViewController *playerController;
}
-(IBAction)playVideo;
@end
मीटर फ़ाइल
#import "FirstViewController.h"
@interface FirstViewController()
@end
@implementation FirstViewController
{
MPMoviePlayerController *mpc;
}
- (IBAction)playButton:(id)sender {
NSString *stringPath = [[NSBundle mainBundle]pathForResource:@"intro" ofType:@"MP4"];
NSURL *url = [NSURL fileURLWithPath:stringPath];
if(url != nil){
mpc = [[MPMoviePlayerController alloc]initWithContentURL:url];
[mpc setMovieSourceType:MPMovieSourceTypeFile];
[[self view]addSubview:mpc.view];
[mpc setFullscreen:YES];
[mpc play];
}
else{
NSLog(@"URL not found");
}
}
@end
किसी से पूछने से पहले रीस दर्राघ का वह देव खाता है जिसका हम उपयोग कर रहे हैं। आपकी सहायता के लिए धन्यवाद –