...
Automatic quality switching parameters are set when calling initRemoteDisplay()
function:
Code Block | ||||
---|---|---|---|---|
| ||||
// Create remote display item to show remote streams state.setDisplay(initRemoteDisplay(const displayOptions = { div: document.getElementById("remoteVideo")quality:true, room: state.room,autoAbr: true }; const abrOptions = { peerConnectionthresholds: state.pc,[ displayOptions {parameter: "nackCount", maxLeap: {10}, {parameter: "freezeCount", publishermaxLeap: false10}, quality{parameter: true, "packetsLost", maxLeap: 10} ], type abrKeepOnGoodQuality: falseABR_KEEP_ON_QUALITY, abrTryForUpperQuality: ABR_TRY_UPPER_QUALITY, abr: true interval: ABR_QUALITY_CHECK_PERIOD }; const display = initRemoteDisplay( state.room, document.getElementById("remoteVideo"), displayOptions, abrOptions, abrKeepOnGoodQuality: 20000, createDefaultMeetingController, createDefaultMeetingModel, abrTryForUpperQuality: 30000createDefaultMeetingView, }oneToOneParticipantFactory(remoteTrackProvider(state.room)) })); state.setDisplay(display); // Start WebRTC negotiation await state.room.join(state.pc, null, null, 1); |
Where:
- abr - enables or disables automatic quality switching
- abrKeepOnGoodQuality - interval in milliseconds to play a current video quality if there are no WebRTC statistics data leaps
- abrTryForUpperQuality - after this interval in milliseconds player will try to switch to a higher available video quality if there are no WebRTC statistics data leaps
- interval - WebRTC statistics data collection interval in miliiseconds
If any quality is manually chosen, it will be playing even if WebRTC statistics values are bad.
...