Skip to content

Instantly share code, notes, and snippets.

View deviantfero's full-sized avatar

Fernando Vásquez deviantfero

  • Santa Tecla, El Salvador
View GitHub Profile
$ turnserver -avn -u user:password -r yourdomain.com
# “a” use long-term credentials, “v” verbose output, “n” do not load a configuration file.
# "u" Specify user and password credentials to be used.
# "r" Specify default realm, can be your domain.
# to check if coturn is running you can run
$ netstat -lnp | grep 3478
# to run this setup, you will need node.js, npm and bower
# node version 8.2.1 was used to run this demo
# you will need your own Kurento media server instance and TURN/STUN
# a docker-compose.yml is provided to make this easier
git clone https://github.com/agilityfeat/kurento-recording-test
cd ./kurento-recording-test
npm install
cd ./static
//replace your turn/stun here
options.configuration = {
iceServers: [{"urls":"stun:stun.l.google.com:19302"}, {
"urls" : "turn:111.222.333.444", "username":"user", "credential":"pass"}]
};
# for this particular step, you will need
# docker installed. we recommend using another
# directory instead of /tmp
docker run --name kurento_docker \
-p 8888:888 \
-e KMS_STUN_IP='stun ip goes here' \
-e KMS_STUN_PORT='stun port goes here' \
-e KMS_TURN_URL='turn-url goes here, with credentials' \
-v /tmp:/tmp \
export KURENTO_URL=ws://your-kurento-instance-domain.com:port/kurento
npm run server
# in ubuntu versions above 14.04 coturn is already on the base repositories
echo "deb http://ftp.us.debian.org/debian jessie main" >> /etc/apt/sources.list
gpg --keyserver pgpkeys.mit.edu --recv-key 8B48AD6246925553
gpg -a --export 8B48AD6246925553 | apt-key add -
gpg --keyserver pgpkeys.mit.edu --recv-key 7638D0442B90D010
gpg -a --export 7638D0442B90D010 | apt-key add -
apt-get update
import { Server } from 'ws';
import { createServer } from 'http';
import Roulette from './roulette';
const wss = new Server({ port: 8000 });
const mm = new Roulette();
wss.on('connection', ws => {
mm.register(ws);
});
export default class Roulette {
private sessions : Map<string, Session>;
private unmatched : Set<string>;
constructor() {
   this.sessions = new Map();
this.unmatched = new Set();
}
type MatchMessage = {
type: MessageType.MATCHED
match: string
offer: boolean
}
type SDPMessage = {
type: MessageType.SDP
sdp: string
}
setContentView(R.layout.activity_video_call)
statusTextView = findViewById(R.id.status_text)
localVideoView = findViewById(R.id.pip_video)
remoteVideoView = findViewById(R.id.remote_video)
val hangup : ImageButton = findViewById(R.id.hangup_button)
hangup.setOnClickListener {
finish()
}