Skip to content

Commit

Permalink
Export a stop function from prepareStream
Browse files Browse the repository at this point in the history
  • Loading branch information
longnguyen2004 committed Feb 19, 2025
1 parent 4dc6cdc commit 98e2d36
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/media/newApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 98e2d36

Please sign in to comment.