Not sure why, I do not see that error.
Also, I could not get var _media = require('Media'); to work. ( which is
what I think it should be. )
At runtime the Media is available on the window object, but how do I
require it?On Mon, May 21, 2012 at 1:13 PM, Anis KADRI <[email protected]> wrote: > I am getting > > lib\wp7\plugin\wp7\CordovaMediaonStatus.js: line 10, col 9, 'Media' is not > defined. > > When I run jake > > On Sat, May 19, 2012 at 1:56 AM, <[email protected]> wrote: > > > Updated Branches: > > refs/heads/master 58a213de4 -> 019c7af39 > > > > > > callback issue, require not working for global object Media > > > > > > Project: > http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo > > Commit: > > > http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/019c7af3 > > Tree: > > > http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/019c7af3 > > Diff: > > > http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/019c7af3 > > > > Branch: refs/heads/master > > Commit: 019c7af398bae01813cbd401a90f1053790814d0 > > Parents: 58a213d > > Author: Jesse MacFadyen <[email protected]> > > Authored: Sat May 19 01:54:47 2012 -0700 > > Committer: Jesse MacFadyen <[email protected]> > > Committed: Sat May 19 01:54:47 2012 -0700 > > > > ---------------------------------------------------------------------- > > lib/wp7/plugin/wp7/CordovaMediaonStatus.js | 13 ++++++++++--- > > 1 files changed, 10 insertions(+), 3 deletions(-) > > ---------------------------------------------------------------------- > > > > > > > > > http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/019c7af3/lib/wp7/plugin/wp7/CordovaMediaonStatus.js > > ---------------------------------------------------------------------- > > diff --git a/lib/wp7/plugin/wp7/CordovaMediaonStatus.js > > b/lib/wp7/plugin/wp7/CordovaMediaonStatus.js > > index 6302b2c..6d27626 100644 > > --- a/lib/wp7/plugin/wp7/CordovaMediaonStatus.js > > +++ b/lib/wp7/plugin/wp7/CordovaMediaonStatus.js > > @@ -1,9 +1,16 @@ > > > > var cordova = require('cordova'); > > > > + > > module.exports = function(args) { > > + try { > > + var res = JSON.parse(args); > > + // NOTE: had issues with require here. -jm > > + // technically this should be var _media = require('Media'); /// > > me thinks > > + Media.onStatus(res.id, res.msg, res.value); > > + } > > + catch(e) { > > + console.log("Error calling media.onStatus :: " + e); > > + } > > > > - console.log("media on status :: " + args); > > - //var res = JSON.parse(args); > > - //require("cordova/media").onStatus(res.id, res.msg, res.value); > > }; > > \ No newline at end of file > > > > > -- @purplecabbage risingj.com
