Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions demo/app/standard/standard-vm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
TNSRTCPeerConnection,
TNSRTCSdpType,
TNSRTCSessionDescription,
WebRTC
WebRTC,
TNSRTCIceServer,
TNSRTCConfiguration
} from 'nativescript-webrtc-plugin';

export class StandardViewModel extends Observable {
Expand All @@ -27,7 +29,13 @@ export class StandardViewModel extends Observable {

constructor() {
super();
this.connection = new TNSRTCPeerConnection();
const config = new TNSRTCConfiguration({
iceServers: [
new TNSRTCIceServer(['stun:stun.l.google.com:19302']),
new TNSRTCIceServer(['stun:stun1.l.google.com:19302']),
]
})
this.connection = new TNSRTCPeerConnection(config);
this.connection.onIceCandidate(candidate => {
const object = {};
object['from'] = this.me;
Expand All @@ -43,7 +51,7 @@ export class StandardViewModel extends Observable {
}
});
this.me = this.generateId();
this.socket = new SocketIO('http://192.168.0.10:3001', {
this.socket = new SocketIO('http://192.168.0.15:3001', {
forceNew: true,
secure: false
});
Expand Down Expand Up @@ -128,7 +136,7 @@ export class StandardViewModel extends Observable {
}
});
} else {
this.setUpUserMedia();
this.setUpUserMedia();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-webrtc-plugin",
"version": "2.0.0-alpha.21",
"version": "2.0.0-alpha.22",
"description": "WebRTC for NativeScript",
"main": "webrtc",
"typings": "index.d.ts",
Expand Down
Binary file modified src/platforms/android/fancywebrtc-release.aar
Binary file not shown.
9 changes: 7 additions & 2 deletions src/src/android/TNSRTCIceServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ export class TNSRTCIceServer extends TNSRTCIceServerBase {

constructor(urls: Array<string>, username?: string, credential?: string) {
super(urls, username, credential);
const array = Array.create('java.lang.String', urls.length);
const length = urls.length;
for(let i = 0; i < length;i++){
array[i] = urls[i];
}
if (urls && !username && !credential) {
this.server = new co.fitcom.fancywebrtc.FancyRTCIceServer(urls as any);
this.server = new co.fitcom.fancywebrtc.FancyRTCIceServer(array);
} else {
this.server = new co.fitcom.fancywebrtc.FancyRTCIceServer(urls as any, username, credential);
this.server = new co.fitcom.fancywebrtc.FancyRTCIceServer(array, username, credential);
}

}
Expand Down
30 changes: 15 additions & 15 deletions src/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ declare class TNSRTCTrackEventBase {
/* Base */

export declare class TNSRTCAudioTrack extends TNSRTCMediaStreamTrack {
protected _audioTrack;
private _audioTrack;

constructor(track: any);

Expand All @@ -220,7 +220,7 @@ export declare class TNSRTCAudioTrack extends TNSRTCMediaStreamTrack {
}

export declare class TNSRTCConfiguration extends TNSRTCConfigurationBase {
protected _configuration;
_configuration;

constructor(options?: TNSRTCConfigurationOptions);

Expand All @@ -230,7 +230,7 @@ export declare class TNSRTCConfiguration extends TNSRTCConfigurationBase {
}

export declare class TNSRTCDataChannel extends TNSRTCDataChannelBase {
protected _channel;
private _channel;

protected constructor();

Expand All @@ -242,7 +242,7 @@ export declare class TNSRTCDataChannel extends TNSRTCDataChannelBase {
}

export declare class TNSRTCDataChannelEvent extends TNSRTCDataChannelEventBase {
protected _event;
private _event;

constructor(event: any);

Expand All @@ -252,7 +252,7 @@ export declare class TNSRTCDataChannelEvent extends TNSRTCDataChannelEventBase {
}

export declare class TNSRTCDTMFSender extends TNSRTCDTMFSenderBase {
protected _sender;
private _sender;

protected constructor();

Expand Down Expand Up @@ -310,7 +310,7 @@ export declare class TNSRTCMediaDevices {
}

export declare class TNSRTCMediaStream extends TNSRTCMediaStreamBase {
protected _stream;
private _stream;

protected constructor();

Expand All @@ -331,7 +331,7 @@ export declare class TNSRTCMediaStream extends TNSRTCMediaStreamBase {
}

declare class TNSRTCMediaStreamConstraints extends TNSRTCMediaStreamConstraintsBase {
protected _mediaStreamConstraints;
private _mediaStreamConstraints;

constructor(audio: any, video: any);

Expand All @@ -342,7 +342,7 @@ declare class TNSRTCMediaStreamConstraints extends TNSRTCMediaStreamConstraintsB


export declare class TNSRTCMediaStreamTrack extends TNSRTCMediaStreamTrackBase {
protected _mediaStreamTrack;
private _mediaStreamTrack;

constructor(mediaStreamTrack: any);

Expand Down Expand Up @@ -418,7 +418,7 @@ export declare class TNSRTCPeerConnection {
}

export declare class TNSRTCRtpParameters extends TNSRTCRtpParametersBase {
protected _parameters;
private _parameters;

protected constructor();

Expand All @@ -431,7 +431,7 @@ export declare class TNSRTCRtpParameters extends TNSRTCRtpParametersBase {


export declare class TNSRTCRtpReceiver extends TNSRTCRtpReceiverBase {
protected _receiver;
private _receiver;

protected constructor();

Expand All @@ -444,7 +444,7 @@ export declare class TNSRTCRtpReceiver extends TNSRTCRtpReceiverBase {


export declare class TNSRTCRtpSender extends TNSRTCRtpSenderBase {
protected _sender;
private _sender;

protected constructor();

Expand All @@ -466,7 +466,7 @@ export declare class TNSRTCRtpSender extends TNSRTCRtpSenderBase {


export declare class TNSRTCRtpTransceiver extends TNSRTCRtpTransceiverBase {
protected _transceiver;
private _transceiver;

protected constructor();

Expand Down Expand Up @@ -494,7 +494,7 @@ export declare enum TNSRTCSdpType {


export declare class TNSRTCSessionDescription {
protected _sessionDescription;
private _sessionDescription;

constructor(...args: any[]);

Expand All @@ -512,7 +512,7 @@ export declare class TNSRTCSessionDescription {


export declare class TNSRTCTrackEvent extends TNSRTCTrackEventBase {
protected _event;
private _event;

constructor(event: any);

Expand All @@ -526,7 +526,7 @@ export declare class TNSRTCTrackEvent extends TNSRTCTrackEventBase {


export declare class TNSRTCVideoTrack extends TNSRTCMediaStreamTrack {
protected _videoTrack;
private _videoTrack;

constructor(track: any);

Expand Down