-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Tuan Nguyen edited this page Oct 6, 2020
·
9 revisions
Welcome to the svyCapture wiki!
svyCapture is a simple service to capture screenshots and audio from browser to a callback method executing on the server.
Table of contents
| Method | Params | Return | Description |
|---|---|---|---|
| capture | className:string, callback:Function | Executes screen-capture using canvas | |
| captureViaDisplayMedia | callback:Function | Executes screen-capture using display media |
Executes screen-capture using canvas to html approach.
Params
| Type | Name | Description | Required |
|---|---|---|---|
| string | className | The callback key. | Optional |
| Function | callback | The function will be called and given screenshot data | Required |
Returns void
Executes screen-capture using display media API.
Params
| Type | Name | Description | Required |
|---|---|---|---|
| Function | callback | The function will be called and given screenshot data | Required |
Returns void
function onAction(event) {
plugins.svycaptureScreen.capture(null, getImage);
}
function getImage(img) {
//do something with b64 image data.
var img_data = '<img src="'+img+'"/>';
}| Method | Params | Return | Description |
|---|---|---|---|
| capture | callback:Function, callback:Function | Executes audio recorder | |
| stop | callback:Function,callback:Function | Stops audio recording |
Executes audio recorder.
Params
| Type | Name | Description | Required |
|---|---|---|---|
| Function | successCallback | The function will be called when finished with audio recording and return data | Required |
| Function | errorCallback | The function will be called if something fails | Optional |
Returns void
Stops audio recording. Params
| Type | Name | Description | Required |
|---|---|---|---|
| Function | successCallback | The function will be called if successful in stopping recording | Optional |
| Function | errorCallback | The function will be called if something fails | Optional |
Returns void
function onAction$captureAudio(event) {
plugins.svycaptureAudio.capture(audioCB, null);
}
function audioCB(data) {
//print out b64 data with audio recording
application.output(data);
}
function onAction$StopAudio(event) {
plugins.svycaptureAudio.stop(null, null);
}