mirror of https://github.com/OpenVidu/openvidu.git
'dataChannel' deprecated leftovers removed
parent
42ea1e7ed4
commit
28a44723e3
|
@ -203,9 +203,9 @@ function WebRtcPeer(mode, options, callback) {
|
|||
var pc = options.peerConnection
|
||||
var sendSource = options.sendSource || 'webcam'
|
||||
|
||||
var dataChannelConfig = options.dataChannelConfig
|
||||
/*var dataChannelConfig = options.dataChannelConfig
|
||||
var useDataChannels = options.dataChannels || false
|
||||
var dataChannel
|
||||
var dataChannel*/
|
||||
|
||||
var guid = uuid.v4()
|
||||
var configuration = recursive({
|
||||
|
@ -251,11 +251,11 @@ function WebRtcPeer(mode, options, callback) {
|
|||
}
|
||||
},
|
||||
|
||||
'dataChannel': {
|
||||
/*'dataChannel': {
|
||||
get: function () {
|
||||
return dataChannel
|
||||
}
|
||||
},
|
||||
},*/
|
||||
|
||||
/**
|
||||
* @member {(external:ImageData|undefined)} currentFrame
|
||||
|
@ -283,7 +283,7 @@ function WebRtcPeer(mode, options, callback) {
|
|||
// Init PeerConnection
|
||||
if (!pc) {
|
||||
pc = new RTCPeerConnection(configuration);
|
||||
if (useDataChannels && !dataChannel) {
|
||||
/*if (useDataChannels && !dataChannel) {
|
||||
var dcId = 'WebRtcPeer-' + self.id
|
||||
var dcOptions = undefined
|
||||
if (dataChannelConfig) {
|
||||
|
@ -298,7 +298,7 @@ function WebRtcPeer(mode, options, callback) {
|
|||
dataChannel.onbufferedamountlow = dataChannelConfig.onbufferedamountlow;
|
||||
dataChannel.onerror = dataChannelConfig.onerror || noop;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
pc.addEventListener('icecandidate', function (event) {
|
||||
|
@ -438,14 +438,14 @@ function WebRtcPeer(mode, options, callback) {
|
|||
localVideo.muted = true
|
||||
}
|
||||
|
||||
this.send = function (data) {
|
||||
/*this.send = function (data) {
|
||||
if (dataChannel && dataChannel.readyState === 'open') {
|
||||
dataChannel.send(data)
|
||||
} else {
|
||||
logger.warn(
|
||||
'Trying to send data over a non-existing or closed data channel')
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Callback function invoked when a SDP answer is received. Developers are
|
||||
|
@ -706,13 +706,13 @@ WebRtcPeer.prototype.dispose = function () {
|
|||
logger.debug('Disposing WebRtcPeer')
|
||||
|
||||
var pc = this.peerConnection
|
||||
var dc = this.dataChannel
|
||||
//var dc = this.dataChannel
|
||||
try {
|
||||
if (dc) {
|
||||
/*if (dc) {
|
||||
if (dc.signalingState === 'closed') return
|
||||
|
||||
dc.close()
|
||||
}
|
||||
}*/
|
||||
|
||||
if (pc) {
|
||||
if (pc.signalingState === 'closed') return
|
||||
|
|
|
@ -72,7 +72,6 @@ export class OpenVidu {
|
|||
sendVideo: cameraOptions.video != null ? cameraOptions.video : true,
|
||||
activeAudio: cameraOptions.audioActive != null ? cameraOptions.audioActive : true,
|
||||
activeVideo: cameraOptions.videoActive != null ? cameraOptions.videoActive : true,
|
||||
dataChannel: true,
|
||||
mediaConstraints: this.openVidu.generateMediaConstraints(cameraOptions)
|
||||
};
|
||||
cameraOptions = cameraOptionsAux;
|
||||
|
@ -94,7 +93,6 @@ export class OpenVidu {
|
|||
sendVideo: cameraOptions.video,
|
||||
activeAudio: cameraOptions.audioActive != null ? cameraOptions.audioActive : true,
|
||||
activeVideo: cameraOptions.videoActive != null ? cameraOptions.videoActive : true,
|
||||
dataChannel: true,
|
||||
mediaConstraints: {
|
||||
video: screenConstraints.video,
|
||||
audio: false
|
||||
|
@ -152,7 +150,6 @@ export class OpenVidu {
|
|||
sendVideo: cameraOptions.video != null ? cameraOptions.video : true,
|
||||
activeAudio: cameraOptions.audioActive != null ? cameraOptions.audioActive : true,
|
||||
activeVideo: cameraOptions.videoActive != null ? cameraOptions.videoActive : true,
|
||||
dataChannel: true,
|
||||
mediaConstraints: {
|
||||
video: screenConstraints.video,
|
||||
audio: false
|
||||
|
@ -179,7 +176,6 @@ export class OpenVidu {
|
|||
sendVideo: true,
|
||||
activeAudio: true,
|
||||
activeVideo: true,
|
||||
dataChannel: true,
|
||||
mediaConstraints: {
|
||||
audio: true,
|
||||
video: { width: { ideal: 1280 } }
|
||||
|
|
|
@ -49,7 +49,6 @@ export class OpenViduInternal {
|
|||
sendVideo: true,
|
||||
activeAudio: true,
|
||||
activeVideo: true,
|
||||
dataChannel: true,
|
||||
mediaConstraints: {
|
||||
audio: true,
|
||||
video: { width: { ideal: 1280 } }
|
||||
|
|
|
@ -126,14 +126,6 @@ export class SessionInternal {
|
|||
metadata: this.options.metadata,
|
||||
secret: this.openVidu.getSecret(),
|
||||
recorder: this.openVidu.getRecorder(),
|
||||
dataChannels: false
|
||||
}
|
||||
|
||||
if (this.localParticipant) {
|
||||
if (Object.keys(this.localParticipant.getStreams()).some(streamId =>
|
||||
this.remoteStreams[streamId].isDataChannelEnabled())) {
|
||||
joinParams.dataChannels = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.openVidu.sendRequest('joinRoom', joinParams, (error, response) => {
|
||||
|
|
|
@ -52,7 +52,6 @@ export interface InboundStreamOptions {
|
|||
export interface OutboundStreamOptions {
|
||||
activeAudio: boolean;
|
||||
activeVideo: boolean;
|
||||
dataChannel: boolean;
|
||||
mediaConstraints: any;
|
||||
sendAudio: boolean;
|
||||
sendVideo: boolean;
|
||||
|
@ -74,7 +73,6 @@ export class Stream {
|
|||
private showMyRemote = false;
|
||||
private localMirrored = false;
|
||||
private chanId = 0;
|
||||
private dataChannelOpened = false;
|
||||
|
||||
inboundOptions: InboundStreamOptions;
|
||||
outboundOptions: OutboundStreamOptions;
|
||||
|
@ -196,37 +194,6 @@ export class Stream {
|
|||
return this.streamId + '_' + this.chanId++;
|
||||
}
|
||||
|
||||
|
||||
isDataChannelEnabled() {
|
||||
return this.outboundOptions.dataChannel;
|
||||
}
|
||||
|
||||
|
||||
isDataChannelOpened() {
|
||||
return this.dataChannelOpened;
|
||||
}
|
||||
|
||||
onDataChannelOpen(event) {
|
||||
console.debug('Data channel is opened');
|
||||
this.dataChannelOpened = true;
|
||||
}
|
||||
|
||||
onDataChannelClosed(event) {
|
||||
console.debug('Data channel is closed');
|
||||
this.dataChannelOpened = false;
|
||||
}
|
||||
|
||||
sendData(data) {
|
||||
if (this.wp === undefined) {
|
||||
throw new Error('WebRTC peer has not been created yet');
|
||||
}
|
||||
if (!this.dataChannelOpened) {
|
||||
throw new Error('Data channel is not opened');
|
||||
}
|
||||
console.info("Sending through data channel: " + data);
|
||||
this.wp.send(data);
|
||||
}
|
||||
|
||||
getMediaStream() {
|
||||
return this.mediaStream;
|
||||
}
|
||||
|
@ -490,15 +457,6 @@ export class Stream {
|
|||
onicecandidate: this.connection.sendIceCandidate.bind(this.connection),
|
||||
}
|
||||
|
||||
if (this.outboundOptions.dataChannel) {
|
||||
options.dataChannelConfig = {
|
||||
id: this.getChannelName(),
|
||||
onopen: this.onDataChannelOpen,
|
||||
onclose: this.onDataChannelClosed
|
||||
};
|
||||
options.dataChannels = true;
|
||||
}
|
||||
|
||||
if (this.displayMyRemote()) {
|
||||
this.wp = kurentoUtils.WebRtcPeer.WebRtcPeerSendrecv(options, error => {
|
||||
if (error) {
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
package io.openvidu.client;
|
||||
|
||||
import static io.openvidu.client.internal.ProtocolElements.CUSTOMREQUEST_METHOD;
|
||||
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_DATACHANNELS_PARAM;
|
||||
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_METHOD;
|
||||
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_PEERID_PARAM;
|
||||
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_PEERSTREAMID_PARAM;
|
||||
|
@ -121,14 +120,13 @@ public class OpenViduClient {
|
|||
this.client.close();
|
||||
}
|
||||
|
||||
public Map<String, List<String>> joinRoom(String roomName, String userName, Boolean dataChannels)
|
||||
public Map<String, List<String>> joinRoom(String roomName, String userName)
|
||||
throws IOException {
|
||||
|
||||
JsonObject params = new JsonObject();
|
||||
params.addProperty(JOINROOM_ROOM_PARAM, roomName);
|
||||
params.addProperty(JOINROOM_USER_PARAM, userName);
|
||||
if (dataChannels != null) {
|
||||
params.addProperty(JOINROOM_DATACHANNELS_PARAM, dataChannels);
|
||||
}
|
||||
|
||||
JsonElement result = client.sendRequest(JOINROOM_METHOD, params);
|
||||
Map<String, List<String>> peers = new HashMap<String, List<String>>();
|
||||
JsonArray jsonPeers = JsonRoomUtils.getResponseProperty(result, "value", JsonArray.class);
|
||||
|
|
|
@ -38,7 +38,6 @@ public class ProtocolElements {
|
|||
public static final String JOINROOM_SECRET_PARAM = "secret";
|
||||
public static final String JOINROOM_RECORDER_PARAM = "recorder";
|
||||
|
||||
public static final String JOINROOM_DATACHANNELS_PARAM = "dataChannels";
|
||||
public static final String JOINROOM_PEERID_PARAM = "id";
|
||||
public static final String JOINROOM_PEERSTREAMS_PARAM = "streams";
|
||||
public static final String JOINROOM_PEERSTREAMID_PARAM = "id";
|
||||
|
|
|
@ -35,7 +35,6 @@ public class KurentoParticipant extends Participant {
|
|||
|
||||
private InfoHandler infoHandler;
|
||||
|
||||
private boolean dataChannels = false;
|
||||
private boolean webParticipant = true;
|
||||
|
||||
private final KurentoSession session;
|
||||
|
@ -52,7 +51,7 @@ public class KurentoParticipant extends Participant {
|
|||
participant.getClientMetadata());
|
||||
this.session = kurentoSession;
|
||||
this.pipeline = pipeline;
|
||||
this.publisher = new PublisherEndpoint(webParticipant, dataChannels, this, participant.getParticipantPublicId(),
|
||||
this.publisher = new PublisherEndpoint(webParticipant, this, participant.getParticipantPublicId(),
|
||||
pipeline);
|
||||
|
||||
for (Participant other : session.getParticipants()) {
|
||||
|
@ -199,7 +198,7 @@ public class KurentoParticipant extends Participant {
|
|||
log.info("PARTICIPANT {}: unpublishing media stream from room {}", this.getParticipantPublicId(),
|
||||
this.session.getSessionId());
|
||||
releasePublisherEndpoint();
|
||||
this.publisher = new PublisherEndpoint(webParticipant, dataChannels, this, this.getParticipantPublicId(),
|
||||
this.publisher = new PublisherEndpoint(webParticipant, this, this.getParticipantPublicId(),
|
||||
pipeline);
|
||||
log.info(
|
||||
"PARTICIPANT {}: released publisher endpoint and left it initialized (ready for future streaming)",
|
||||
|
|
|
@ -53,7 +53,6 @@ public abstract class MediaEndpoint {
|
|||
private static Logger log;
|
||||
|
||||
private boolean web = false;
|
||||
private boolean dataChannels = false;
|
||||
|
||||
private WebRtcEndpoint webEndpoint = null;
|
||||
private RtpEndpoint endpoint = null;
|
||||
|
@ -75,13 +74,12 @@ public abstract class MediaEndpoint {
|
|||
* Constructor to set the owner, the endpoint's name and the media pipeline.
|
||||
*
|
||||
* @param web
|
||||
* @param dataChannels
|
||||
* @param owner
|
||||
* @param endpointName
|
||||
* @param pipeline
|
||||
* @param log
|
||||
*/
|
||||
public MediaEndpoint(boolean web, boolean dataChannels, KurentoParticipant owner, String endpointName,
|
||||
public MediaEndpoint(boolean web, KurentoParticipant owner, String endpointName,
|
||||
MediaPipeline pipeline, Logger log) {
|
||||
if (log == null) {
|
||||
MediaEndpoint.log = LoggerFactory.getLogger(MediaEndpoint.class);
|
||||
|
@ -89,7 +87,6 @@ public abstract class MediaEndpoint {
|
|||
MediaEndpoint.log = log;
|
||||
}
|
||||
this.web = web;
|
||||
this.dataChannels = dataChannels;
|
||||
this.owner = owner;
|
||||
this.setEndpointName(endpointName);
|
||||
this.setMediaPipeline(pipeline);
|
||||
|
@ -244,9 +241,9 @@ public abstract class MediaEndpoint {
|
|||
protected void internalEndpointInitialization(final CountDownLatch endpointLatch) {
|
||||
if (this.isWeb()) {
|
||||
WebRtcEndpoint.Builder builder = new WebRtcEndpoint.Builder(pipeline);
|
||||
if (this.dataChannels) {
|
||||
/*if (this.dataChannels) {
|
||||
builder.useDataChannels();
|
||||
}
|
||||
}*/
|
||||
builder.buildAsync(new Continuation<WebRtcEndpoint>() {
|
||||
@Override
|
||||
public void onSuccess(WebRtcEndpoint result) throws Exception {
|
||||
|
|
|
@ -55,9 +55,9 @@ public class PublisherEndpoint extends MediaEndpoint {
|
|||
private Map<String, ListenerSubscription> elementsErrorSubscriptions =
|
||||
new HashMap<String, ListenerSubscription>();
|
||||
|
||||
public PublisherEndpoint(boolean web, boolean dataChannels, KurentoParticipant owner,
|
||||
public PublisherEndpoint(boolean web, KurentoParticipant owner,
|
||||
String endpointName, MediaPipeline pipeline) {
|
||||
super(web, dataChannels, owner, endpointName, pipeline, log);
|
||||
super(web, owner, endpointName, pipeline, log);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,7 @@ public class SubscriberEndpoint extends MediaEndpoint {
|
|||
|
||||
public SubscriberEndpoint(boolean web, KurentoParticipant owner, String endpointName,
|
||||
MediaPipeline pipeline) {
|
||||
super(web, false, owner, endpointName, pipeline, log);
|
||||
super(web, owner, endpointName, pipeline, log);
|
||||
}
|
||||
|
||||
public synchronized String subscribe(String sdpOffer, PublisherEndpoint publisher) {
|
||||
|
|
Loading…
Reference in New Issue