Skip to content

Instantly share code, notes, and snippets.

@mganeko
mganeko / signaling_by_hand
Last active August 29, 2015 14:07
WebRTC Signaling by Hand
<!DOCTYPE html>
<html>
<head>
<title>WebRTC 1 to 1 handshake V3</title>
</head>
<body>
<button type="button" onclick="startVideo();">Start video</button>
<button type="button" onclick="stopVideo();">Stop video</button>
&nbsp;&nbsp;&nbsp;&nbsp;
<button type="button" onclick="connect();">Connect</button>
@mganeko
mganeko / signaling_mqtt.html
Last active June 21, 2024 06:12
WebRTC signaling over MQTT
<!DOCTYPE html>
<html>
<head>
<title>MQTT signaling</title>
<meta charset="urt-8"/>
<script src="http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.javascript.git/plain/src/mqttws31.js"></script>
</head>
<body>
<button type="button" onclick="startVideo();">Start video</button>
<button type="button" onclick="stopVideo();">Stop video</button>
@mganeko
mganeko / signaling_milkcocoa_multi.html
Created December 5, 2014 08:04
WebRTC signaling over milkcocoa for multiple room / people
<!DOCTYPE html>
<html>
<head>
<title>WebRTC over milkcocoa</title>
</head>
<body>
<button type="button" onclick="startVideo();">Start video</button>
<button type="button" onclick="stopVideo();">Stop video</button>
<button type="button" onclick="call();">Connect</button>
@mganeko
mganeko / mediasource.html
Last active August 29, 2015 14:12
WebRTC mediasource select
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Capture Crop</title>
</head>
<body>
Media Source list<br />
<select id="mic_list" size="5" onchange="micSelected();">
</select>
@mganeko
mganeko / gist:4d0f84c383722d1fb963
Last active August 29, 2015 14:16
WebRTC 1to1 with "Simple Message Server" for WebSocket
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>WebRTC 1to1</title>
<!--- this is demo for http://www.slideshare.net/mganeko/chromebook-webrtc -->
<!-- please install simple message server from here: https://chrome.google.com/webstore/detail/simple-message-server/bihajhgkmpfnmbmdnobjcdhagncbkmmp -->
</head>
<body>
<button type="button" onclick="startVideo();">Start video</button>
@mganeko
mganeko / parse_webm.js
Last active May 21, 2024 03:06
Parse Binary of WebM file with Node.js
//
// This code parses binary format of WebM file.
// recognizes only some important TAGs
//
// Limitation:
// This programs reads all binary at once in memory (100MB).
// It is very bad imprementation, but it is still enough for some small WebM file.
//
// Usage:
// node parse_webm.js filename
function logSIMD(arg1, arg2, opt, res) {
console.log(opt + '( ' + arg1.toSource() + ' , ' + arg2.toSource() + ' ) ==> ' + res.toSource());
}
var a = SIMD.Float32x4(1.0,2.0,3.0,4.0);
var b = SIMD.Float32x4(5.0,6.0,7.0,8.0);
var c = SIMD.Float32x4.add(a,b);
//console.log(c.toSource());
logSIMD(a, b, "add", c);
@mganeko
mganeko / recordFF_201510.html
Created October 17, 2015 03:29
Media Recorder for Firefox 201510
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>recording Firefox 201510</title>
</head>
<body>
<h2>MediaRecorder Demo for Firefox</h2>
<button id="start_button" onclick="startVideo()">StartVideo</button>
<button id="stop_button" onclick="stopVideo()">StopVideo</button>
@mganeko
mganeko / browser_mcu_video_audio_mix.js
Created August 20, 2016 01:34
javascript code for Browser MCU, video audio mix
let remoteVideo0 = document.getElementById('webrtc-remote-video-0');
let remoteVideo1 = document.getElementById('webrtc-remote-video-1');
let remoteVideo2 = document.getElementById('webrtc-remote-video-2');
let remoteVideo3 = document.getElementById('webrtc-remote-video-3');
let canvasMix = document.getElementById('canvas_mix');
canvasMix.addEventListener('mousedown', clickMixCenter, false);
canvasMix.addEventListener('mousemove', moveMixCenter, false);
@mganeko
mganeko / browser_mcu_mix_record.js
Created August 20, 2016 02:08
Browser MCU mix recording
let remoteVideo0 = document.getElementById('webrtc-remote-video-0');
let remoteVideo1 = document.getElementById('webrtc-remote-video-1');
let remoteVideo2 = document.getElementById('webrtc-remote-video-2');
let remoteVideo3 = document.getElementById('webrtc-remote-video-3');
let canvasMix = document.getElementById('canvas_mix');
let ctxMix = canvasMix.getContext('2d');
ctxMix.fillStyle = 'rgb(128, 192, 128)';
let mixStream = null;