Package com.flashphoner.fpwcsapi.webrtc
Class WebRTCMediaProvider
java.lang.Object
com.flashphoner.fpwcsapi.webrtc.WebRTCMediaProvider
WebRTCMediaProvider
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close media connectioncreateLocalMediaStreams
(Constraints constraints, boolean muteAudio, boolean muteVideo, android.content.Context context, org.webrtc.SurfaceViewRenderer renderer) Create local media streams corresponding specified media constrains for the specified renderercreateMediaConnection
(String id, String videoCodec, org.webrtc.PeerConnection.RTCConfiguration mediaOptions) Create a new media connection with specified codeccreateMediaConnection
(String id, String videoCodec, org.webrtc.SurfaceViewRenderer remoteRender, org.webrtc.PeerConnection.RTCConfiguration mediaOptions) Create a new media connection with specified renderer and video codeccreateMediaConnection
(String id, org.webrtc.SurfaceViewRenderer remoteRender, org.webrtc.PeerConnection.RTCConfiguration mediaOptions) Create a new media connection with specified renderer and default codecsvoid
Remove media connection by idorg.webrtc.PeerConnectionFactory
static WebRTCMediaProvider
Get media connection by idvoid
init
(android.content.Context context) boolean
void
releaseLocalMediaAccess
(MediaConnectionOptions mediaConnectionOptions) void
void
setCustomVideoCapturer
(org.webrtc.VideoCapturer currentVideoCapturer) void
setMediaProjection
(android.media.projection.MediaProjection mediaProjection) void
setPeerConnectionFactoryOptions
(org.webrtc.PeerConnectionFactory.Options options) int
size()
void
stopCapturer
(org.webrtc.VideoCapturer capturer) void
switchCamera
(CameraSwitchHandler cameraSwitchHandler) boolean
boolean
-
Field Details
-
VIDEO_TRACK_ID
- See Also:
-
AUDIO_TRACK_ID
- See Also:
-
-
Method Details
-
getInstance
-
setPeerConnectionFactoryOptions
public void setPeerConnectionFactoryOptions(org.webrtc.PeerConnectionFactory.Options options) -
init
public void init(android.content.Context context) -
createMediaConnection
public MediaConnection createMediaConnection(String id, String videoCodec, org.webrtc.PeerConnection.RTCConfiguration mediaOptions) Create a new media connection with specified codec- Parameters:
id
-videoCodec
-- Returns:
-
createMediaConnection
public MediaConnection createMediaConnection(String id, org.webrtc.SurfaceViewRenderer remoteRender, org.webrtc.PeerConnection.RTCConfiguration mediaOptions) Create a new media connection with specified renderer and default codecs- Parameters:
id
-remoteRender
-- Returns:
-
createMediaConnection
public MediaConnection createMediaConnection(String id, String videoCodec, org.webrtc.SurfaceViewRenderer remoteRender, org.webrtc.PeerConnection.RTCConfiguration mediaOptions) Create a new media connection with specified renderer and video codec- Parameters:
id
-videoCodec
-remoteRender
-- Returns:
-
destroyMediaConnection
Remove media connection by id- Parameters:
id
-
-
getMediaConnection
Get media connection by id- Parameters:
id
-- Returns:
-
releaseLocalMediaAccess
-
stopCapturer
public void stopCapturer(org.webrtc.VideoCapturer capturer) -
close
public void close()Close media connection -
createLocalMediaStreams
public MediaConnectionOptions createLocalMediaStreams(Constraints constraints, boolean muteAudio, boolean muteVideo, android.content.Context context, org.webrtc.SurfaceViewRenderer renderer) Create local media streams corresponding specified media constrains for the specified renderer- Parameters:
constraints
-renderer
-- Returns:
- MediaConnectionOptions which contains list of MediaStream objects
-
switchCamera
-
size
public int size()- Returns:
- Number of media connections
-
getFactory
public org.webrtc.PeerConnectionFactory getFactory() -
setMediaProjection
public void setMediaProjection(android.media.projection.MediaProjection mediaProjection) -
setCustomVideoCapturer
public void setCustomVideoCapturer(org.webrtc.VideoCapturer currentVideoCapturer) -
resetCustomVideoCapturer
public void resetCustomVideoCapturer() -
getAudioManager
-
turnOnFlashlight
public boolean turnOnFlashlight() -
turnOffFlashlight
public boolean turnOffFlashlight() -
isFlashlightSupport
public boolean isFlashlightSupport()
-