capacitor-screen-streamer
v0.0.5
Published
This plugin helps you stream frames into your app when recording device screen.
Downloads
10
Readme
capacitor-screen-streamer
This plugin helps you stream frames into your app when recording device screen.
Install
npm install capacitor-screen-streamer
npx cap syncAPI
startRecording(...)
startRecording(options: RecordingOptions) => Promise<{ success: boolean; }>Start screen recording
| Param | Type | Description |
| ------------- | ------------------------------------------------------------- | ------------------------- |
| options | RecordingOptions | - Recording configuration |
Returns: Promise<{ success: boolean; }>
stopRecording()
stopRecording() => Promise<{ success: boolean; }>Stop screen recording
Returns: Promise<{ success: boolean; }>
addListener('frame', ...)
addListener(eventName: 'frame', listenerFunc: (data: FrameData) => void) => Promise<PluginListenerHandle>Add listener for frame events
| Param | Type |
| ------------------ | ------------------------------------------------------------------ |
| eventName | 'frame' |
| listenerFunc | (data: FrameData) => void |
Returns: Promise<PluginListenerHandle>
removeAllListeners()
removeAllListeners() => Promise<void>Remove all listeners
Interfaces
RecordingOptions
| Prop | Type | Description | Default |
| ------------------- | ------------------- | --------------------------------------- | ----------------- |
| frameInterval | number | Interval between frames in milliseconds | 1000 |
| quality | number | Quality of JPEG compression (0-100) | 80 |
| scale | number | Scale factor for frame size (0.1-1.0) | 0.5 |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
FrameData
| Prop | Type | Description |
| --------------- | ------------------- | ------------------------- |
| frame | string | Base64 encoded JPEG image |
| timestamp | number | Timestamp of the frame |
| width | number | Frame width |
| height | number | Frame height |
