Configure View
The Cordova SDK provides the following methods:
- hideSelfView(): To hide and unhide local stream view.
- hideRemoteView(): To hide and unhide remote stream view.
- hideScreenShareView(): To hide and unhide screen share view.
- hideCanvasScreen(): To hide and unhide canvas view.
- resizeLocalView(): To resize the local view.
- resizeRemoteView(): To resize the remote view
- setReceiveVideoQuality(): To set the desired video quality.
- getReceiveVideoQuality(): To get currently selected video quality.
- adjustLayout(): To adjust video player layout.
Hide or Unhide Local View
The window.EnxRtc.hideSelfView()
method is used to hide or unhide local stream view in the running conference.
- Method:
hideSelfView( hide, successCallback, errorCallback )
- Paramters:
hide
: Boolean. Set it to true to hide the local view. Set it to false to unhide local view.successCallback
: Callable Function. Success Notification.errorCallback
: Callable Function. Error Notification.
Sample Code
// To hide screen share viewwindow.EnxRtc.hideScreenShareView(true, function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});// To unhide screen share viewwindow.EnxRtc.hideScreenShareView(false,function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});
Hide or Unhide Remote View
The window.EnxRtc.hideRemoteView()
method is used to hide or unhide remote stream view in the running conference.
- Method:
hideRemoteView( hide, successCallback, errorCallback )
- Paramters:
hide
: Boolean. Set it to true to hide the remote view. Set it to false to unhide remote view.successCallback
: Callable Function. Success Notification.errorCallback
: Callable Function. Error Notification.
Sample Code
// To hide Remote viewwindow.EnxRtc.hideRemoteView(true, function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});// To unhide Remote viewwindow.EnxRtc.hideRemoteView(false, function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});
Hide or Unhide Screenshare View
The window.EnxRtc.hideScreenShareView()
method is used to hide or unhide screen share view in the running conference.
- Method:
hideScreenShareView( hide, successCallback, errorCallback )
- Paramters:
hide
: Boolean. Set it to true to hide the screen share view. Set it to false to unhide screen share view.successCallback
: Callable Function. Success Notification.errorCallback
: Callable Function. Error Notification.
Sample Code
// To hide screen share viewwindow.EnxRtc.hideScreenShareView(true,function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});// To unhide screen share viewwindow.EnxRtc.hideScreenShareView(false,function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});
Hide or Unhide Canvas View
The window.EnxRtc.hideCanvasScreen()
method is used to hide and unhide canvas view in the running conference.
- Method:
hideCanvasScreen( hide, successCallback, errorCallback )
- Paramters:
hide
: Boolean. Set it to true to hide the canvas view. Set it to false to unhide canvas view.successCallback
: Callable Function. Success Notification.errorCallback
: Callable Function. Error Notification.
Sample Code
// To hide Canvas viewwindow.EnxRtc.hideCanvasScreen(true, function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});// To unhide Canvas viewwindow.EnxRtc.hideCanvasScreen(false,function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});
Resize Local View
The window.EnxRtc.resizeLocalView()
method is used to resize the local view in the running conference.
- Method:
resizeLocalView( resizeOptions, successCallback, errorCallback )
- Parameters:
resizeOptions
: JSON Object. View Settings.height
: Number. View Height.width
: Number. View Width.margin_top
: Number. Top Margin. Not Applicable.margin_bottom
: Number. Bottom Margin. Not Applicable.margin_left
: Number. Left Margin. Not Applicable.margin_right
: Number. Right Margin. Not Applicable.position
: String. Not Applicable.
successCallback
: Callable Function. Success Notification.errorCallback
: Callable Function. Error Notification.
Sample Code
var options = {height: 130,width: 100,margin_top: 50,margin_left: 0,margin_right: 15,margin_bottom: 10,position: "top"};window.EnxRtc.resizeLocalView(options, function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});
Resize Remote View
The window.EnxRtc.resizeRemoteView()
method is used to resize the remote view in the running conference.
- Method:
resizeRemoteView( resizeOptions, successCallback, errorCallback )
- Parameters:
resizeOptions
: JSON Object. View Settings.height
: Number. View Height.width
: Number. View Width.margin_top
: Number. Top Margin. Not Applicable.margin_bottom
: Number. Bottom Margin. Not Applicable.margin_left
: Number. Left Margin. Not Applicable.margin_right
: Number. Right Margin. Not Applicable.position
: String. Not Applicable.
successCallback
: Callable Function. Success Notification.errorCallback
: Callable Function. Error Notification.
Sample Code
var options = {height: 130,width: 100,margin_top: 50,margin_left: 0,margin_right: 15,margin_bottom: 10,position: "center"};window.EnxRtc.resizeRemoteView(options ,function(data) {console.log('Excelsior succuss! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});
Receive desired Video Quality
The Client Endpoint may receive the desired video quality for available bandwidth. You may create UI based on the enumerated values of video quality, as explained below.
To Set the Desired Video Quality
- Method:
setReceiveVideoQuality( videoQualityOptions, successCallback, errorCallback )
- Parameters:
videoQualityOptions
: JSON Object. Expecteed Video Quality Specification.videoQuality
: String. Auto, HD, SD, LD
Set it to auto if you want EnableX to decide the optimum quality for you dynamically.streamType
: String. Enumerated Values: talker, canvas.
successCallback
: Callable Function. Success Notification.errorCallback
: Callable Function. Error Notification.
Sample Code
var videoQualityOptions = {streamType: "Auto",videoQuality: "talker"};window.EnxRtc.setReceiveVideoQuality(videoQualityOptions ,function(data) {console.log('Excelsior success! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});
To get the selected Video Quality
- Method:
getReceiveVideoQuality( streamType, successCallback, errorCallback )
- Parameters:
videoQualityOptions
: JSON Object. Expecteed Video Quality Specification.streamType
: String. Enumerated Values: talker, canvas.
successCallback
: Callable Function. Success Notification.errorCallback
: Callable Function. Error Notification.
Sample Code
window.EnxRtc.getReceiveVideoQuality("talker" ,function(data) {console.log('Excelsior success! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});
Adjust Player Layout
The window.EnxRtc.adjustLayout()
method helps to adjust video player layout in case you have received a complete Active Talker view. If the user rotates the screen, this method will help the video layout to readjust to fit within its parent view.
- Method:
adjustLayout( successCallback, errorCallback )
- Parameters:
successCallback
: Callable Function. Success Notification.errorCallback
: Callable Function. Error Notification.
Sample Code
window.EnxRtc.adjustLayout(function(data) {console.log('Excelsior success! ' + JSON.stringify(data.data));}, function (err) {console.log('Uh oh… error' + JSON.stringify(err));});