You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/09/03 23:29:25 UTC

[1/2] cordova-plugin-media git commit: CB-9606 Fixes arguments parsing in `seekAudio`

Repository: cordova-plugin-media
Updated Branches:
  refs/heads/master c9ca8a63e -> 4321b3f07


CB-9606 Fixes arguments parsing in `seekAudio`


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/9e137ccb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/9e137ccb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/9e137ccb

Branch: refs/heads/master
Commit: 9e137ccb4e60570cec09d405e5777f064354339e
Parents: c9ca8a6
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Thu Sep 3 13:30:19 2015 +0300
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 3 14:29:08 2015 -0700

----------------------------------------------------------------------
 src/wp/Media.cs |  4 ++--
 tests/tests.js  | 28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/9e137ccb/src/wp/Media.cs
----------------------------------------------------------------------
diff --git a/src/wp/Media.cs b/src/wp/Media.cs
index 72d818b..b0d85b2 100644
--- a/src/wp/Media.cs
+++ b/src/wp/Media.cs
@@ -460,11 +460,11 @@ namespace WPCordovaClassLib.Cordova.Commands
                     mediaOptions = new MediaOptions();
                     mediaOptions.Id = optionsString[0];
                     int msec = 0;
-                    if (int.TryParse(optionsString[2], out msec))
+                    if (int.TryParse(optionsString[1], out msec))
                     {
                         mediaOptions.Milliseconds = msec;
                     }
-                    callbackId = mediaOptions.CallbackId = optionsString[3];
+                    callbackId = mediaOptions.CallbackId = optionsString[2];
 
                 }
                 catch (Exception)

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/9e137ccb/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 068d604..bbf7c1e 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -295,6 +295,34 @@ exports.defineAutoTests = function () {
                 media = new Media(mediaFile, successCallback, failed.bind(self, done, 'media1 = new Media - Error creating Media object. Media file: ' + mediaFile, context), statusChange);
                 media.play();
             }, ACTUAL_PLAYBACK_TEST_TIMEOUT);
+
+            it("media.spec.21 should be able to seek through file", function (done) {
+                if (!isAudioSupported || cordova.platformId === 'blackberry10') {
+                    pending();
+                }
+
+                //context variable used as an extra security statement to ensure that the callback is processed only once,
+                //in case the statusChange callback is reached more than one time with the same status code.
+                //Some information about this kind of behaviour can be found at JIRA: CB-7099.
+                var context = this;
+                var mediaFile = 'http://cordova.apache.org/downloads/BlueZedEx.mp3';
+                var successCallback = function () { };
+                var statusChange = function (statusCode) {
+                    if (!context.done && statusCode == Media.MEDIA_RUNNING) {
+                        checkInterval = setInterval(function () {
+                            if (context.done) return;
+                            media.seekTo(5000);
+                            media.getCurrentPosition(function (position) {
+                                expect(position).toBe(5);
+                                context.done = true;
+                                done();
+                            }, failed.bind(null, done, 'media1.getCurrentPosition - Error getting media current position', context));
+                        }, 1000);
+                    }
+                };
+                media = new Media(mediaFile, successCallback, failed.bind(self, done, 'media1 = new Media - Error creating Media object. Media file: ' + mediaFile, context), statusChange);
+                media.play();
+            }, ACTUAL_PLAYBACK_TEST_TIMEOUT);
         });
 
         it("media.spec.18 should contain a setRate function", function () {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/2] cordova-plugin-media git commit: Cleanup pull requests. Close #23, Close #40, Close #55

Posted by pu...@apache.org.
Cleanup pull requests. Close #23, Close #40, Close #55


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/4321b3f0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/4321b3f0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/4321b3f0

Branch: refs/heads/master
Commit: 4321b3f075c5864d349561c02c8e68e08714f438
Parents: 9e137cc
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Sep 3 14:27:40 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 3 14:29:10 2015 -0700

----------------------------------------------------------------------
 RELEASENOTES.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/4321b3f0/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 2b9bc5e..f0f11ff 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -20,6 +20,7 @@
 -->
 # Release Notes
 
+
 ### 0.2.1 (Sept 5, 2013)
 * CB-4432 copyright notice change
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org