Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gram-tgcalls

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gram-tgcalls - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

12

lib/index.d.ts

@@ -34,2 +34,6 @@ import { Api, TelegramClient } from 'telegram';

/**
* Resumes the video stream. Returns `null` if there is not in call, `false` if not paused or `true` if successful.
*/
resumeVideo(): boolean | null;
/**
* Mutes the audio stream. Returns `null` if there is not in call, `false` if already muted or `true` if successful.

@@ -39,5 +43,13 @@ */

/**
* Mutes the video stream. Returns `null` if there is not in call, `false` if already muted or `true` if successful.
*/
muteVideo(): boolean | null;
/**
* Unmutes the audio stream. Returns `null` if not in call, `false` if already muted or `true` if successful.
*/
unmuteAudio(): boolean | null;
/**
* Unmutes the audio stream. Returns `null` if not in call, `false` if already muted or `true` if successful.
*/
unmuteVideo(): boolean | null;
private close;

@@ -44,0 +56,0 @@ private reset;

50

lib/index.js

@@ -39,2 +39,3 @@ "use strict";

this.editSelfParticipant = this.editSelf;
this.client.addEventHandler(this.updateHandler);
}

@@ -70,3 +71,5 @@ updateHandler(update) {

if (!this.audioStream && !this.videoStream) {
this.audioStream = new tgcalls_1.Stream(audio.readable, { ...audio.options });
this.audioStream = new tgcalls_1.Stream(audio.readable, {
...audio.options,
});
this.audioTrack = this.audioStream.createTrack();

@@ -96,7 +99,3 @@ if ((_a = audio.options) === null || _a === void 0 ? void 0 : _a.onFinish) {

catch (err) {
this.call =
this.tgcalls =
this.audioTrack =
this.videoTrack =
undefined;
this.reset();
throw err;

@@ -145,2 +144,15 @@ }

/**
* Resumes the video stream. Returns `null` if there is not in call, `false` if not paused or `true` if successful.
*/
resumeVideo() {
if (!this.videoStream) {
return null;
}
if (this.videoStream.paused) {
this.videoStream.pause();
return true;
}
return false;
}
/**
* Mutes the audio stream. Returns `null` if there is not in call, `false` if already muted or `true` if successful.

@@ -159,2 +171,15 @@ */

/**
* Mutes the video stream. Returns `null` if there is not in call, `false` if already muted or `true` if successful.
*/
muteVideo() {
if (!this.videoTrack) {
return null;
}
if (this.videoTrack.enabled) {
this.videoTrack.enabled = false;
return true;
}
return false;
}
/**
* Unmutes the audio stream. Returns `null` if not in call, `false` if already muted or `true` if successful.

@@ -172,2 +197,15 @@ */

}
/**
* Unmutes the audio stream. Returns `null` if not in call, `false` if already muted or `true` if successful.
*/
unmuteVideo() {
if (!this.videoTrack) {
return null;
}
if (!this.videoTrack.enabled) {
this.videoTrack.enabled = true;
return true;
}
return false;
}
close() {

@@ -174,0 +212,0 @@ var _a, _b, _c;

4

package.json
{
"name": "gram-tgcalls",
"version": "2.1.1",
"version": "2.1.2",
"main": "lib/index.js",

@@ -28,4 +28,4 @@ "scripts": {

"telegram": "^1.8.10",
"tgcalls": "^1.0.0"
"tgcalls": "github:rojserbest/tgcalls"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc