0

I'm trying to build a POC Voice recognition app on the Tizen TV platform, but using Web application API I've failed at getting the permission for voice control.
Debug console prints: Cannot read property 'requestPermission' of undefined (in my case the global tizen object has no ppm property which in all examples on the Web should hold the requestPermission method).

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 );
steakoverflow
  • 1,206
  • 2
  • 15
  • 24

1 Answers1

1

As far as I know, the Privacy Privilege module of Web API is not supported on TV profile. There is no module Privacy Privilege on TV's docs here, so the behaviour you met is what I would expect - tizen.ppm is undefined.

Also basing on information here:

Since Tizen 4.0, the status of privacy-related privileges can be resolved at runtime using the Privacy Privilege API (in mobile and wearable applications).

There is no need to request a privilege on TV profile.

If you want to check in your code automatically, if the Privacy Privilege module is supported try:

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
}
15kokos
  • 575
  • 2
  • 8
  • Thanks, that clears up that part, however I only tried acquiring permissions after I got WebAPIException code: 18, with message "Permission denied" at VoiceControlClientManager.getVoiceControlClient() which I call at $(document).bind( 'pageinit', init ); – steakoverflow Jul 16 '21 at 12:10
  • Did you add a 'http://tizen.org/privilege/recorder' privilege to your config.xml file as described here https://docs.tizen.org/application/web/api/5.5/device_api/mobile/tizen/voicecontrol.html#VoiceControlClientManager::getVoiceControlClient? 'http://tizen.org/privilege/voicecontrol.tts' is only native/dotnet privilege for tts, but web requires 'recorder' privilege. – 15kokos Jul 19 '21 at 09:49
  • Yes, but for some reason the ppm property of tizen object is undefined. – steakoverflow Aug 01 '21 at 10:29
  • tizen.ppm is only mobile and wearable feature - just do not use it on TV. – 15kokos Aug 05 '21 at 09:32