Reputation: 8937
I'm using Icenium Mist, and the cordova.js it includes is pretty streamlined and small and I can't find the definition of the Media object I'm hoping to use.
Upvotes: 1
Views: 110
Reputation: 14509
Media object is provided in a plugin. You need to include this one: https://github.com/apache/cordova-plugin-media Not sure how to do it with Icenium Mist but with the command line tools it is: Cordova plugin add org.apache.cordova.media
See http://cordova.apache.org/docs/en/3.3.0/cordova_media_media.md.html#Media for more details. And here for http://docs.icenium.com/creating-your-project/using-plugins/working-with-plugins for more details about adding the plugin
Edit: If I read the docs for icenium correctly you need to do the following:
Edit2:
Does it work when you execute it in the deviceready event like this:
document.addEventListener("deviceready", function() {
var media = new Media(src, successcallback);
}, false);
of course changing the parameters to your need
Upvotes: 0
Reputation: 3171
Go to the project properties in Mist and choose "plugins". Check the box to include the media plugin and you should be set.
Upvotes: 1