
Security News
/Research
npm Phishing Email Targets Developers with Typosquatted Domain
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
ngx-webrtc-lib
Advanced tools
Angular microapp/library for video conference using agora-rtc-sdk-ng.
Angular microapp/library for Agora WebRTC client from Agora.io using agora-rtc-sdk-ng.
This library was generated with Angular CLI version 12.2.0.
Install ngx-webrtc-lib
from npm
:
npm install ngx-webrtc-lib
Add wanted package to NgModule imports:
import { WebRtcModule } from 'ngx-webrtc-lib';
@NgModule({
...
imports: [
WebRtcModule.forRoot({
AppID: 'agora AppID',
}),
]
...
})
You can get started with Agora by following this guide and retrieve the Appid.
Add WebRtcComponent
to your component template:
<ngx-webrtc
[channel]="channel"
[displaySmallScreen]="true"
[uid]="uid"
[token]="token"
(callEnd)="onCallEnd()"
></ngx-webrtc>
The library allows you to display a video call confirmation dialog.
Inject VideoCallDialogService
into your component/service and call open
method by passing the required data.
It will return a dialog object VideoCallDialog
with an API where you can programmatically close the dialog, accept the call (it will open WebRtcComponent
) and subscribe to the dialog state.
import { VideoCallDialogService, VideoCallDialogData } from 'ngx-webrtc-lib';
constructor(private dialogService: VideoCallDialogService) { }
onDialogOpen(): void {
const dialog = this.dialogService.open({
uid: this.uid,
token: this.token,
channel: this.channelId,
outcome: this.outcome,
remoteUser: this.remoteUser,
localUser: this.localUser,
});
setTimeout(() => dialog.close(), 7000);
dialog.afterConfirmation().subscribe((data: VideoCallDialogData) => console.log(data));
}
Import assets
in your angular.json file
"assets": [
{
"glob": "**/*",
"input": "./node_modules/ngx-webrtc-lib/src/assets/",
"output": "./assets/"
}
],
For the real-life video call confirmation behavior with multiple clients where one declines the call and it immediately reflects on the second client, you need to implement your own custom solution. This is an example of the implementation using web-sockets.
git clone https://github.com/TarasMoskovych/ngx-webrtc.git
cd ngx-webrtc
npm ci
npm start
To use this library, please follow the versioning specified in the following table.
Angular Version | ngx-webrtc-lib Version |
---|---|
12.x | 1.x / 2.x / 3.x |
Name | Description |
---|---|
AppID | The App ID provided by Agora to initialize the Agora SDK. |
debug | Enable debugging for Agora SDK. Default value false |
useVirtualBackground | Enable Agora Virtual Background feature (only the "blur" is currently supported). Default value false |
Name | Description |
---|---|
@Input() uid: string | User identifier. |
@Input() token: string | Agora token for Secure Authentication. Default value null |
@Input() channel: string | Channel identifier. |
@Input() displaySmallScreen: boolean | Display small screen toggle. Default value false |
@Input() remoteUser: User | Represents the remote user in the call. Optional, used for reference or display purposes. |
@Input() localUser: User | Represents the current user in the call. Optional, used for reference or display purposes. |
@Output() callEnd: EventEmitter | Event that is emitted when the call is ended. |
Name | Description |
---|---|
open: (VideoCallDialogData ) => VideoCallDialog | Renders VideoCallComponent in the dialog. |
Name | Description |
---|---|
uid: string | User identifier. |
channel: string | Channel identifier. |
token: string | Agora token for Secure Authentication. Default value null |
outcome: boolean | Defines the UI for incoming or outgoing call modes. |
remoteUser: User | Represents the remote user in the call. It replaces the user field and should be used instead. |
localUser: User | Represents the current user in the call. Optional, used for reference or display purposes. |
Name | Description |
---|---|
acceptCall: () => void | Closes the confirmation dialog and opens WebRtcComponent with passed data before. |
close: () => void | Closes the dialog with video-call confirmation component. |
afterConfirmation: () => Observable<VideoCallDialogData | null>; | Returns Observable with the data depends on accepting or declining the call. |
afterCallEnd: () => Observable; | Returns Observable with the value when the call is ended. |
Name | Description |
---|---|
name: string | The name of the user. |
photoURL: string | The URL of the user's profile photo. |
FAQs
Angular microapp/library for video conference using agora-rtc-sdk-ng.
The npm package ngx-webrtc-lib receives a total of 9 weekly downloads. As such, ngx-webrtc-lib popularity was classified as not popular.
We found that ngx-webrtc-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.