Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for Node and AMD, in addition to browser globals #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "whammy",
"version": "0.0.1",
"description": "Real-time Javascript Video Encoder",
"main": "whammy.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/antimatter15/whammy.git"
},
"keywords": [
"video",
"encoding",
"vp8",
"webm",
"ebml",
"riff",
"webp",
"codec",
"browser",
"chrome"
],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/antimatter15/whammy/issues"
},
"homepage": "https://github.com/antimatter15/whammy#readme"
}
14 changes: 11 additions & 3 deletions whammy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
vid.compile()
*/

window.Whammy = (function(){
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory();
} else {
root.Whammy = factory();
}
}(this, function () {
// in this case, frames has a very specific meaning, which will be
// detailed once i finish writing the code

Expand Down Expand Up @@ -554,7 +562,7 @@ window.Whammy = (function(){
return webp;
}), outputAsArray);
callback(webm);

}.bind(this));
};

Expand All @@ -570,4 +578,4 @@ window.Whammy = (function(){
toWebM: toWebM
// expose methods of madness
}
})()
}))