如何在我的应用程序中播放视频

发布于 2024-12-28 07:19:14 字数 194 浏览 4 评论 0原文

因此,我一直致力于在我的应用程序中播放一个小(> 1 MB)视频。当我越过代码中的断点时,我不断收到“SIGABRT”错误。作为新手,我还没有发现自己做错了什么。

我正在使用 Xcode 4.2。

感谢您的任何帮助。

So I have been working on getting a small (> 1 MB) video to play in my app. I keep getting a 'SIGABRT' error when I step past the break point in my code. Being the newbie, I haven't found any insight into what I am doing wrong.

I am using Xcode 4.2.

Thanks for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

孤蝉 2025-01-04 07:19:14

您使用以下代码来获取电影的 URL:

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"WhatV1.mp4" ofType:@"mp4"]];

您指定 mp4 部分两次。尝试将其更改为 [[NSBundle mainBundle] pathForResource:@"WhatV1" ofType:@"mp4"];

此外,您是在设备上还是在模拟器上运行它?视频框架在模拟器上崩溃是理所当然的。尝试在 iOS 设备上进行测试。

You’re using the following code to get a URL for your movie:

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"WhatV1.mp4" ofType:@"mp4"]];

You’re specifying the mp4 portion twice. Try changing that to [[NSBundle mainBundle] pathForResource:@"WhatV1" ofType:@"mp4"];.

Additionally, are you running this on a device or on the simulator? Video frameworks crashing on the simulator are par for the course. Try testing on an iOS device.

番薯 2025-01-04 07:19:14

不要将扩展名放在 pathForResource 参数中。

Don't put the extension in your pathForResource parameter.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文