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:17:24 UTC

[1/4] cordova-plugin-media git commit: CB-9605 Fixes issue with playback resume after pause on WP8

Repository: cordova-plugin-media
Updated Branches:
  refs/heads/master 6c1a0ec7e -> c9ca8a63e


CB-9605 Fixes issue with playback resume after pause on WP8


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/b4f1254c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/b4f1254c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/b4f1254c

Branch: refs/heads/master
Commit: b4f1254c66a9c15c0a6a0254f7af0127000c08f4
Parents: b992df3
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Thu Sep 3 13:32:10 2015 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Thu Sep 3 13:53:52 2015 +0300

----------------------------------------------------------------------
 src/wp/AudioPlayer.cs |  2 +-
 tests/tests.js        | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/b4f1254c/src/wp/AudioPlayer.cs
----------------------------------------------------------------------
diff --git a/src/wp/AudioPlayer.cs b/src/wp/AudioPlayer.cs
index b0d2be3..2736651 100644
--- a/src/wp/AudioPlayer.cs
+++ b/src/wp/AudioPlayer.cs
@@ -277,7 +277,7 @@ namespace WPCordovaClassLib.Cordova.Commands
             }
 
 
-            if (this.player == null || this.player.Source.AbsolutePath.LastIndexOf(filePath) < 0)
+            if (this.player == null || this.player.Source.AbsoluteUri.LastIndexOf(filePath) < 0)
             {
                 try
                 {

http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/b4f1254c/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 8f54a9e..068d604 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -257,6 +257,44 @@ 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.20 should be able to resume playback after pause", 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 resumed = false;
+                var mediaFile = 'http://cordova.apache.org/downloads/BlueZedEx.mp3';
+                var successCallback = function () { };
+                var statusChange = function (statusCode) {
+                    if (context.done) return;
+
+                    if (statusCode == Media.MEDIA_RUNNING) {
+                        if (!resumed) {
+                            media.seekTo(20000);
+                            media.pause();
+                            return;
+                        }
+
+                        media.getCurrentPosition(function (position) {
+                            expect(position).toBe(20);
+                            context.done = true;
+                            done();
+                        }, failed.bind(null, done, 'media1.getCurrentPosition - Error getting media current position', context))
+                    }
+
+                    if (statusCode == Media.MEDIA_PAUSED) {
+                        resumed = true;
+                        media.play();
+                    }
+                };
+                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


[4/4] cordova-plugin-media git commit: Merge branch 'CB-9605' of https://github.com/MSOpenTech/cordova-plugin-media

Posted by pu...@apache.org.
Merge branch 'CB-9605' of https://github.com/MSOpenTech/cordova-plugin-media


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/c9ca8a63
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/c9ca8a63
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/c9ca8a63

Branch: refs/heads/master
Commit: c9ca8a63e14f4b00f6b4801d82879ee6a06a3994
Parents: 3dae473 b4f1254
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Sep 3 14:15:52 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 3 14:15:52 2015 -0700

----------------------------------------------------------------------
 src/wp/AudioPlayer.cs |  2 +-
 tests/tests.js        | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 1 deletion(-)
----------------------------------------------------------------------



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


[2/4] cordova-plugin-media git commit: Merge branch 'master' of https://github.com/uareurapid/cordova-plugin-media

Posted by pu...@apache.org.
Merge branch 'master' of https://github.com/uareurapid/cordova-plugin-media


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/9a5e4708
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/9a5e4708
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/9a5e4708

Branch: refs/heads/master
Commit: 9a5e47088e7dacd6fe70ece0f2b3de792a9ac2e0
Parents: b992df3 f977aa7
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Sep 3 13:02:38 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 3 13:02:38 2015 -0700

----------------------------------------------------------------------
 src/android/AudioPlayer.java | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



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


[3/4] cordova-plugin-media git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-media

Posted by pu...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/cordova-plugin-media


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/3dae473d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/3dae473d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/3dae473d

Branch: refs/heads/master
Commit: 3dae473d4bef7019f3302f89b2543d3081e04ba9
Parents: 9a5e470 6c1a0ec
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Sep 3 14:14:58 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 3 14:14:58 2015 -0700

----------------------------------------------------------------------

----------------------------------------------------------------------



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