GithubHelp home page GithubHelp logo

mobile_apps_pfisterer's Introduction

alt text

cordova-media-plugin

This plugin provides the ability to play audio files on a device. This plugin defines a global Media Constructor. Although in the global scope, it is not available until after the deviceready event.

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

Object Media

var media = new Media(src, mediaSuccess, [mediaError], [mediaStatus]);
  • src: A URI containing the audio content. (DOMString)
  • mediaSuccess: (Optional) The callback that executes after a Media object has completed the current play, record, or stop action. (Function)
  • mediaError: (Optional) The callback that executes if an error occurs. (Function)
  • mediaStatus: (Optional) The callback that executes to indicate status changes. (Function)

Constants

The following constants are reported as the only parameter to the mediaStatus callback:

  • Media.MEDIA_NONE = 0;
  • Media.MEDIA_STARTING = 1;
  • Media.MEDIA_RUNNING = 2;
  • Media.MEDIA_PAUSED = 3;
  • Media.MEDIA_STOPPED = 4;

Methods

  • media.getCurrentAmplitude: Returns the current position within an audio file.
  • 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.

For further information visit the Cordova Documentation

mobile_apps_pfisterer's People

Contributors

schustern avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.