【问题标题】:NSInvalidArgumentException [NSURL length] url video record iphoneNSInvalidArgumentException [NSURL 长度] url 视频记录 iphone
【发布时间】:2012-09-25 18:33:05
【问题描述】:

我通过 iphone 数据库应用程序保存了一个视频,我正在录制视频的 url 是:

file://localhost/private/var/mobile/Applications/0DB3ABFC-1630-44FF-8506-4B08E3CB2C85/tmp/capture-T0x2591d0.tmp.00fEdr/capturedvideo.MOV

但是,当我尝试通过 MediaPlayer 阅读视频时,它总是崩溃...

示例代码:

NSString *frameName = [info objectForKey:@"UIImagePickerControllerMediaURL"];

NSURL *url = [NSURL URLWithString:frameName];

videoPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[self.view addSubview:videoPlayer.view];

videoPlayer.view.frame = CGRectMake(0, 0, 320, 419);
[videoPlayer play];

提前谢谢你。

【问题讨论】:

    标签: iphone url mpmediaplayercontroller


    【解决方案1】:

    [info objectForKey:@"UIImagePickerControllerMediaURL"] 的内容似乎无效。

    如果有效,请尝试fileURLWithPath 而不是urlWithString

    【讨论】:

    • [info objectForKey:@"UIImagePickerControllerMediaURL"] 看起来值相等时似乎有效:file://localhost/private/var/mobile/Applications/0DB3ABFC-1630-44FF-8506-4B08E3CB2C85/ tmp/capture-T0x2591d0.tmp.00fEdr/capturedvideo.MOV 与 NSLog..
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-07
    相关资源
    最近更新 更多