incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Becky Gibson <gibson.be...@gmail.com>
Subject Re: CB-321 - Media API: 'mediaSuccess' callback param to new Media() is called soon after new obj created
Date Fri, 30 Mar 2012 18:54:29 GMT
That change shouldn't affect iOS since the only callback into JS from
startPlayingAudio is via the Media.onStatus function.

-becky

On Fri, Mar 30, 2012 at 1:39 PM, Simon MacDonald
<simon.macdonald@gmail.com>wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message