Add check to only init and run JS code once - even if included multiple times.

This commit is contained in:
Bryce Curtis
2011-03-30 13:29:24 -05:00
parent b850d225f4
commit 908485751b
16 changed files with 139 additions and 59 deletions
+6 -3
View File
@@ -6,6 +6,9 @@
* Copyright (c) 2010, IBM Corporation
*/
if (!PhoneGap.hasResource("media")) {
PhoneGap.addResource("media");
/**
* List of media objects.
* PRIVATE
@@ -128,10 +131,10 @@ Media.MEDIA_MSG = ["None", "Starting", "Running", "Paused", "Stopped"];
* This class contains information about any Media errors.
* @constructor
*/
function MediaError() {
MediaError = function() {
this.code = null;
this.message = "";
}
};
MediaError.MEDIA_ERR_ABORTED = 1;
MediaError.MEDIA_ERR_NETWORK = 2;
@@ -198,4 +201,4 @@ Media.prototype.stopRecord = function() {
Media.prototype.release = function() {
PhoneGap.exec(null, null, "Media", "release", [this.id]);
};
};