Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. console.log("Play!");
  2. const player = this.player;
  3.  
  4. //create Peer connection object
  5. let conf = {
  6. iceServers : player.iceServers,
  7. rtcpMuxPolicy : "require",
  8. bundlePolicy: "max-bundle"
  9. };
  10.  
  11. const peerConnection = new RTCPeerConnection(conf);
  12. //Listen for track once it starts playing.
  13. peerConnection.ontrack = function(event) {
  14. //Play it
  15. console.log('connected');
  16. let vidWin = player.playbackElementVideo;
  17. if(vidWin) {
  18. vidWin.srcObject = event.streams[0];
  19. vidWin.autoplay = true;
  20. vidWin.controls = false;
  21. vidWin.setAttribute('playsinline', true);
  22. }
  23. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement