Skip to content

Instantly share code, notes, and snippets.

View ncurrier's full-sized avatar

Nathaniel Currier ncurrier

View GitHub Profile
<html>
<head>
<title>WebRTC with SkylinkJS</title>
<script src="//cdn.temasys.com.sg/skylink/skylinkjs/0.5.x/skylink.complete.min.js"></script>
</head>
<body>
<video id="myvideo" style="transform: rotateY(-180deg);" autoplay muted></video>
</body>
</html>
skylink.on('peerJoined', function(peerId, peerInfo, isSelf) {
if(isSelf) return; // We already have a video element for our video and don't need to create a new one.
var vid = document.createElement('video');
vid.autoplay = true;
vid.muted = true; // Added to avoid feedback when testing locally
vid.id = peerId;
document.body.appendChild(vid);
});
skylink.on('incomingStream', function(peerId, stream, isSelf) {
if(isSelf) return;
var vid = document.getElementById(peerId);
attachMediaStream(vid, stream);
});
skylink.on('peerLeft', function(peerId, peerInfo, isSelf) {
var vid = document.getElementById(peerId);
document.body.removeChild(vid);
});
skylink.on('mediaAccessSuccess', function(stream) {
var vid = document.getElementById('myvideo');
attachMediaStream(vid, stream);
});
skylink.joinRoom({
audio: true,
video: true
});
@ncurrier
ncurrier / calibre-reader.css
Created April 17, 2024 02:11
Readability focused *forced* stylesheet for Calibre Reader.
/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
/* Base styles */
body {
font-family: 'Roboto Slab', 'Helvetica Neue', 'Segoe UI', 'Arial', sans-serif !important;
font-size: 1rem !important;
line-height: 1.6 !important;
color: #333333 !important;