<commit_before>'use strict';

angular.module('webRTC', [])

.service('webRTC', function (songQueue, audio) {

  var audioVar;

	var webrtc = new SimpleWebRTC({

	  localVideoEl: 'localVideo',
	  remoteVideosEl: 'remoteVideos',
	  autoRequestMedia: true,
    // autoRequestMedia: false,
	  // receiveMedia: {
	  //     mandatory: {
	  //         OfferToReceiveAudio: false,
	  //         OfferToReceiveVideo: true
	  //     }
	  // },
    media: {
      video: true,
      audio: false
    }
	  // url: '172.16.31.10:8888'
	});

	webrtc.on('joinedRoom', function () {
    var peers = webrtc.getPeers();
    console.log(peers);
    if(peers.length === 0) {
      setInterval(this.updateTheKids, 5000);
    }
  }.bind(this));

  webrtc.connection.on('message', function(data) {  
    console.log(data);
    if(data.payload && data.payload.type === 'music_status') {
      // console.log(data);

      // console.log('player status: ', data.payload.paused);
      if(!data.payload.paused) {
        audioVar.play();
      } else if(data.payload.paused) {
        audioVar.pause();
      }
      songQueue.setSongQueue(data.payload.songQueue);
      if(audioVar.src !== audio.getTrackURL(data.payload.songQueue[0])) {
        audio.setTrack(data.payload.songQueue[0])<commit_msg>undo back to own  signal server<commit_after>'use strict';

angular.module('webRTC', [])

.service('webRTC', function (songQueue, audio) {

  var audioVar;

	var webrtc = new SimpleWebRTC({

	  localVideoEl: 'localVideo',
	  remoteVideosEl: 'remoteVideos',
	  autoRequestMedia: true,
    // autoRequestMedia: false,
	  // receiveMedia: {
	  //     mandatory: {
	  //         OfferToReceiveAudio: false,
	  //         OfferToReceiveVideo: true
	  //     }
	  // },
    media: {
      video: true,
      audio: false
    },
	  url: '172.16.31.10:8888'
	});

	webrtc.on('joinedRoom', function () {
    var peers = webrtc.getPeers();
    console.log(peers);
    if(peers.length === 0) {
      setInterval(this.updateTheKids, 5000);
    }
  }.bind(this));

  webrtc.connection.on('message', function(data) {  
    console.log(data);
    if(data.payload && data.payload.type === 'music_status') {
      // console.log(data);

      // console.log('player status: ', data.payload.paused);
      if(!data.payload.paused) {
        audioVar.play();
      } else if(data.payload.paused) {
        audioVar.pause();
      }
      songQueue.setSongQueue(data.payload.songQueue);
      if(audioVar.src !== audio.getTrackURL(data.payload.songQueue[0])) {
        audio.setTrack(data.payload.songQueue[0])
{'fraction_non_alphanumeric': 0.1626365054602184, 'fraction_numerical': 0.015600624024960999, 'mean_word_length': 2.643465909090909, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5805519', 'n_tokens_mistral': 948, 'n_tokens_neox': 859, 'n_words': 132}