JavaScript
import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({
type: "android",
config: {
deviceType: "physical",
},
});
await box.action.recording.rewind.enable();
// Perform some operations...
console.info("tapping chrome app...");
await box.action.tap({ target: "chrome app" });
// sleep 3 seconds
console.info("sleeping 3 seconds...");
await new Promise((resolve) => setTimeout(resolve, 3000));
console.info("pressing home button...");
await box.action.pressButton({ buttons: ["home"] });
console.info("extracting recording...");
// Extract the last 5 seconds of the recording
const result = await box.action.recording.rewind.extract({
duration: "5s",
});
console.log(`recording download url: ${result.presignedUrl}`);
}
main();import os
import time
from gbox_sdk import GboxSDK
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"]) # This is the default and can be omitted
def main():
box = gbox_sdk.create(
type="android",
config={
"device_type": "physical"
}
)
box.action.recording.rewind.enable()
# Perform some operations...
print("tapping chrome app...")
box.action.tap(target="chrome app")
# sleep 3 seconds
print("sleeping 3 seconds...")
time.sleep(3)
print("pressing home button...")
box.action.press_button(buttons=["home"])
print("extracting recording...")
# Extract the last 5 seconds of the recording
result = box.action.recording.rewind.extract(duration="5s")
print(f"recording download url: {result.presigned_url}")
if __name__ == "__main__":
main()curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/actions/recording/rewind/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration": "10s"
}
'{
"storageKey": "storage://gbox/recording/1234567890",
"presignedUrl": "https://gbox.ai/api/v1/boxes/1234567890/recording/1234567890"
}UI Action
Extract rewind recording
Rewind and capture the device’s background screen recording from a specified time period.
POST
/
boxes
/
{boxId}
/
actions
/
recording
/
rewind
/
extract
JavaScript
import GboxSDK from "gbox-sdk";
const gboxSDK = new GboxSDK({
apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});
async function main() {
const box = await gboxSDK.create({
type: "android",
config: {
deviceType: "physical",
},
});
await box.action.recording.rewind.enable();
// Perform some operations...
console.info("tapping chrome app...");
await box.action.tap({ target: "chrome app" });
// sleep 3 seconds
console.info("sleeping 3 seconds...");
await new Promise((resolve) => setTimeout(resolve, 3000));
console.info("pressing home button...");
await box.action.pressButton({ buttons: ["home"] });
console.info("extracting recording...");
// Extract the last 5 seconds of the recording
const result = await box.action.recording.rewind.extract({
duration: "5s",
});
console.log(`recording download url: ${result.presignedUrl}`);
}
main();import os
import time
from gbox_sdk import GboxSDK
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"]) # This is the default and can be omitted
def main():
box = gbox_sdk.create(
type="android",
config={
"device_type": "physical"
}
)
box.action.recording.rewind.enable()
# Perform some operations...
print("tapping chrome app...")
box.action.tap(target="chrome app")
# sleep 3 seconds
print("sleeping 3 seconds...")
time.sleep(3)
print("pressing home button...")
box.action.press_button(buttons=["home"])
print("extracting recording...")
# Extract the last 5 seconds of the recording
result = box.action.recording.rewind.extract(duration="5s")
print(f"recording download url: {result.presigned_url}")
if __name__ == "__main__":
main()curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/actions/recording/rewind/extract \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"duration": "10s"
}
'{
"storageKey": "storage://gbox/recording/1234567890",
"presignedUrl": "https://gbox.ai/api/v1/boxes/1234567890/recording/1234567890"
}Authorizations
Enter your API Key in the format: Bearer . Get it from https://gbox.ai
Body
application/json
Configuration for rewinding and extracting clips from continuous screen recording
How far back in time to rewind for extracting recorded video. This specifies the duration to go back from the current moment (e.g., '30s' rewinds 30 seconds to get recent recorded activity). Default is 30s, max is 5m.
Supported time units: ms (milliseconds), s (seconds), m (minutes), h (hours) Example formats: "500ms", "30s", "5m", "1h" Maximum allowed: 5m
Example:
"10s"
Response
200 - application/json
Result of extracting the recording rewind
Was this page helpful?