dataWithContentsOfFile:options:error: accepts the file path, not the file name. If the video file is in the application bundle, you must do
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"vvideo" ofType:@"mp4"]; NSError *error = nil; NSData *data = [NSData dataWithContentsOfFile:filePath options:nil error:&error]; if(data == nil && error!=nil) {
Instead of passing the error argument as nil to pass the value, it will be useful in understanding the error condition if that happens.
Hope this helps!
source share