The social.plus Video SDK provides extensive camera control capabilities for creating professional broadcasting experiences. This guide covers all available camera features and how to implement them across different platforms.
// Switch between front and rear camerasawait videoSDK.camera.switchCamera();// Switch to specific cameraawait videoSDK.camera.switchCamera('rear');// Get available camerasconst cameras = await videoSDK.camera.getAvailableCameras();console.log(cameras);// Output: [{ id: 'front', name: 'Front Camera' }, { id: 'rear', name: 'Rear Camera' }]
// Set video resolutionawait videoSDK.camera.setResolution('1080p');// Available resolutionsconst resolutions = await videoSDK.camera.getSupportedResolutions();// Output: ['480p', '720p', '1080p', '4K']// Get current resolutionconst currentResolution = videoSDK.camera.getCurrentResolution();
// Set frame rateawait videoSDK.camera.setFrameRate(30);// Get supported frame ratesconst frameRates = await videoSDK.camera.getSupportedFrameRates();// Output: [15, 30, 60]// Auto frame rate based on conditionsawait videoSDK.camera.setFrameRate('auto');
// Auto focusawait videoSDK.camera.autoFocus();// Manual focus (0.0 to 1.0)await videoSDK.camera.setFocus(0.7);// Focus at specific point (x, y coordinates)await videoSDK.camera.focusAtPoint(100, 200);// Get focus capabilitiesconst focusCapabilities = await videoSDK.camera.getFocusCapabilities();
// Auto white balanceawait videoSDK.camera.setWhiteBalance('auto');// Manual white balanceawait videoSDK.camera.setWhiteBalance('daylight');// Options: 'auto', 'daylight', 'cloudy', 'tungsten', 'fluorescent'// Custom white balance temperatureawait videoSDK.camera.setWhiteBalanceTemperature(5600); // in Kelvin
// Get current camera stateconst state = videoSDK.camera.getState();// States: 'idle', 'initializing', 'active', 'switching', 'error'// Listen for state changesvideoSDK.camera.on('stateChanged', (newState, previousState) => { console.log(`Camera state changed from ${previousState} to ${newState}`);});