Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 70FA0EA36 for ; Tue, 12 Feb 2013 19:33:10 +0000 (UTC) Received: (qmail 62795 invoked by uid 500); 12 Feb 2013 19:33:08 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 62743 invoked by uid 500); 12 Feb 2013 19:33:08 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 61944 invoked by uid 99); 12 Feb 2013 19:33:08 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Feb 2013 19:33:07 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CF065516A7; Tue, 12 Feb 2013 19:33:07 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: commits@cordova.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [11/50] js commit: [CB-2287] - fix for checking that the audio.src are defined in the right places Message-Id: <20130212193307.CF065516A7@tyr.zones.apache.org> Date: Tue, 12 Feb 2013 19:33:07 +0000 (UTC) [CB-2287] - fix for checking that the audio.src are defined in the right places Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/d1b4a200 Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/d1b4a200 Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/d1b4a200 Branch: refs/heads/symbolmapping Commit: d1b4a2002c48cd40aee55fc2ea6335fa5255b905 Parents: a089aa7 Author: Tim Kim Authored: Mon Jan 28 18:22:34 2013 -0800 Committer: Tim Kim Committed: Fri Feb 1 13:17:36 2013 -0800 ---------------------------------------------------------------------- lib/blackberry/plugin/webworks/media.js | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/d1b4a200/lib/blackberry/plugin/webworks/media.js ---------------------------------------------------------------------- diff --git a/lib/blackberry/plugin/webworks/media.js b/lib/blackberry/plugin/webworks/media.js index 62c2b1c..21c2328 100644 --- a/lib/blackberry/plugin/webworks/media.js +++ b/lib/blackberry/plugin/webworks/media.js @@ -30,8 +30,13 @@ module.exports = { var id = args[0], src = args[1]; + + if (typeof src == "undefined"){ + audioObjects[id] = new Audio(); + } else { + audioObjects[id] = new Audio(src); + } - audioObjects[id] = new Audio(src); return {"status" : 1, "message" : "Audio object created" }; }, startPlayingAudio: function (args, win, fail) { @@ -43,7 +48,7 @@ module.exports = { audio = audioObjects[id], result; - if (args.length === 1) { + if (args.length === 1 || typeof args[1] == "undefined" ) { return {"status" : 9, "message" : "Media source argument not found"}; } @@ -54,7 +59,6 @@ module.exports = { audio = audioObjects[id] = new Audio(args[1]); audio.play(); - return {"status" : 1, "message" : "Audio play started" }; }, stopPlayingAudio: function (args, win, fail) { @@ -171,8 +175,10 @@ module.exports = { result; if (audio) { + if(audio.src !== ""){ + audio.src = undefined; + } audioObjects[id] = undefined; - audio.src = undefined; //delete audio; }