Skip to content

Instantly share code, notes, and snippets.

Avatar

Scott Miller scott

View GitHub Profile
@scott
scott / widget.js
Created Dec 28, 2015 — forked from lukencode/widget.js
Starter template for creating jsonp embeddable widgets.
View widget.js
(function () {
var scriptName = "embed.js"; //name of this script, used to get reference to own tag
var jQuery; //noconflict reference to jquery
var jqueryPath = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js";
var jqueryVersion = "1.8.3";
var scriptTag; //reference to the html script tag
/******** Get reference to self (scriptTag) *********/
var allScripts = document.getElementsByTagName('script');
View vswap.wistia-tracker.js
/*
* Tracks a video's play progress via Vertster
* http://wistia.com/
*
* Usage:
*
* Vswap.trackWistiaVideo(560, 'wistia_123', 63.0);
*
* Note: This currently only works with a Wistia video embed but could be easily adapted to
* work with YouTube or other video players.