JSFiddle - React, Tailwind, and code Playground

HTML

<script src="http://videojs.com/video-js/video.js"></script>
<video id="test"></video>http://jsfiddle.net/gaboesquivel/BA8Pm/#

JavaScript

var Foo = function (callback) {
    callback();
    return {
        destroy: function () {
            alert("destroy");
        }
    }
};

var x = new Foo(function () {
    alert("typeof x here is " + typeof x);
});

alert("typeof x " + typeof x);
x.destroy();


//here's with videojs
var videoJsCallback = function () {
    alert("typeof y here is " + typeof y);
};
var y = _V_("test", {}, videoJsCallback);

alert("typeof y " + typeof y);
y.destroy();