我正在尝试在Tizen TV平台上构建一个POC语音识别应用程序,但使用Web应用程序API无法获得语音控制权限。
调试控制台打印:无法读取未定义的属性' requestPermission‘(在我的示例中,全局tizen对象没有ppm属性,在网络上的所有示例中,该属性都应包含requestPermission方法)。
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 );发布于 2021-07-16 13:04:16
据我了解,电视配置文件不支持Web API的Privacy Privacy模块。在TV的docs here上没有模块隐私特权,所以你遇到的行为是我所期望的- tizen.ppm是未定义的。
同样基于信息here
从Tizen4.0开始,隐私相关特权的状态可以在运行时使用Privacy Privilege
(移动和可穿戴应用程序中的)进行解析。
不需要在TV配置文件上请求权限。
如果您希望自动签入代码,如果支持隐私权限模块,请尝试:
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
}https://stackoverflow.com/questions/68382975
复制相似问题