forked from Franky1/Streamlit-ffmpeg-Test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
26 lines (23 loc) · 808 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { Client } from "discord.js-selfbot-v13";
import { Streamer,streamLivestreamVideo } from '@dank074/discord-video-stream';
const streamer = new Streamer(new Client());
await streamer.client.login(process.env.botToken);
await streamer.joinVoice("1122707918177960047", "1200346808552001538");
const udp = await streamer.createStream({
"fps": 24,
"bitrateKbps": 2500,
"maxBitrateKbps": 2500,
"hardware_acc": false,
"videoCodec": "H264"
});
udp.mediaConnection.setSpeaking(true);
udp.mediaConnection.setVideoStatus(true);
try {
const res = await streamLivestreamVideo(process.env.url, udp);
console.log("Finished playing video " + res);
} catch (e) {
console.log(e);
} finally {
udp.mediaConnection.setSpeaking(false);
udp.mediaConnection.setVideoStatus(false);
}