mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
CB-321: Media API: 'mediaSuccess' callback param to new Media() is called soon after new obj created
This commit is contained in:
parent
d2b329636f
commit
700ae50e9b
@ -2901,7 +2901,7 @@ Media.get = function(id) {
|
||||
* Start or resume playing audio file.
|
||||
*/
|
||||
Media.prototype.play = function(options) {
|
||||
exec(this.successCallback, this.errorCallback, "Media", "startPlayingAudio", [this.id, this.src, options]);
|
||||
exec(null, null, "Media", "startPlayingAudio", [this.id, this.src, options]);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -3512,8 +3512,9 @@ function Device() {
|
||||
this.cordova = null;
|
||||
|
||||
var me = this;
|
||||
this.getInfo(
|
||||
function(info) {
|
||||
|
||||
channel.onCordovaReady.subscribeOnce(function() {
|
||||
me.getInfo(function(info) {
|
||||
me.available = true;
|
||||
me.platform = info.platform;
|
||||
me.version = info.version;
|
||||
@ -3521,11 +3522,11 @@ function Device() {
|
||||
me.uuid = info.uuid;
|
||||
me.cordova = info.cordova;
|
||||
channel.onCordovaInfoReady.fire();
|
||||
},
|
||||
function(e) {
|
||||
},function(e) {
|
||||
me.available = false;
|
||||
utils.alert("[ERROR] Error initializing Cordova: " + e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -4505,8 +4506,8 @@ var NetworkConnection = function () {
|
||||
|
||||
var me = this;
|
||||
|
||||
this.getInfo(
|
||||
function (info) {
|
||||
channel.onCordovaReady.subscribeOnce(function() {
|
||||
me.getInfo(function (info) {
|
||||
me.type = info;
|
||||
if (info === "none") {
|
||||
// set a timer if still offline at the end of timer send the offline event
|
||||
@ -4538,6 +4539,7 @@ var NetworkConnection = function () {
|
||||
}
|
||||
console.log("Error initializing Network Connection: " + e);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user