forked from phonegap/phonegap-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRemoteSound.js
More file actions
48 lines (43 loc) · 1.41 KB
/
Copy pathRemoteSound.js
File metadata and controls
48 lines (43 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* RemoteSound
* Implements the javascript access to the phonegap plugin for playing and loading remote sounds
* @author Olivier Brand
*/
/**
* @return the deviceInfo class instance
*/
var RemoteSound = function() {
};
/**
* Play a sound. Parameter is a URI called "soundName"
*
* @param successCallback
* The callback which will be called when directory listing is
* successful
* @param failureCallback
* The callback which will be called when directory listing encouters
* an error
*/
RemoteSound.prototype.playRemoteSound = function(params, successCallback,
failureCallback) {
return cordova.exec(successCallback, failureCallback, 'RemoteSound',
'playRemoteSound', [ params ], true);
};
/**
* Load and cache remote sounds. Parameter is a JSON Array of URLs pointing to sound assets
*
* @param successCallback
* The callback which will be called when directory listing is
* successful
* @param failureCallback
* The callback which will be called when directory listing encouters
* an error
*/
RemoteSound.prototype.loadRemoteSounds = function(params, successCallback,
failureCallback) {
return cordova.exec(successCallback, failureCallback, 'RemoteSound',
'loadRemoteSounds', [ params ], true);
};
cordova.addConstructor(function() {
cordova.addPlugin('remotesound', new RemoteSound());
});