npm

cordova-plugin-media-control

1.0.5 • Public • Published

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
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
  console.log(MediaControls);
}
  • Ionic
/* Create interface for working */
window.MediaControls.setModeAudio(...) 

Install Ionic / Cordova

  • Cordova
npm i cordova-plugin-media-control
cordova plugin add cordova-plugin-media-control
  • Ionic
npm i cordova-plugin-media-control
npx cap sync

Permissions Android

<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

API

setModeAudio(...)

setModeAudio(mode: string) => Promise<{ state: boolean; }>
Param Type Description
mode string Value speaker for active Speaker or normal for disabled

Returns: Promise<{ state: boolean; }>


Package Sidebar

Install

npm i cordova-plugin-media-control

Weekly Downloads

18

Version

1.0.5

License

ISC

Unpacked Size

19.6 kB

Total Files

8

Last publish

Collaborators

  • inteapps