Skip to content

Commit 1da65f2

Browse files
alsorokinBuddy Reno
authored andcommitted
CB-13028 (CI) Browser builds on Travis and AppVeyor
1 parent cc80954 commit 1da65f2

File tree

4 files changed

+53
-8
lines changed

4 files changed

+53
-8
lines changed

.appveyor.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ environment:
1515
nodejs_version: "4"
1616
matrix:
1717
- PLATFORM: windows-10-store
18-
18+
JUST_BUILD: --justBuild
19+
- PLATFORM: local\browser
1920
install:
2021
- npm cache clean -f
2122
- node --version
@@ -25,4 +26,4 @@ install:
2526
build: off
2627

2728
test_script:
28-
- cordova-paramedic --config pr\%PLATFORM% --plugin . --justBuild
29+
- cordova-paramedic --config pr\%PLATFORM% --plugin . %JUST_BUILD%

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ env:
88
- TRAVIS_NODE_VERSION="4.2"
99
matrix:
1010
include:
11+
- env: PLATFORM=browser-chrome
12+
os: linux
13+
language: node_js
14+
node_js: '4.2'
15+
- env: PLATFORM=browser-firefox
16+
os: linux
17+
language: node_js
18+
node_js: '4.2'
19+
- env: PLATFORM=browser-safari
20+
os: linux
21+
language: node_js
22+
node_js: '4.2'
23+
- env: PLATFORM=browser-edge
24+
os: linux
25+
language: node_js
26+
node_js: '4.2'
1127
- env: PLATFORM=ios-9.3
1228
os: osx
1329
osx_image: xcode7.3

tests/tests.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ var ACTUAL_PLAYBACK_TEST_TIMEOUT = 2 * 60 * 1000;
2929
var WEB_MP3_FILE = 'https://cordova.apache.org/downloads/BlueZedEx.mp3';
3030
var WEB_MP3_STREAM = 'http://c22033-l.i.core.cdn.streamfarm.net/22033mdr/live/3087mdr_figaro/ch_classic_128.mp3';
3131

32-
var isWindows = cordova.platformId == 'windows8' || cordova.platformId == 'windows';
32+
var isWindows = cordova.platformId === 'windows8' || cordova.platformId === 'windows';
33+
var isBrowser = cordova.platformId === 'browser';
3334
// Detect whether audio hardware is available and enabled. For iOS playing audio is
3435
// not supported on emulators w/out sound device connected to host PC but (which is
3536
// the case for Sauce Labs emulators - see CB-11430)
@@ -418,8 +419,9 @@ exports.defineAutoTests = function () {
418419
}, ACTUAL_PLAYBACK_TEST_TIMEOUT);
419420

420421
it("media.spec.25 should be able to play an audio stream", function (done) {
421-
// no audio hardware available
422-
if (!isAudioSupported) {
422+
// no audio hardware available, OR
423+
// O_o Safari can't play the stream, so we're skipping this test on all browsers o_O
424+
if (!isAudioSupported || isBrowser) {
423425
pending();
424426
}
425427

www/browser/Media.js

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ var Media = function(src, successCallback, errorCallback, statusCallback) {
4949
this._duration = -1;
5050
this._position = -1;
5151

52-
Media.onStatus(this.id, Media.MEDIA_STATE, Media.MEDIA_STARTING);
53-
5452
try {
5553
this.node = createNode(this);
5654
} catch (err) {
@@ -66,7 +64,7 @@ var Media = function(src, successCallback, errorCallback, statusCallback) {
6664
function createNode (media) {
6765
var node = new Audio();
6866

69-
node.onloadstart = function () {
67+
node.onplay = function () {
7068
Media.onStatus(media.id, Media.MEDIA_STATE, Media.MEDIA_STARTING);
7169
};
7270

@@ -201,6 +199,34 @@ Media.prototype.stopRecord = function() {
201199
Media.onStatus(this.id, Media.MEDIA_ERROR, "Not supported");
202200
};
203201

202+
/**
203+
* Pause recording audio file.
204+
*/
205+
Media.prototype.pauseRecord = function() {
206+
Media.onStatus(this.id, Media.MEDIA_ERROR, "Not supported");
207+
};
208+
209+
/**
210+
* Returns the current amplitude of the current recording.
211+
*/
212+
Media.prototype.getCurrentAmplitude = function() {
213+
Media.onStatus(this.id, Media.MEDIA_ERROR, "Not supported");
214+
};
215+
216+
/**
217+
* Resume recording an audio file.
218+
*/
219+
Media.prototype.resumeRecord = function() {
220+
Media.onStatus(this.id, Media.MEDIA_ERROR, "Not supported");
221+
};
222+
223+
/**
224+
* Set rate of an autio file.
225+
*/
226+
Media.prototype.setRate = function() {
227+
Media.onStatus(this.id, Media.MEDIA_ERROR, "Not supported");
228+
};
229+
204230
/**
205231
* Release the resources.
206232
*/

0 commit comments

Comments
 (0)