How to use the Volume OSD provided by Samsung?
Implementation of the built-in TV volume UI elements
This is a guide for using the native Volume OSD provided by Samsung platform.
Unregister/register volume keys in the onShow event.
var WIDGET = new Common.API.Widget(); // For sendReadyEvent()
var TVKEY = new Common.API.TVKeyValue(); // Remote controller key value object
var PL_NNAVI_STATE_BANNER_VOL = 1;
Main.onLoad = function () {
WIDGET.sendReadyEvent();
};
window.onShow = function (e) {
var NNaviPlugin = caph.platform.dtv.Device.plugin('NNAVI');
NNaviPlugin.SetBannerState(PL_NNAVI_STATE_BANNER_VOL);
caph.platform.dtv.Device.unRegisterKey(caph.platform.Key.VOL_UP);
caph.platform.dtv.Device.unRegisterKey(caph.platform.Key.VOL_DOWN);
caph.platform.dtv.Device.unRegisterKey(caph.platform.Key.MUTE);
/**
* code
*/
};
Note
- Please be aware about the letter-case in the window.onShow event.
- More information on that topic can be found in Samsung Volume UI not shown on 2012 platform.
See also
Information on implementing your own volume UI and volume keyhandling can be found in Volume control policy of SmartTV Apps.