Skip to content

Instantly share code, notes, and snippets.

View imbcmdth's full-sized avatar

Jon-Carlos Rivera imbcmdth

View GitHub Profile
// Return a function that allows the passed-in function to be called
// at most `times` times
let numTimes = (cb, times) => (...args) => {
if (times) {
time--;
return cb(...args);
}
}
// Allow a function to be called only once
enum CanPlayTypeEnum { "" /* empty string */, "maybe", "probably" };

interface HTMLMediaElement : HTMLElement {
  // error state
  readonly attribute MediaError? error;
  // network state
           attribute DOMString src;
  readonly attribute DOMString currentSrc;
           attribute DOMString crossOrigin;
ffprobe C2.ts -show_frames | ./frames_to_json.js > C2.json
// http://codepen.io/incompl/pen/KwOqYx
var games = [["PP","Pianissimo"],
["Fairy","Tale"],
["Fork","Tale"],
["Game","Thrones","Genesis"],
["Hat","Time"],
["Mind","Forever","Voyaging"],
["Ace","Spades"],
["Aces","Pacific"],
["Act","War","Direct","Action"],
@imbcmdth
imbcmdth / saveTA.js
Created March 22, 2016 15:43
Save a typed array as a file from the console (add as a snippet in chrome dev tools)
/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */
var saveAs=saveAs||function(view){"use strict";if(typeof navigator!=="undefined"&&/MSIE [1-9]\./.test(navigator.userAgent)){return}var doc=view.document,get_URL=function(){return view.URL||view.webkitURL||view},save_link=doc.createElementNS("http://www.w3.org/1999/xhtml","a"),can_use_save_link="download"in save_link,click=function(node){var event=new MouseEvent("click");node.dispatchEvent(event)},is_safari=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),webkit_req_fs=view.webkitRequestFileSystem,req_fs=view.requestFileSystem||webkit_req_fs||view.mozRequestFileSystem,throw_outside=function(ex){(view.setImmediate||view.setTimeout)(function(){throw ex},0)},force_saveable_type="application/octet-stream",fs_min_size=0,arbitrary_revoke_timeout=500,revoke=function(file){var revoker=function(){if(typeof file==="string"){get_URL().revokeObjectURL(file)}else{file.remove()}};if(view.chrome){revoker()}else{setTimeout(revoker,arbitrar

CHANGELOG


2.0.1 (2016-03-11)

  • First release of the ES6 version of the SourceHandler
  • All new lint/build/test setup via the generator-videojs-plugin project

/**
* @file time-ranges.js
*
* Should create a fake TimeRange object
* Mimics an HTML5 time range instance, which has functions that
* return the start and end times for a range
* TimeRanges are returned by the buffered() method
*
* @param {(Number|Array)} Start of a single range or an array of ranges
* @param {Number} End of a single range
videojs.players.vjs_video_3.player.src({
src: 'http://some.com/manifest.mpd',
type: 'application/dash+xml'
});
@imbcmdth
imbcmdth / eme.json
Last active August 29, 2015 14:23 — forked from dmlap/eme.json
player.src({
"src": "movie.mpd",
"type":"application/dash+xml",
"keySystemOptions": [
{
"name": "com.widevine.alpha",
"options": {
"licenseUrl": "https://example.com/license"
}
}
// Dash live profile:
{
"duration": 60200,
"poster_sources": [
{
"src": "http://brightcove.vo.lowlight.local/ll/media/file/3303963094001/3303963094001_30328785791202_30328762662001-vs.jpg?pubId=3303963094001"
},
{
"src": "https://sadmin.brightcove.com/ll/media/file/3303963094001/3303963094001_30328785791202_30328762662001-vs.jpg?pubId=3303963094001"