gpt4 book ai didi

firefox-os - 如何在 Firefox OS 中使用相机 API

转载 作者:行者123 更新时间:2023-12-04 11:26:08 26 4
gpt4 key购买 nike

我想在 firefox os 模拟器中使用相机 api。 Docs 建议它仅适用于经过认证的应用程序。如果我想在我的应用程序中使用相机拍照,我该如何继续开发应用程序?提前致谢

最佳答案

您必须使用 Web Activities API拍照。简单来说,相当于Android的Intents为开放网络。

我会写很多关于它的文章,但那里有很好的代码示例,like this one ,就这样实现。你必须做一些事情:

创建一个网络事件:

var recordActivity = new MozActivity({ name: "record" });

设置一个 onsuccess回调,然后对结果做任何你想做的事情:
recordActivity.onsuccess = function () { console.log(this); }

还有一些细节,所有这些都列在 this post on Hacks上。 .

关于firefox-os - 如何在 Firefox OS 中使用相机 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17720957/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com