You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by al...@apache.org on 2017/07/28 09:49:32 UTC
cordova-plugin-media git commit: CB-13028 (CI) Browser builds on
Travis and AppVeyor
Repository: cordova-plugin-media
Updated Branches:
refs/heads/master 5416e06d1 -> 02ff105d1
CB-13028 (CI) Browser builds on Travis and AppVeyor
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/02ff105d
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/02ff105d
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/02ff105d
Branch: refs/heads/master
Commit: 02ff105d1399c090fca87ddc63665e29b9e2a2b4
Parents: 5416e06
Author: Alexander Sorokin <al...@akvelon.com>
Authored: Fri Jul 28 10:09:43 2017 +0300
Committer: Alexander Sorokin <al...@akvelon.com>
Committed: Fri Jul 28 12:01:24 2017 +0300
----------------------------------------------------------------------
.appveyor.yml | 5 +++--
.travis.yml | 16 ++++++++++++++++
tests/tests.js | 8 +++++---
www/browser/Media.js | 32 +++++++++++++++++++++++++++++---
4 files changed, 53 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/02ff105d/.appveyor.yml
----------------------------------------------------------------------
diff --git a/.appveyor.yml b/.appveyor.yml
index 4cd6d53..6eea8b6 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -15,7 +15,8 @@ environment:
nodejs_version: "4"
matrix:
- PLATFORM: windows-10-store
-
+ JUST_BUILD: --justBuild
+ - PLATFORM: local\browser
install:
- npm cache clean -f
- node --version
@@ -25,4 +26,4 @@ install:
build: off
test_script:
- - cordova-paramedic --config pr\%PLATFORM% --plugin . --justBuild
+ - cordova-paramedic --config pr\%PLATFORM% --plugin . %JUST_BUILD%
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/02ff105d/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index ae04e78..7eef1cf 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,22 @@ env:
- TRAVIS_NODE_VERSION="4.2"
matrix:
include:
+ - env: PLATFORM=browser-chrome
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-firefox
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-safari
+ os: linux
+ language: node_js
+ node_js: '4.2'
+ - env: PLATFORM=browser-edge
+ os: linux
+ language: node_js
+ node_js: '4.2'
- env: PLATFORM=ios-9.3
os: osx
osx_image: xcode7.3
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/02ff105d/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index fa7c057..218f2a9 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -29,7 +29,8 @@ var ACTUAL_PLAYBACK_TEST_TIMEOUT = 2 * 60 * 1000;
var WEB_MP3_FILE = 'https://cordova.apache.org/downloads/BlueZedEx.mp3';
var WEB_MP3_STREAM = 'http://c22033-l.i.core.cdn.streamfarm.net/22033mdr/live/3087mdr_figaro/ch_classic_128.mp3';
-var isWindows = cordova.platformId == 'windows8' || cordova.platformId == 'windows';
+var isWindows = cordova.platformId === 'windows8' || cordova.platformId === 'windows';
+var isBrowser = cordova.platformId === 'browser';
// Detect whether audio hardware is available and enabled. For iOS playing audio is
// not supported on emulators w/out sound device connected to host PC but (which is
// the case for Sauce Labs emulators - see CB-11430)
@@ -418,8 +419,9 @@ exports.defineAutoTests = function () {
}, ACTUAL_PLAYBACK_TEST_TIMEOUT);
it("media.spec.25 should be able to play an audio stream", function (done) {
- // no audio hardware available
- if (!isAudioSupported) {
+ // no audio hardware available, OR
+ // O_o Safari can't play the stream, so we're skipping this test on all browsers o_O
+ if (!isAudioSupported || isBrowser) {
pending();
}
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/02ff105d/www/browser/Media.js
----------------------------------------------------------------------
diff --git a/www/browser/Media.js b/www/browser/Media.js
index 2e3da7f..633e425 100644
--- a/www/browser/Media.js
+++ b/www/browser/Media.js
@@ -49,8 +49,6 @@ var Media = function(src, successCallback, errorCallback, statusCallback) {
this._duration = -1;
this._position = -1;
- Media.onStatus(this.id, Media.MEDIA_STATE, Media.MEDIA_STARTING);
-
try {
this.node = createNode(this);
} catch (err) {
@@ -66,7 +64,7 @@ var Media = function(src, successCallback, errorCallback, statusCallback) {
function createNode (media) {
var node = new Audio();
- node.onloadstart = function () {
+ node.onplay = function () {
Media.onStatus(media.id, Media.MEDIA_STATE, Media.MEDIA_STARTING);
};
@@ -202,6 +200,34 @@ Media.prototype.stopRecord = function() {
};
/**
+ * Pause recording audio file.
+ */
+Media.prototype.pauseRecord = function() {
+ Media.onStatus(this.id, Media.MEDIA_ERROR, "Not supported");
+};
+
+/**
+ * Returns the current amplitude of the current recording.
+ */
+Media.prototype.getCurrentAmplitude = function() {
+ Media.onStatus(this.id, Media.MEDIA_ERROR, "Not supported");
+};
+
+/**
+ * Resume recording an audio file.
+ */
+Media.prototype.resumeRecord = function() {
+ Media.onStatus(this.id, Media.MEDIA_ERROR, "Not supported");
+};
+
+/**
+ * Set rate of an autio file.
+ */
+Media.prototype.setRate = function() {
+ Media.onStatus(this.id, Media.MEDIA_ERROR, "Not supported");
+};
+
+/**
* Release the resources.
*/
Media.prototype.release = function() {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org