| 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..890081f591ff1fb5c77f901c7b5ad266e78610d7 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 {Object} optional dictionary of args to send to DidCreateInstance
|
| */
|
| - 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';
|
|
|