From 98e2d363952515bc1078ce0c25f6013d231e1fa6 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Wed, 19 Feb 2025 13:49:14 +0700 Subject: [PATCH] Export a `stop` function from `prepareStream` --- src/media/newApi.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/media/newApi.ts b/src/media/newApi.ts index 736fee8..c9012ff 100644 --- a/src/media/newApi.ts +++ b/src/media/newApi.ts @@ -282,7 +282,12 @@ export function prepareStream( .audioBitrate(`${bitrateAudio}k`); command.run(); - return { command, output } + return { + command, output, + stop() { + command.kill("SIGTERM"); + } + } } export type PlayStreamOptions = {