.stopScreenRecording()
Stops a screen recording currently in progress. See .startScreenRecording to start a recording.
Usage
device.stopScreenRecording()
Returns
Promise (Buffer): A promise containing a base64 buffer.
Support
| Platform | Supported |
|---|---|
| iOS | Yes |
| Android | Yes |
| Web | Unknown |
Examples
Store a screen recording on disk:
const { device } = require("appdriver");
const path = require("path");
(async () => {
const filePath = path.join(__dirname, "videos", "example.mp4");
await device.startScreenRecording({ filePath });
// ...
await device.stopScreenRecording();
})();
Manually store a screen recording on disk:
const { device } = require("appdriver");
const fs = require("fs");
const path = require("path");
(async () => {
await device.startScreenRecording();
// ...
const video = await device.stopScreenRecording();
fs.writeFileSync(path.join(__dirname, "videos", "example.mp4"), video);
})();