Coder Social home page Coder Social logo

atlanteh / cordova-plugin-media_with_setaudiostreamtype Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apache/cordova-plugin-media

0.0 1.0 2.0 525 KB

Cordova plugin media with ability to change setAudioStreamType

License: Apache License 2.0

Java 20.81% JavaScript 36.72% Objective-C 16.84% C++ 4.98% C# 20.65%

cordova-plugin-media_with_setaudiostreamtype's Introduction

cordova-plugin-media-with-setAudioStreamType

Fork of Media plugin with adding ability to change media play type: Ring, Music, Notification, system

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

Supported Platforms

  • Android
  • Browser

#Additional static methods available on Android:

  • Media.mute_microphone(true); //mic muted
  • Media.mute_microphone(false); //mic not muted
  • Media.mute_stream(streamType);
  • Media.mute_stream("music"); // music stream muted // new same call unmute stream

Stream Types avialable

  • notification
  • alarm (The audio stream for alarms)
  • dtmf (The audio stream for DTMF Tones)
  • music (The audio stream for music playback
  • notification (The audio stream for notifications)
  • ring (The audio stream for the phone ring)
  • system (The audio stream for system sounds)
  • voice_call

Example

var incomingCallSound = new Media(src, mediaSuccess, [mediaErrorCB], [mediaStatusCB], streamType);  
//or use static method before object created
Media.setStreamType ="music";

Parameters

  • 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)

  • streamType: (Optional) StreamType setting. (String)

// Avialable stream types:
//alarm	(The audio stream for alarms)
//dtmf	(The audio stream for DTMF Tones)
//music	(The audio stream for music playback
//notification (The audio stream for notifications)
//ring	(The audio stream for the phone ring)
//system	(The audio stream for system sounds)
//voice_call

//OPTION 1:  You should call setStreamType before create an media object
Media.setStreamType("music");
var my_media = new Media('cdvfile://localhost/temporary/recording.mp3', ...);
//OPTION 2: You can set streamType by type paramert of constructor 
var incomingCallSound = new Media(src, mediaSuccess, [mediaErrorCB], [mediaStatusCB], streamType);  

###install PhoneGap build or Cordova cli: (add to config.xml)

all others features one by one forked from cordova-plugin-media 2.2.1

cordova-plugin-media_with_setaudiostreamtype's People

Contributors

agrieve avatar alsorokin avatar bennmapes avatar cfjedimaster avatar clelland avatar cmarcelk avatar dblotsky avatar eworx avatar ghenry22 avatar hansmi avatar hardeep avatar hermwong avatar infil00p avatar jarivas avatar javierbb31 avatar ldeluca avatar mariabukharina avatar martincgg avatar mwoghiren avatar nikhilkh avatar purplecabbage avatar riknoll avatar sgrebnov avatar shazron avatar siovene avatar stevengill avatar t1st3 avatar timkim avatar uareurapid avatar zaspire avatar

Watchers

 avatar

Forkers

oseloka

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.