gram-tgcalls
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -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; |
@@ -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; |
{ | ||
"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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
GitHub dependency
Supply chain riskContains a dependency which resolves to a GitHub URL. Dependencies fetched from GitHub specifiers are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25695
466
1
+ Addedwhich-typed-array@1.1.16(transitive)
- Removedabbrev@1.1.1(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedaproba@1.2.0(transitive)
- Removedare-we-there-yet@1.1.7(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedchownr@1.1.4(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconsole-control-strings@1.1.0(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddebug@3.2.7(transitive)
- Removeddeep-extend@0.6.0(transitive)
- Removeddelegates@1.0.0(transitive)
- Removeddetect-libc@1.0.3(transitive)
- Removeddomexception@1.0.1(transitive)
- Removedfs-minipass@1.2.7(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedgauge@2.7.4(transitive)
- Removedglob@7.2.3(transitive)
- Removedhas-unicode@2.0.1(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedignore-walk@3.0.4(transitive)
- Removedinflight@1.0.6(transitive)
- Removedini@1.3.8(transitive)
- Removedis-fullwidth-code-point@1.0.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedminimist@1.2.8(transitive)
- Removedminipass@2.9.0(transitive)
- Removedminizlib@1.3.3(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedms@2.1.3(transitive)
- Removedneedle@2.9.1(transitive)
- Removednode-pre-gyp@0.13.0(transitive)
- Removednopt@4.0.3(transitive)
- Removednpm-bundled@1.1.2(transitive)
- Removednpm-normalize-package-bin@1.0.1(transitive)
- Removednpm-packlist@1.4.8(transitive)
- Removednpmlog@4.1.2(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-homedir@1.0.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedosenv@0.1.5(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedrc@1.2.8(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedsafe-buffer@5.1.25.2.1(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsax@1.4.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstring-width@1.0.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedstrip-json-comments@2.0.1(transitive)
- Removedtar@4.4.19(transitive)
- Removedtgcalls@1.0.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwebidl-conversions@4.0.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
- Removedwide-align@1.1.5(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedwrtc@0.4.7(transitive)
- Removedyallist@3.1.1(transitive)