alongubkin / alongubkin/audiotoggle

minor changes to JS to suit my app development platform

オープン
#6 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
47
フォーク
77
PR マージ指標
30日以内にマージされた PR はありません

説明

hi,

Thanks a lot for the plugin. I am a NOOB to java / cordova and I have some difficulty in getting this plugin to work. I use a mobile app development platform. I have other plugins working and here is the sample of a JS file / plugin that works

```
cordova.define("com.badrit.MacAddress", function(require, exports, module) {

/*
* MacAddress
* Implements the javascript access to the cordova plugin for retrieving the device mac address. Returns 0 if not running on Android
* @author Olivier Brand
*/

/**
* @return the mac address class instance
*/
var MacAddress = {

getMacAddress: function(successCallback, failureCallback){
cordova.exec(successCallback, failureCallback, 'MacAddressPlugin',
'getMacAddress', []);
}
};

cordova.addConstructor(function () {
if (!window.plugins) {
window.plugins = {};
}

window.plugins.MacAddress = MacAddress;
return window.plugins.MacAddress;
});
});
```

And here is the code in your plugin / JS file

```
var exec = require('cordova/exec');

exports.SPEAKER = 'speaker';
exports.EARPIECE = 'earpiece';
exports.NORMAL = 'normal';
exports.RINGTONE = 'ringtone';

exports.setAudioMode = function (mode) {
cordova.exec(null, null, 'AudioTogglePlugin', 'setAudioMode', [mode]);
};
```

Is it possible to change the JS in your plugin to suit my platform? If you could help in any way that'll be great. Mainly the part I couldn't understand was the exports / parameters below

```
exports.SPEAKER = 'speaker';
exports.EARPIECE = 'earpiece';
exports.NORMAL = 'normal';
exports.RINGTONE = 'ringtone';
```

Thanks once again,
M&M

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。