HTC Desire 的 MediaStore.ACTION_VIDEO_CAPTURE 问题

发布于 2025-01-04 16:21:49 字数 632 浏览 3 评论 0原文

我正在尝试在我的应用程序中使用 MediaStore.ACTION_VIDEO_CAPTURE,请参阅下面的代码。 不过,HTC 的愿望似乎存在问题。 当视频捕获 Intent 启动时,一切都很好,但是一旦按下用于录制的圆形按钮,或者实际上与之交互的任何 UI,Intent 就会挂起。 Logcat 不会抛出任何错误,但每当我尝试与手机交互时,它都会发布“UI Block”。 我可以使用主页按钮退出应用程序,但此后相机无法访问,应用程序无法再次在手机上运行 - 直到设备重置。我已经在 HTC 手机上尝试过该应用程序,运行没有任何问题。我认为这可能是 HTC Sense UI 的问题,但我不确定。代码如下:

case R.id.VCF_Btn_record: Intent captureVideoIntent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(captureVideoIntent, VIDEO_CAPTURED);

MediaStore 的 API 级别为 1,ACTION_VIDEO_CAPTURE API 级别为 3,因此它应该可以在此设备上运行,还有其他人经历过类似的情况吗?

I am attempting to use the MediaStore.ACTION_VIDEO_CAPTURE in my app, see code below.
However, there seems to be an issue with it on the HTC desire.
When the video capture intent launches, everything is fine, but as soon as the round button for record is pressed, or any of the UI interacted with in fact, the intent hangs. Logcat doesn't throw any errors, but whenever I attempt to interact with the phone it posts " UI Block".
I am able to quit the application with the home button, but after this the camera is unaccessable, the app cannot rund on the phone again -untill the device has been reset. Ive tried the app on a HTC sensation where it worked without problems. I think it might be an issue with the HTC Sense UI, but I am not sure. Code as follows:

case R.id.VCF_Btn_record:
Intent captureVideoIntent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(captureVideoIntent, VIDEO_CAPTURED);

MediaStore is API level 1, and ACTION_VIDEO_CAPTURE API lvl 3, so it should work on this device, has anyone else experienced anything similar?

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

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

发布评论

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

评论(1

哭泣的笑容 2025-01-11 16:21:49

这是我在我的应用程序中使用的代码,它完全符合我的愿望:

private void captureVideo() {
    Intent i = new Intent("android.media.action.VIDEO_CAPTURE");
    try {
        startActivityForResult(i, CAPTURE_VIDEO);
    } catch (ActivityNotFoundException ex) {
        Toast.makeText(this, "Your device does not contain an application to run this action", Toast.LENGTH_LONG).show();
    }
}

我知道 android.provider.MediaStore.ACTION_VIDEO_CAPTURE 解析为“android.media.action.VIDEO_CAPTURE”,但如果我记得在开发我的应用程序时应用程序,使用它对我不起作用。

看看这是否适合你

Here is the code that I'm using in my app, which works perfectly fine on my Desire:

private void captureVideo() {
    Intent i = new Intent("android.media.action.VIDEO_CAPTURE");
    try {
        startActivityForResult(i, CAPTURE_VIDEO);
    } catch (ActivityNotFoundException ex) {
        Toast.makeText(this, "Your device does not contain an application to run this action", Toast.LENGTH_LONG).show();
    }
}

I know that android.provider.MediaStore.ACTION_VIDEO_CAPTURE resolves to "android.media.action.VIDEO_CAPTURE", but if I recall when developing my app, using it didn't work for me.

See if that works for you

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