# cordova-plugin-media-danding

> --- title: cordova-media-danding description: Record and play audio on the device.

Latest version **1.0.1** (published 2016-11-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-media-danding
pnpm add cordova-plugin-media-danding
yarn add cordova-plugin-media-danding
bun add cordova-plugin-media-danding
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-11-11 |
| First published | 2016-11-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | danding |
| Maintainers | danding |
| Keywords | cordova, media, danding |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-media-danding
- npm.io page: https://npm.io/package/cordova-plugin-media-danding

## Recent versions

- 1.0.1 (latest) — 2016-11-11
- 1.0.0 — 2016-11-11

## README

---
title: cordova-media-danding
description: Record and play audio on the device.


# cordova-plugin-media


This plugin provides the ability to record and play back audio files on a device.

__NOTE__: The current implementation does not adhere to a W3C
specification for media capture, and is provided for convenience only.
A future implementation will adhere to the latest W3C specification
and may deprecate the current APIs.

This plugin defines a global `Media` Constructor.

Although in the global scope, it is not available until after the `deviceready` event.

```js
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
    console.log(Media);
}
```



## Installation

```bash
cordova plugin add cordova-plugin-media
```

## Supported Platforms

- Android
- BlackBerry 10
- iOS
- Windows Phone 7 and 8
- Tizen
- Windows 8
- Windows
- Browser

## Media

```js
var media = new Media(src, mediaSuccess, [mediaError], [mediaStatus]);
```

### Methods

- `media.getCurrentAmplitude`: Returns the current position within an audio file.

- `media.getAudioFullPath`: return the tempfile path in android platform

- `media.getCurrentPosition`: Returns the current position within an audio file.

- `media.getDuration`: Returns the duration of an audio file.

- `media.play`: Start or resume playing an audio file.

- `media.pause`: Pause playback of an audio file.

- `media.pauseRecord`: Pause recording of an audio file.

- `media.release`: Releases the underlying operating system's audio resources.

- `media.resumeRecord`: Resume recording of an audio file.

- `media.seekTo`: Moves the position within the audio file.

- `media.setVolume`: Set the volume for audio playback.

- `media.startRecord`: Start recording an audio file.

- `media.stopRecord`: Stop recording an audio file.

- `media.stop`: Stop playing an audio file.

### Additional ReadOnly Parameters

- __position__: The position within the audio playback, in seconds.
    - Not automatically updated during play; call `getCurrentPosition` to update.

- __duration__: The duration of the media, in seconds.


## media.getCurrentAmplitude

Returns the current amplitude of the current recording.

    media.getCurrentAmplitude(mediaSuccess, [mediaError]);

### Supported Platforms

- Android
- iOS

---
_Source: https://npm.io/package/cordova-plugin-media-danding · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
