The member MediaManager during initialization of WebRTCAdaptor is null.
When i compare my files from npm to the ones provided with the default viewer, some guard have been added. I think that your npm package have not been updated with the most recent changes.
Do you you have a simple solution or should I import all the files manually from the one provided with the default installation ?
npm source on the left, ant media installation on the right.
Question
ThibaultOber
Hello,
I am currently trying to configure a basic player using Angular.
this is what the source code looks like:
import { Component, OnInit } from '@angular/core'; import { WebRTCAdaptor } from '@antmedia/webrtc_adaptor'; @Component({ selector: 'app-player', templateUrl: './player.component.html', styleUrls: ['./player.component.css'] }) export class PlayerComponent implements OnInit { constructor() { } private websocketURL = "ws://myserver:5080/LiveApp/websocket"; private streamId = "test"; private webRTCAdaptor : any; private mediaConstraints = { video : false, audio : false }; private pc_config = { 'iceServers' : [ { 'urls' : 'stun:stun1.l.google.com:19302' } ] }; private sdpConstraints = { OfferToReceiveAudio : true, OfferToReceiveVideo : false }; ngOnInit(): void { this.createStream(); } createStream() : void { var adaptor = new WebRTCAdaptor(); this.webRTCAdaptor = new WebRTCAdaptor({ websocket_url : this.websocketURL, mediaConstraints : this.mediaConstraints, peerconnection_config : this.pc_config, sdp_constraints : this.sdpConstraints, remoteVideoId : "myRemoteVideo", isPlayMode : true, callback : (info : string, obj : any) => { if (info == "initialized") { console.log("initialized"); } else if (info == "play_started") { console.log("play started"); } else if (info == "play_finished") { console.log("play finished"); } else { console.log( info + " notification received"); } }, callbackError : function(error : string, message : string) { alert("error callback: " + JSON.stringify(error)); } }); this.startPlaying(); } startPlaying() : void { this.webRTCAdaptor.play(this.streamId, "", "", [], "", ""); } stopPlaying() : void { this.webRTCAdaptor.stop(this.streamId); } }
I have the following error:
The member MediaManager during initialization of WebRTCAdaptor is null.
When i compare my files from npm to the ones provided with the default viewer, some guard have been added. I think that your npm package have not been updated with the most recent changes.
Do you you have a simple solution or should I import all the files manually from the one provided with the default installation ?
npm source on the left, ant media installation on the right.
Thank you
Link to comment
Share on other sites
Top Posters For This Question
2
2
1
Popular Days
Oct 26
3
Oct 27
2
Top Posters For This Question
rahul7827 2 posts
ThibaultOber 2 posts
Yash 1 post
Popular Days
Oct 26 2022
3 posts
Oct 27 2022
2 posts
Popular Posts
Yash
Hi @ThibaultOber I hope you are fine. Yes, you are correct. There is a known issue with the npm package, and the development team is working on it. Please see the following Git Hub issue, as wel
rahul7827
It's my bad, I misunderstood you are only playing not publishing.
Posted Images
4 answers to this question
Recommended Posts