Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log("Play!");
- const player = this.player;
- //create Peer connection object
- let conf = {
- iceServers : player.iceServers,
- rtcpMuxPolicy : "require",
- bundlePolicy: "max-bundle"
- };
- const peerConnection = new RTCPeerConnection(conf);
- //Listen for track once it starts playing.
- peerConnection.ontrack = function(event) {
- //Play it
- console.log('connected');
- let vidWin = player.playbackElementVideo;
- if(vidWin) {
- vidWin.srcObject = event.streams[0];
- vidWin.autoplay = true;
- vidWin.controls = false;
- vidWin.setAttribute('playsinline', true);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement