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 Unified JS: Media onStatus
Date Tue, 06 Mar 2012 17:59:28 GMT
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