Fetching contributors…
Cannot retrieve contributors at this time
executable file 234 lines (190 sloc) 7.96 KB
<!DOCTYPE html>
<html lang="en">
<title>Share mp3 Live using RTCMultiConnection</title>
if(!location.hash.replace('#', '').length) {
location.href = location.href.split('#')[0] + '#' + (Math.random() * 100).toString().replace('.', '');
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel="author" type="text/html" href="">
<meta name="author" content="Muaz Khan">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="">
.search-container {
text-align: left;
margin: -2em 5%;
margin-top: 0;
.search-container input {
background-color: transparent;
.search-container td {
border: 0;
vertical-align: top;
padding: 0;
border-top: none;
border-right: none;
summary::-webkit-details-marker {
display: none
summary {
summary:after {
background: rgb(219, 215, 215);
border-radius: 1px;
content: "+";
color: #838080;
float: left;
font-size: 1.5em;
font-weight: bold;
margin: 0 10px 0 -10px;
padding: 0;
text-align: center;
width: 20px;
cursor: pointer;
border: 1px solid rgb(189, 189, 189);
border-left: 0;
details[open] summary:after {
content: "-";
details blockquote.inline {
margin-left: 23px;
.libraries {
margin-left: 0;
.libraries li {
list-style: none;
cursor: pointer;
<script src=""></script>
<script src=""></script>
<header style="text-align: center;">
Share mp3 Live using <a href="">RTCMultiConnection</a>
<a href="">HOME</a>
<span> &copy; </span>
<a href="" target="_blank">Muaz Khan</a>
<a href="" target="_blank" title="Twitter profile for WebRTC Experiments">@WebRTCWeb</a>
<a href="" target="_blank" title="Github Profile">Github</a>
<a href="" target="_blank">Latest issues</a>
<a href="" target="_blank">What's New?</a>
<div class="github-stargazers"></div>
<section class="experiment">
<h2 class="header">
Share mp3 Live using RTCMultiConnection
<input type="file">
<button id="openNewSessionButton" disabled>Open New Room</button>
<div id="streams-container"></div>
var connection = new RTCMultiConnection();
connection.session = {
audio: true,
oneway: true
var streamsContainer = document.getElementById('streams-container');
connection.onstream = function(e) {
// connect to signaling gateway
// open new session
document.getElementById('openNewSessionButton').onclick = function() {
this.disabled = true;;
window.AudioContext = window.AudioContext || window.webkitAudioContext;
var context = new AudioContext();
var gainNode = context.createGain();
// don't play for self
gainNode.gain.value = 0;
document.querySelector('input[type=file]').onchange = function() {
this.disabled = true;
var reader = new FileReader();
reader.onload = (function(e) {
// Import callback function that provides PCM audio data decoded as an audio buffer
context.decodeAudioData(, function(buffer) {
// Create the sound source
var soundSource = context.createBufferSource();
soundSource.buffer = buffer;
soundSource.start(0, 0 / 1000);
var destination = context.createMediaStreamDestination();
connection.dontCaptureUserMedia = true;
document.getElementById('openNewSessionButton').disabled = false;
button[disabled] {
background: none;
border: 1px solid rgb(226, 223, 223);
color: rgb(219, 217, 217);
<section class="experiment own-widgets latest-commits">
<h2 class="header" id="updates" style="color: red;padding-bottom: .1em;"><a href="">Latest Updates</a></h2>
<div id="github-commits"></div>
<section class="experiment own-widgets">
<h2 class="header" id="updates" style="color: red;padding-bottom: .1em;"><a href="">Latest Issues</a></h2>
<div id="github-issues"></div>
<section class="experiment">
<h2 class="header" id="feedback">Feedback</h2>
<textarea id="message" style="height: 8em; margin: .2em; width: 98%; border: 1px solid rgb(189, 189, 189); outline: none; resize: vertical;" placeholder="Have any message? Suggestions or something went wrong?"></textarea>
<button id="send-message" style="font-size: 1em;">Send Message</button><small style="margin-left:1em;">Enter your email too; if you want "direct" reply!</small>
<a href="" class="fork-left"></a>
<a href="/licence/">MIT License</a>
© <a href="" rel="author" target="_blank">Muaz Khan</a>
<a href="" target="_blank"></a>
<a href="" target="_blank">Github</a>
Powered by <a href="">Arvixe Web Hosting</a>
window.useThisGithubPath = 'muaz-khan/RTCMultiConnection';
<script src="" async></script>