I am using Angular 7
with Angora.Io
, My problem is when I run my Angular project locally then I successfully get access to my camera and microphone but when I try to run globally like "192.105.2.448" then I don't get access to my camera and microphone and an error like this is thrown. Please help me!
join(): void {
this.client.setClientRole('host');
this.localStream = this.agoraService.createStream({ streamID: this.uid, audio: true, video: true, screen: false });
this.localStream.setVideoProfile('720p_3');
this.assignLocalStreamHandlers();
this.init();
this.client.join(null , this.channel.value, this.uid);
}
publish(): void {
this.liveplay = true;
this.client.publish(this.localStream, err => console.log('Publish local stream error: ' + err)); }
protected init(): void {
this.localStream.init(
() => {
// The user has granted access to the camera and mic.
console.log('getUserMedia successfully' , this.localStream);
this.localStream.play('agora_local');
this.connected = true;
},
err => console.log('getUserMedia failed', err)
);
}
private assignLocalStreamHandlers(): void {
console.log('==========>>>>>>>2 ');
this.localStream.on(StreamEvent.MediaAccessAllowed, () => {
console.log('accessAllowed --->>> ', this.localStream);
});
// The user has denied access to the camera and mic.
this.localStream.on(StreamEvent.MediaAccessDenied, () => {
console.log('accessDenied');
});
}
11:35:01:76 Agora-SDK [ERROR]: [3] Media access NOT_SUPPORTED: Only secure origins are allowed
[Deprecation] getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS.