Index: native_client_sdk/src/examples/common.js |
diff --git a/native_client_sdk/src/examples/common.js b/native_client_sdk/src/examples/common.js |
index 257773c9e8c4c244b2175ed2ca639d047eb855e5..f5287124afcaaf973030f4f7d861d21f0b351b94 100644 |
--- a/native_client_sdk/src/examples/common.js |
+++ b/native_client_sdk/src/examples/common.js |
@@ -19,14 +19,23 @@ var common = (function () { |
* @param {string} path Directory name where .nmf file can be found. |
* @param {number} width The width to create the plugin. |
* @param {number} height The height to create the plugin. |
+ * @param {args} optional dictionary of args to send to DidCreateInstance |
binji
2013/01/10 19:45:56
nit: @param {Object} args ...
|
*/ |
- function createNaClModule(name, tool, path, width, height) { |
+ function createNaClModule(name, tool, path, width, height, args) { |
var moduleEl = document.createElement('embed'); |
moduleEl.setAttribute('name', 'nacl_module'); |
moduleEl.setAttribute('id', 'nacl_module'); |
moduleEl.setAttribute('width', width); |
moduleEl.setAttribute('height',height); |
moduleEl.setAttribute('src', path + '/' + name + '.nmf'); |
+ |
+ // Add any optional arguments |
+ if (args) { |
+ for (var key in args) { |
+ moduleEl.setAttribute(key, args[key]) |
+ } |
+ } |
+ |
// For NaCL modules use application/x-nacl. |
var mimetype = 'application/x-nacl'; |
var isHost = tool == 'win' || tool == 'linux' || tool == 'mac'; |