incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon MacDonald <simon.macdon...@gmail.com>
Subject CB-321 - Media API: 'mediaSuccess' callback param to new Media() is called soon after new obj created
Date Fri, 30 Mar 2012 17:39:32 GMT
So I was looking at CB 321 and I know how to fix the issue. In earlier
Android releases we did not pass the success and failure callbacks to
the exec in the Media.play() method. So the way things work now if you
do:

media1 = new Media(src, win, fail);
media1.play();

You will get the win callback called as soon as play is executed. Then
again when the audio file has completed playing.

If I change:

Media.prototype.play = function(options) {
    exec(this.successCallback, this.errorCallback, "Media",
"startPlayingAudio", [this.id, this.src, options]);
};

to:

Media.prototype.play = function(options) {
    exec(null, null, "Media", "startPlayingAudio", [this.id, this.src,
options]);
};

the original behaviour returns but I don't want to do that if it is
going to mess up the other platforms. Let me know what would happen
iOS and BB folks.

Simon Mac Donald
http://hi.im/simonmacdonald

Mime
View raw message