This is about the new HTTP PUT file upload feature of Shaka Packager, see also shaka-project/shaka-packager#149. The code is currently living in the `http-upload`_ branch.
The receiver is based on the native Nginx module "`ngx_http_dav_module`_",
/** | |
* Semantic Versioning Comparing | |
* #see https://semver.org/ | |
* #see https://stackoverflow.com/a/65687141/456536 | |
* #see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator/Collator#options | |
*/ | |
function semverCompare(a, b) { | |
if (a.startsWith(b + "-")) return -1 | |
if (b.startsWith(a + "-")) return 1 | |
return a.localeCompare(b, undefined, { numeric: true, sensitivity: "case", caseFirst: "upper" }) |
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"image/jpeg" | |
"net" | |
"net/http" | |
"os" |
This is about the new HTTP PUT file upload feature of Shaka Packager, see also shaka-project/shaka-packager#149. The code is currently living in the `http-upload`_ branch.
The receiver is based on the native Nginx module "`ngx_http_dav_module`_",
package benchmark | |
import ( | |
"context" | |
"runtime" | |
"sync" | |
"sync/atomic" | |
"testing" | |
"time" | |
) |
var methods = { | |
setupVideoConference() { | |
console.log('setupVideoConference'); | |
return this.makeLocalTracks() | |
.then(this.getToken) | |
.then(this.createRoom) | |
.then(this.publishLocalTracks) | |
.catch((e) => { | |
console.log('setupVideoConference', JSON.stringify(e)); | |
}); |
package main | |
// Here's a simple example to show how to properly terminate multiple go routines by using a context. | |
// Thanks to the WaitGroup we'll be able to end all go routines gracefully before the main function ends. | |
import ( | |
"context" | |
"fmt" | |
"math/rand" | |
"os" |
#Capture and stream a webcam To capture using the iSight camera on a Mac, or infact any other webcam connected to the Mac, we can use FFmpeg. First get a list of the devices installed.
ffmpeg -f avfoundation -list_devices true -i ""
This will list the aviable video and audio devices.
The below will capture at 30fps and the set video size to a file.
ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -i "0:none" out.avi
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
const { spawn } = require('child_process'); | |
const EventEmitter = require('events').EventEmitter; | |
const RESTART_DELAY = 3000; | |
const PREFIX = "<<<"; | |
const SEPERATOR = " "; | |
const MAX_QUEUE_LENGTH = 100; | |
/** | |
* @typedef {{uri: string; data: any;}} IBaseMessage |
/* | |
This code snippet demonstrates how to do metaprogramming | |
in JavaScript using proxy and with statement. | |
Run this in non-strict mode. | |
*/ | |
const proxy = new Proxy({}, { | |
get(target, key) { | |
if(key === Symbol.unscopables) return {} | |
return `${key.toUpperCase()} ` | |
}, |