You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ti...@apache.org on 2013/01/30 00:17:26 UTC

[2/2] js commit: [CB-2287] - fixed a few failing specs

Updated Branches:
  refs/heads/bb_media_fix [created] aae7a1a43


[CB-2287] - fixed a few failing specs


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/aae7a1a4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/aae7a1a4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/aae7a1a4

Branch: refs/heads/bb_media_fix
Commit: aae7a1a437d0ce4a2e7ecd9ad4e04d41f2d0de33
Parents: 271ffcd
Author: Tim Kim <ti...@adobe.com>
Authored: Tue Jan 29 10:48:00 2013 -0800
Committer: Tim Kim <ti...@adobe.com>
Committed: Tue Jan 29 10:48:00 2013 -0800

----------------------------------------------------------------------
 lib/blackberry/plugin/webworks/media.js |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/aae7a1a4/lib/blackberry/plugin/webworks/media.js
----------------------------------------------------------------------
diff --git a/lib/blackberry/plugin/webworks/media.js b/lib/blackberry/plugin/webworks/media.js
index a6179b4..21c2328 100644
--- a/lib/blackberry/plugin/webworks/media.js
+++ b/lib/blackberry/plugin/webworks/media.js
@@ -52,18 +52,14 @@ module.exports = {
             return {"status" : 9, "message" : "Media source argument not found"};
         }
 
-        if (audio.readyState !== 0){
-            if (audio) {
-                audio.pause();
-                audioObjects[id] = undefined;
-            }
-    
-            audio = audioObjects[id] = new Audio(args[1]);
-            audio.play();
-            return {"status" : 1, "message" : "Audio play started" };
-        }else{
-            return {"status" : 9, "message" : "Media not ready"};
+        if (audio) {
+            audio.pause();
+            audioObjects[id] = undefined;
         }
+
+        audio = audioObjects[id] = new Audio(args[1]);
+        audio.play();
+        return {"status" : 1, "message" : "Audio play started" };
     },
     stopPlayingAudio: function (args, win, fail) {
         if (!args.length) {