- It is a repository of uniquely experimented WebRTC demos; written by Muaz Khan!
- No special requirement! Just WebRTC compatible web-browser (e.g. chrome/firefox/opera on desktop/android)
- These demos/experiments are entirely client-side; i.e. no server installation needed!
- You can use all these demos in PHP/Python/Ruby/ASP.NET/etc. everywhere!
How to use?
Each demo has a unique directory. Simply download that directory, upload in your webserver and use it; and it'll work!
You don't need to modify any single line to use it. No single installation or modification is needed :)
Libraries
Library Name | Short Description | Doc | Demos |
RecordRTC.js |
Supports cross-browser audio/video recordings! |
Doc |
Demos |
Translator.js |
Voice & Text Translator |
Doc |
Demos |
RTCMultiConnection.js |
Single Library for Everything! Just imagine :) |
Doc |
Demos |
FileBufferReader.js |
File buffers reader & chunkifier |
Doc |
Demos |
getScreenId.js |
Single chrome extension for all domains! Again, imagine :) |
Doc |
Demos |
Conversation.js |
Enjoy Skype-like Conversations! Oops :) |
Doc |
Demos |
DataChannel.js |
Supports data-streaming among multiple peers |
Doc |
Demos |
getMediaElement.js |
A library for audio/video media elements' layout |
Doc |
Demos |
DetectRTC.js |
A library for detecting WebRTC features |
Doc |
Demos |
ConcatenateBlobs.js |
Concatenate Array of Blobs |
Doc |
Demos |
getStats.js |
Get peers statistics |
Doc |
None |
Other libraries:
Other Repositories
- WebRTC Scalable Broadcast
- Reliable Signaling
- RTCMultiConnection.js
- RecordRTC.js
- Collaborate Canvas Designer
- Translator.js
- FileBufferReader.js
- Chrome-Extensions
- Firefox-Extensions
- DetectRTC.js
- getStats.js
- Conversation.js
- Ffmpeg.js
- DataChannel.js
- MultiRTC Demos
- XHR-Signaling
- PluginRTC: IE/Safari Plugins compatible WebRTC-Experiments
- ASP.NET MVC based WebRTC 1:1 Demo
- WebSync Signaling
- SdpSerializer.js
Experiment Name | Short Description | Source | Demo |
Pre-recorded Media Streaming |
Stream video files in realtime; same like webcam streaming! |
Source |
Demo |
Part of Screen Sharing |
Share a region of the screen; not the entire screen! |
Source |
Demo |
Plugin-free Screen Sharing |
Share the entire screen |
Source |
Demo |
One-Way Broadcasting |
Same like radio stations; transmit audio/video/screen streams in one-way direction. Though, it is browser-to-browser streaming! |
Source |
Demo |
- desktopCapture API / Install App Store Extension
- tabCapture API / Install App Store Extension
- Desktop Sharing / Install App Store Extension
- File Sharing / Install App Store Extension
- enable-screen-capturing
One-to-Many style of WebRTC Experiments
One-to-One Calls
Experiment Name | Demo | Source Code |
One-to-one WebRTC video chat using WebSocket |
Demo |
Source |
One-to-one WebRTC video chat using socket.io |
Demo |
Source |
WebRTC 1-1 Audio/Video/Screen Sharing |
Source |
Demo |
WebRTC 1-1 Calls |
Source |
Demo |
Single-Page / One-Page / Client Side
Experiment Name | Demo | Source Code |
Switch streams from screen-sharing to audio+video. (Renegotiation) |
Demo |
Source |
Share screen and audio/video from single peer connection! |
Demo |
Source |
Text chat using RTCDataChannel APIs |
Demo |
Source |
Simple video chat |
Demo |
Source |
Sharing video - using socket.io for signaling |
Demo |
Source |
Sharing video - using WebSockets for signaling |
Demo |
Source |
Audio Only Streaming |
Demo |
Source |
MediaStreamTrack.getSources |
Demo |
Source |
Experiments to share tab/screen/desktop
Experiment Name | Previous Demos | New Demos |
Plugin-free screen sharing / share the entire screen |
Demo / Source |
Demo / Source Code |
Desktop sharing / using desktopCapture APIs |
Demo / Source |
-- |
Tab sharing / using tabCapture APIs |
Demo / Source |
-- |
Experiment Name | Demo | Source Code |
Share part-of-screen RTCMultiConnection |
Demo |
Source |
Share part-of-screen using RTCDataChannel APIs |
Demo |
Source |
Share part-of-screen using Firebase |
Demo |
Source |
A realtime chat using RTCDataChannel |
Demo |
Source |
A realtime chat using Firebase |
Demo |
Source |
Or RecordRTC entire Meeting using MediaStreamRecorder.js
Experiment Name | Demo | Source Code |
DataChannel basic demo |
Demo |
Source |
Auto Session Establishment |
Demo |
Source |
Share part-of-screen using DataChannel.js |
Demo |
Source |
Private Chat |
Demo |
---- |
Text Chat using Pusher and DataChannel.js |
Demo |
Source |
Experimental (Non-Functional)
Experiment Name | Demo | Source Code |
Attaching Remote Audio Streams |
Demo |
Source |
mozCaptureStreamUntilEnded for pre-recorded media streaming |
Demo |
Source |
Remote audio stream recording |
Demo |
Source |
- AndroidRTC
- Search Users
- Cross-Language (Multi-Lingual) Text Chat
- Old Conversation.js demos
- http://muaz-khan.blogspot.com/search/label/WebRTC
- https://www.webrtc-experiment.com/#documentations
- https://www.facebook.com/WebRTC
- https://plus.google.com/+WebRTC-Experiment/posts
Custom Signaling
- Socket.io over Node.js
- WebSocket over Node.js
- WebSync / ASP.NET MVC
- XHR Signaling
- openSignalingChannel
How to record audio using RecordRTC?
<script src="//cdn.webrtc-experiment.com/RecordRTC.js"></script>
Documentation page: http://recordrtc.org/RecordRTC.html
var recordRTC = RecordRTC(mediaStream, {
type: 'video' // audio or video or gif or canvas
});
recordRTC.startRecording();
recordRTC.stopRecording(function(videoURL) {
video.src = videoURL;
var blob = recordRTC.blob;
var arrayBuffer = recordRTC.buffer;
recordRTC.getDataURL(callback_function);
});
- RecordRTC to Node.js
- RecordRTC to PHP
- RecordRTC to ASP.NET MVC
- RecordRTC & HTML-2-Canvas i.e. Canvas/HTML Recording!
- MRecordRTC i.e. Multi-RecordRTC!
- RecordRTC on Ruby!
- RecordRTC over Socket.io
- ffmpeg-asm.js and RecordRTC! Audio/Video Merging & Transcoding!
- Recording Audio+Video in single WebM on Firefox
- RecordRTC / PHP / FFmpeg
You can write entire skype-like web-app using RTCMultiConnection! It supports all complex renegotiation scenarios!
<button id="openRoom">Open Room</button>
<button id="joinRoom">Join Room</button><br />
<script src="//cdn.webrtc-experiment.com/RTCMultiConnection.js"> </script>
<script>
document.getElementById('openRoom').onclick = function() {
new RTCMultiConnection().open();
};
document.getElementById('joinRoom').onclick = function() {
new RTCMultiConnection().connect();
};
</script>
RTCMultiConnection Documentation
DataChannel.js / A library for RTCDataChannel APIs
<script src="//cdn.webrtc-experiment.com/DataChannel.js"> </script>
<script>
var datachannel = new DataChannel();
datachannel.onopen = function(remoteUserid) {};
datachannel.onmessage = function(message, remoteUserid) {};
// search for existing channels
datachannel.connect();
document.getElementById('new-channel').onclick = function() {
datachannel.open(); // setup new channel
};
</script>
DataChannel Documentation
Translator.js is a JavaScript library built top on Google Speech-Recognition & Translation API to transcript and translate voice and text. It supports many locales and brings globalization in WebRTC!
<script src="//cdn.webrtc-experiment.com/Translator.js"> </script>
var translator = new Translator();
translator.voiceToText(function (text) {
console.log('Your voice as text!', text);
}, 'your-language');
translator.translateLanguage(textToConvert, {
from: 'language-of-the-text',
to: 'convert-into',
callback: function (translatedText) {
console.log('translated text', translatedText);
}
});
translator.speakTextUsingRobot(textToPlay);
translator.speakTextUsingGoogleSpeaker({
textToSpeak: 'text-to-convert',
targetLanguage: 'your-language'
});
FileBufferReader is a JavaScript library reads file and returns chunkified array-buffers. The resulting buffers can be shared using WebRTC data channels or socket.io.
var fileBufferReader = new FileBufferReader();
fileBufferReader.readAsArrayBuffer(file, function(uuid) {
// var file = fileBufferReader.chunks[uuid];
// var listOfChunks = file.listOfChunks;
// get first chunk, and send using WebRTC data channels
// NEVER send chunks in loop; otherwise you'll face issues in slow networks
// remote peer should notify if it is ready for next chunk
fileBufferReader.getNextChunk(uuid, function(nextChunk, isLastChunk) {
if(isLastChunk) {
alert('File Successfully sent.');
}
// sending using WebRTC data channels
datachannel.send(nextChunk);
});
});
datachannel.onmessage = function(event) {
var chunk = event.data;
if (chunk instanceof ArrayBuffer || chunk instanceof DataView) {
// array buffers are passed using WebRTC data channels
// need to convert data back into JavaScript objects
fileBufferReader.convertToObject(chunk, function(object) {
datachannel.onmessage({
data: object
});
});
return;
}
// if you passed "extra-data", you can access it here:
// chunk.extra.senderUserName or whatever else
// if target peer requested next chunk
if(chunk.readyForNextChunk) {
fileBufferReader.getNextChunk(chunk.uuid, function(nextChunk, isLastChunk) {
if(isLastChunk) {
alert('File Successfully sent.');
}
// sending using WebRTC data channels
datachannel.send(nextChunk);
});
return;
}
// if chunk is received
fileBufferReader.addChunk(chunk, function(promptNextChunk) {
// request next chunk
datachannel.send(promptNextChunk);
});
};
Simply use getScreenId.js and enjoy screen capturing from any domain. You don't need to deploy chrome extension yourself. You can refer your users to install this chrome extension instead. Also,getScreenId.js auto-fallbacks to command-line based screen capturing if chrome extension isn't installed or disabled. getScreenId.js throws clear exceptions which is helpful for end-user experiences.
<script src="//cdn.WebRTC-Experiment.com/getScreenId.js"></script>
<script>
getScreenId(function (error, sourceId, screen_constraints) {
navigator.getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
navigator.getUserMedia(screen_constraints, function (stream) {
document.querySelector('video').src = URL.createObjectURL(stream);
}, function (error) {
console.error(error);
});
});
</script>
Signaling?
Browser Support
WebRTC Experiments works fine on following web-browsers:
Credits