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: Unified JS: Media onStatus
Date Tue, 20 Mar 2012 19:11:48 GMT
Sending this out again as no one commented and I think we should fix.   The
docs indicates that Media error callback returns a MediaError object with a
code and message parameter. In unified JS we are only returning a code
parameter.

iOS DID pass back a MediaError object in the Media.onStatus value parameter
that included a message.  I'd like to update the unified JS code to
maintain the message by passing back a MediaError object as the value
paremter for status of MEDIA_ERROR.  If I do this Android will need to
update.

any objections?
-becky



On Tue, Mar 6, 2012 at 12:59 PM, Becky Gibson <gibson.becky@gmail.com>wrote:

> Maybe I should work my way through all of the issues in an object before
> posting!
>
> The functionality of media.onStatus has changed (at least for iOS).   The
> unified version takes an id,  message type, and value.  Message type is a
> MEDIA.code identifying the type of message - Media.MEDIA_STATE, etc.  The
> behavior that has changed is for Media.MEDIA_ERROR.   The MediaError object
> has a code and message parameter.   In the Unified JS version, the message
> parameter is lost as it assumes the value input into onStatus is a media
> error code:
>
> else if (msg === Media.MEDIA_ERROR) {
>
>         if (media.errorCallback) {
>
>             media.errorCallback({"code":value});
>
>         }
>
>     }
>
> Previously, iOS was passing back a MediaError object as the value
> parameter with code and message values.
>
> else if (msg == Media.MEDIA_ERROR) {
>
>         if (media.errorCallback) {
>
>             media.errorCallback(value); // value is a MediaError object
>
>         }
>
>     }
>
>  I believe that an onStatus call with a msg parameter with a value of
> Media.MEDIA_ERROR should be passing back a MediaError object as the value
> parameter. This allows the device to pass back a more detailed error
> message.  If you want to avoid having to modify the Android code we could
> add an additional parameter to the onStatus method to allow the error
> message to be provided and update the else if (msg == Media.MEDIA_ERROR)
> clause to include it in the MediaError object if it was available.
>
> What is the preferred way to resolve this?
>
>
> thanks,
>
> -becky
>
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message