Skip to content

eworx-org/av-audio-session-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

av-audio-session-adapter

The AVAudioSessionAdapter is an iOS specific cordova plugin, that exposes functionality of the AVAudioSession singleton instance. It is usefull to applications that require to implement advanced use-cases of media handling (play/record etc. For more information on AVAudioSession, view the Apple Documentation)

The following functions are supported:

  • getCategory(successCallback)

    Returns the current category value of the AVAudioSession, as a parameter to the registered callback.

  • getCategoryOptions(successCallback)

    Returns the current categoryOptions value of the AVAudioSession, as a parameter to the registered callback.

  • setCategory(category, successCallback, errorCallback)

    Sets the category of the AVAudioSession to the given value.

  • setCategoryWithOptions(category, categoryOptions, successCallback, errorCallback)

    Sets the category and categoryOptions of the AVAudioSession to the given values.

A typical usage is as follows:

var AVAudioSessionAdapter = gr.eworx.AVAudioSessionAdapter;
var audioSession = new AVAudioSessionAdapter();
audioSession.setCategoryWithOptions(
    AVAudioSessionAdapter.Categories.PLAY_AND_RECORD,
	AVAudioSessionAdapter.CategoryOptions.MIX_WITH_OTHERS,
	function() {
		// Do something on success.
	}, 
    function() {
		// Handle the error.
	}
);
audioSession.getCategory(
	function(category) {
    	// Do something with category value.
    }
);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published