Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 29 days ago
JSON representation

Cordova Plugin Media Control

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; }>

--------------------