js/broadcaster.js
// Set H.264 as the default video codec if it's present.
Set H.264 as the default video codec if it's present.
Set H . 264 as the default video codec if it ' s present .
function preferH264(sdp) {
  var sdpLines = sdp.split('\r\n');
  var mLineIndex;
  for (var i = 0; i < sdpLines.length; i++) {
    if (sdpLines[i].search('m=video') !== -1) {
      mLineIndex = i;
      break;
    }
  }
  if (mLineIndex === null) {
    return sdp;
  }
  for (i = 0; i < sdpLines.length; i++) {
    if (sdpLines[i].search('H264/90000') !== -1) {
      var h264Payload = extractSdp(sdpLines[i], /:(\d+) h264\/90000/i);
      if (h264Payload) {
        sdpLines[mLineIndex] = setDefaultCodec(sdpLines[mLineIndex],
        h264Payload);
      }
      break;
    }
  }
  sdpLines = removeCN(sdpLines, mLineIndex);
  sdp = sdpLines.join('\r\n');
  return sdp;
}
function preferH264 ( sdp ) { var sdpLines = sdp . split ( '\r\n' ) ; var mLineIndex ; for ( var i = 0 ; i < sdpLines . length ; i ++ ) { if ( sdpLines [ i ] . search ( 'm=video' ) !== - 1 ) { mLineIndex = i ; break ; } } if ( mLineIndex === null ) { return sdp ; } for ( i = 0 ; i < sdpLines . length ; i ++ ) { if ( sdpLines [ i ] . search ( 'H264/90000' ) !== - 1 ) { var h264Payload = extractSdp ( sdpLines [ i ] , / :(\d+) h264\/90000 / i ) ; if ( h264Payload ) { sdpLines [ mLineIndex ] = setDefaultCodec ( sdpLines [ mLineIndex ] , h264Payload ) ; } break ; } } sdpLines = removeCN ( sdpLines , mLineIndex ) ; sdp = sdpLines . join ( '\r\n' ) ; return sdp ; }
Set H.264 as the default video codec if it's present.
Set H . 264 as the default video codec if it ' s present .
// Search for m line. // If h264 is available, set it as the default in m line. // Remove CN in m line and sdp.