Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C43C99177 for ; Tue, 20 Mar 2012 19:12:17 +0000 (UTC) Received: (qmail 21755 invoked by uid 500); 20 Mar 2012 19:12:17 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 21735 invoked by uid 500); 20 Mar 2012 19:12:17 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 21727 invoked by uid 99); 20 Mar 2012 19:12:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2012 19:12:17 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gibson.becky@gmail.com designates 209.85.160.175 as permitted sender) Received: from [209.85.160.175] (HELO mail-gy0-f175.google.com) (209.85.160.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2012 19:12:09 +0000 Received: by ghbz2 with SMTP id z2so431430ghb.6 for ; Tue, 20 Mar 2012 12:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=OVfjkMsNJdFY9Uybjs3KP0SKp/ZZEnkj4rX2LoZ+XwY=; b=YUqu6JpbRhwl/AZjoEypQO89m8ln3eAEL2KUwZBlm3MlxaEMrTGElNJYeQXaJAymcn DWKSXwKFFzOxk37u5rbgx28e1VzxLpiin97k4ctcaMBKiMj8M1IMp7UxA+Q5GwwaQcgL ME+RWfcsZWT8r0myYurLBlvizpsSZ4+MomYDHHGBOfMrkIFqQ46h5XFLIY7QDlVhZ4X5 Rm6CiuQ/pRXDc6uR9trWYBky1NA8bWXUrLVrkbLe4dRihU63Gcfp/y9NrhXmJloA28c5 oihka6BTKe/3e6kEZyF4Xeq5Hgcdm7oF6wWJi1xJEdjUdkYmbqArGNUpP6epuK9BBS78 889Q== MIME-Version: 1.0 Received: by 10.236.175.41 with SMTP id y29mr1146935yhl.60.1332270708803; Tue, 20 Mar 2012 12:11:48 -0700 (PDT) Received: by 10.146.204.18 with HTTP; Tue, 20 Mar 2012 12:11:48 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Mar 2012 15:11:48 -0400 Message-ID: Subject: Re: Unified JS: Media onStatus From: Becky Gibson To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=14dae9d2f66c57c84404bbb17286 X-Virus-Checked: Checked by ClamAV on apache.org --14dae9d2f66c57c84404bbb17286 Content-Type: text/plain; charset=ISO-8859-1 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 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 > > > > > --14dae9d2f66c57c84404bbb17286--