Get all available instances in the system:
console.log(stbDvbManager.inputs);
Get the first available input:
var input = stbDvbManager.inputs[0];
Get information about whether input can change antennaPower
:
console.log(input.capabilities.antennaPower);
Manual control of antenna power state:
// turn on
input.antennaPower = true;
// turn off
input.antennaPower = false;
Get information about input:
// get supported scan types for this tuner
console.log(input.supportedScanTypes);
// get currently supported scan types for this tuner
console.log(input.currentScanTypes);
Set current scan type for this input:
// DVB-C signal
console.log(input.setSignalType(input.TYPE_DVB_C));
Device may require reboot to apply changed signal type. To determine this check flag:
if ( input.capabilities.requireReboot ) {
gSTB.ExecAction('reboot');
}
Set event listeners to handle received data:
input.onScanProgress = function ( info ) {
console.log('DVB channels scanning is in progress.');
console.log(info);
};
input.onChannelFound = function ( info ) {
console.log('DVB channel is found.');
console.log(info);
};
input.onAntennaPower = function ( status ) {
console.log('DVB antenna powered was changed.');
console.log(status);
};
Start channel scanning (parameters explanation see in stbDvbInput.startScan
method):
input.startScan({
from: 10,
to: 100,
type: 2,
bandwidth: 6,
step: 5,
modulation: 0,
scanMode: 0,
frequency: 12,
networkId: 0
});
Stop channel scan:
input.stopScan();
Root list with all available channels from all inputs:
console.log(stbDvbManager.channelList);
Make a new channel list as a subset of the parent list:
var channelList1, channelList2;
// any channel with LCN less then 123
channelList1 = stbDvbManager.createChannelList(['lt', 'channelNumber', 123], stbDvbManager.channelList);
console.log(channelList1);
// all channels without filters
channelList2 = stbDvbManager.createChannelList([], stbDvbManager.channelList);
console.log(channelList2);
Get size of list:
console.log(channelList1.size);
Add channel to the list:
channelList2.add(channelList1.get(123).id);
Remove the given channel from this channel list with check operation status:
if ( !channelList2.remove(channelList2.get(123).id) ) {
console.log('Was not able to remove a channel!');
}
if ( !channelList2.remove(123) ) {
console.log('Was not able to remove a channel!');
}
Get channel detailed info:
// by index
console.log(channelList2.get(5));
// by channel unique id
console.log(channelList2.get('C.0.000506.06875-00'));
Get channel range:
console.log(channelList2.slice(1, 5));
Get the channel index in this channel list:
console.log(channelList1.indexOf(channelList2.get(123).id));
Remove all channels from this channel list:
channelList2.clear();
Preload the given channel to faster start playing:
stbDvbManager.loadChannel(channelList2.get(0));
Unload from preloaded cache the given channel:
stbDvbManager.unloadChannel(channelList2.get(0));
Unload from preloaded cache all channels:
stbDvbManager.unloadAllChannels();
Get array of all available tuners in the system:
console.log(stbDvbManager.tuners);
Play channel:
var player = stbPlayerManager.list[0],
channel = channelList2.get(0);
player.play({
uri: channel.uri,
solution: 'dvb'
});
Get first available input:
var tuner = stbDvbManager.tuners[0];
Tune receiver to specified frequency (parameters explanation see in stbDvbTuner.tune
method):
tuner.tune({
frequency: 50000
});
tuner.tune(channelList2.get(0));
Untune receiver:
tuner.untune();
Link this tuner to the given input:
tuner.moveToInput(input);
Get current input number of this tuner:
console.log(tuner.inputIndex);
Get players count which used this tuner:
console.log(tuner.playersCount);
Get Bit Error Rate:
console.log(tuner.bitErrorRate);
Get information about signal quality:
console.log(tuner.signalQuality);
Get information about signal level:
console.log(tuner.signalLevel);
Get information about tuner state (see in stbDvbTuner.stateType
):
console.log(tuner.state);