Skip to content

Instantly share code, notes, and snippets.

@malthejorgensen
malthejorgensen / h264_codec_string_parser.js
Last active February 9, 2022 08:48
H.264 Codec String Parser (video, profile, level) - February 2022
// FROM: https://gist.github.com/eladkarako/119e91525d34db9f61cca23b18fd62a0#file-h264_codec_string_parser-js
//
// Changes:
// 1. Change to work on uppercase strings
// 2. Allow passing codec string as command line argument, e.g. `node h264_codec_string_parser.js avc1.42C03E`
// 3. Parse `constraint_set_flags` as well
//
ISOAVC_MAP = {
"avc1": "H.264"
,"avc2": "H.264"
@malthejorgensen
malthejorgensen / jquery-ajax-promise.js
Created August 2, 2016 09:31 — forked from tobiashm/jquery-ajax-promise.js
Wrap jQuery AJAX in ES6 Promise
function AjaxError(jqXHR, textStatus, errorThrown) {
this.name = "AjaxError";
this.message = textStatus;
this.jqXHR = jqXHR;
this.errorThrown = errorThrown;
}
AjaxError.prototype = new Error();
AjaxError.prototype.constructor = AjaxError;
(function($) {