https://github.com/mediakitapp/cordova-plugin-mediacontrol
Cordova Plugin Media Control
https://github.com/mediakitapp/cordova-plugin-mediacontrol
android cordova cordova-plugin ionic ios javascript nodejs
Last synced: about 1 month ago
JSON representation
Cordova Plugin Media Control
- Host: GitHub
- URL: https://github.com/mediakitapp/cordova-plugin-mediacontrol
- Owner: MediaKitApp
- License: apache-2.0
- Created: 2022-12-15T13:30:13.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-21T14:51:35.000Z (over 2 years ago)
- Last Synced: 2025-08-21T20:18:35.910Z (3 months ago)
- Topics: android, cordova, cordova-plugin, ionic, ios, javascript, nodejs
- Language: Java
- Homepage: https://www.inteapps.com/
- Size: 18.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cordova Plugin Media Controls
Enable speaker mode and correctly display the multimedia volume when lowering or raising.
Although the object is attached to the global scoped `window`, it is not available until after the `deviceready` event.
* Cordova
```js
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log(MediaControls);
}
```
* Ionic
```js
/* Create interface for working */
window.MediaControls.setModeAudio(...)
```
## Install Ionic / Cordova
* Cordova
```bash
npm i cordova-plugin-media-control
cordova plugin add cordova-plugin-media-control
```
* Ionic
```bash
npm i cordova-plugin-media-control
npx cap sync
```
# Permissions Android
```xml
```
## API
* [`MediaControls.setModeAudio(...)`](#setmodeaudio)
### setModeAudio(...)
```typescript
setModeAudio(mode: string) => Promise<{ state: boolean; }>
```
| Param | Type | Description |
| ------------- | ------------------------------ | -------------------------------- |
| **`mode`** | string | Value speaker for active Speaker or normal for disabled
**Returns:** Promise<{ state: boolean; }>
--------------------