Skip to content

Commit

Permalink
Added op 12 call
Browse files Browse the repository at this point in the history
  • Loading branch information
ImTheSquid committed Jun 20, 2023
1 parent 74c2b59 commit 7478f22
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bd/release/Tuxphones.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,32 @@ module.exports = !global.ZeresPluginLibrary ? Dummy : (([Plugin, Api]) => {
Logger.log("Secret key:");
Logger.log(json.d.secret_key);
this.secret_key = json.d.secret_key;
const op12 = {
"op": 12,
"d": {
"audio_ssrc": this.audio_ssrc,
"video_ssrc": this.video_ssrc,
"rtx_ssrc": this.video_ssrc + 1,
"streams": [
{
"type": "video",
"rid": "100",
"ssrc": this.video_ssrc,
"active": true,
"quality": 100,
"rtx_ssrc": this.video_ssrc + 1,
"max_bitrate": 8e6,
"max_framerate": this.selectedFPS,
"max_resolution": {
"type": "fixed",
"width": this.selectedResolution.width,
"height": this.selectedResolution.height
}
}
]
}
};
this._ws.send(JSON.stringify(op12));
this.startStream(this.currentSoundProfile.pid, this.currentSoundProfile.xid, this.selectedResolution, this.selectedFPS, this.ip, this.port, this.secret_key, this.voice_ssrc, this.base_ssrc, this.audio_ssrc);
return;
} else if (json.op == 2) {
Expand Down
29 changes: 29 additions & 0 deletions bd/src/Tuxphones/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,35 @@ return class extends Plugin {
Logger.log('Secret key:');
Logger.log(json.d.secret_key);
this.secret_key = json.d.secret_key;

// Send video stream op
const op12 = {
"op":12,
"d":{
"audio_ssrc":this.audio_ssrc,
"video_ssrc":this.video_ssrc,
"rtx_ssrc":this.video_ssrc + 1,
"streams":[
{
"type":"video",
"rid":"100",
"ssrc":this.video_ssrc,
"active":true,
"quality":100,
"rtx_ssrc":this.video_ssrc + 1,
"max_bitrate":8000000,
"max_framerate": this.selectedFPS,
"max_resolution":{
"type":"fixed",
"width": this.selectedResolution.width,
"height": this.selectedResolution.height,
}
}
]
}
}
this._ws.send(JSON.stringify(op12));

this.startStream(this.currentSoundProfile.pid, this.currentSoundProfile.xid, this.selectedResolution, this.selectedFPS, this.ip, this.port, this.secret_key, this.voice_ssrc, this.base_ssrc, this.audio_ssrc);
return; // Disallow encryption information, stopping the stream from being created
} else if (json.op == 2) {
Expand Down

0 comments on commit 7478f22

Please sign in to comment.