首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >正在尝试获取Tizen TV Web App权限

正在尝试获取Tizen TV Web App权限
EN

Stack Overflow用户
提问于 2021-07-15 01:53:16
回答 1查看 65关注 0票数 0

我正在尝试在Tizen TV平台上构建一个POC语音识别应用程序,但使用Web应用程序API无法获得语音控制权限。

调试控制台打印:无法读取未定义的属性' requestPermission‘(在我的示例中,全局tizen对象没有ppm属性,在网络上的所有示例中,该属性都应包含requestPermission方法)。

代码语言:javascript
复制
function requestPermit(uri) {
      return new Promise(function(resolve, reject) {
        tizen.ppm.requestPermission(uri,
          function(success) { resolve(success); },
          function(error) { reject(error); });
      });
    }

var start = function() {
    return requestPermit('http://tizen.org/privilege/voicecontrol.tts')
        .then(function() { return init(); })
        .catch(function(err) { return console.log(err); });
}

$(document).bind( 'pageinit', start );
EN

回答 1

Stack Overflow用户

发布于 2021-07-16 13:04:16

据我了解,电视配置文件不支持Web API的Privacy Privacy模块。在TV的docs here上没有模块隐私特权,所以你遇到的行为是我所期望的- tizen.ppm是未定义的。

同样基于信息here

从Tizen4.0开始,隐私相关特权的状态可以在运行时使用Privacy Privilege

(移动和可穿戴应用程序中的)进行解析。

不需要在TV配置文件上请求权限。

如果您希望自动签入代码,如果支持隐私权限模块,请尝试:

代码语言:javascript
复制
if (tizen.systeminfo.getCapability("http://tizen.org/feature/security.privacy_privilege")) {
  // ppm module is supported - you need to request privilege from the user here
} else {
  // ppm module is not supported - just log or ignore, no consent from the user is needed
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68382975

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档