0

Thanks to MDN I successfully deployed a simple app on my Panasonic CXW754. So far so good. Now I'd like to have access to screen settings like brightness etc. Is there an API provided by Panasonic or can I do it with plain Firefox OS API somehow?

I already looked at https://github.com/mozilla-b2g/gaia/tree/master/tv_apps

But navigator.mozSettings is null and navigator.tv does not exist on my TV runtime :(

2 Answers2

1

You should be able to change screen brightness using navigator.mozPower.screenBrightness from the PowerManager API. Only certified apps can access this API though.

kumar303
  • 674
  • 6
  • 7
0

I would use the SettingsManager API instead of using directly navigator.mozPower.screenBrightness.

The SettingsManager let you change almost any setting by firstly requesting and locking that setting. It can even let you add Observers: https://developer.mozilla.org/en-US/docs/Web/API/SettingsManager

For example: https://github.com/shawnjohnjr/releases-mozilla-central/blob/8355c4efc146c9e58f7d11cdb5f567908b5754c0/toolkit/mozapps/update/test/marionette/update_smoketest_ota_same_version.js

But as pointed out by @kumar303, it is only for certified apps.

Cod1ngFree
  • 1,873
  • 6
  • 21
  • 33