There is a little video part in my application.
So i find this sample, which play mp4 video from url: http://www.sdkboy.com/?p=66
You can download sample here: http://www.sdkboy.com/tutorials/AVFoundation_Test3.zip
But when I replace NSURL code
NSURL *url = [NSURL URLWithString:@"http://www.samkeeneinteractivedesign.com/videos/littleVid3.mp4"];
With this one, for playing local video, player doesn't work.
NSURL *url = [NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"malina36" ofType:@"mp4"]];
This file exist, i check it with
if ([[NSFileManager defaultManager] fileExistsAtPath:url.absoluteString]) {
NSLog(@"yes");
} else {
NSLog(@"no");
}
Can you help me?
Try using fileURLWithPath: method instead of URLWithString:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With