nttcom / peerjs

[Deprecated] This branch is a customized version of PeerJS for NTT Communications's WebRTC platform SkyWay.
http://nttcom.github.io/skyway/en/
Other
225 stars 91 forks source link

peer.js doesn't work in FF40. #36

Closed KensakuKOMATSU closed 9 years ago

KensakuKOMATSU commented 9 years ago

console shows that createOffer failed cause pc (peerconncetion object) is undefined.

KensakuKOMATSU commented 9 years ago

current sequence is

Negotiator.startConnection = function(connection, options) {
  var pc = Negotiator._getPeerConnection(connection, options);

  if (connection.type === 'media' && options._stream) {
    // Add the stream.
    pc.addStream(options._stream);
  }

  // Set the connection's PC.
  connection.pc = connection.peerConnection = pc;

however, from FF40 negotiationneeded event immidiately fired when addStream called. before putting pc into connection object. Then,

Negotiator._makeOffer = function(connection) {
  var pc = connection.pc;

  if(!!pc.remoteDescription && !!pc.remoteDescription.type) return;

  pc.createOffer(function(offer) {

createOffer was called while connection.pc equal undefined.

KensakuKOMATSU commented 9 years ago

So, exchanging the line shown below will be work well.

Negotiator.startConnection = function(connection, options) {
  var pc = Negotiator._getPeerConnection(connection, options);

  // Set the connection's PC.
  connection.pc = connection.peerConnection = pc;

  if (connection.type === 'media' && options._stream) {
    // Add the stream.
    pc.addStream(options._stream);
  }
KensakuKOMATSU commented 9 years ago

screen shot 2015-08-18 at 10 29 58 am

KensakuKOMATSU commented 9 years ago

Video stream properly transferred. However, below alert shown.

Cannot set local offer in state have-remote-offer
KensakuKOMATSU commented 9 years ago

browser conditions shown below are tested with example/videochat/index.html and example/chat.html

FF40 <---> FF40
FF40 <---> Chrome44
Chrome44 <---> FF40
whatvn commented 9 years ago

+1