cordova-plugin-speaker

Speaker

Usage no npm install needed!

<script type="module">
  import cordovaPluginSpeaker from 'https://cdn.skypack.dev/cordova-plugin-speaker';
</script>

README

cordova-plugin-speaker

A multi-threaded non-blocking iOS 11+ plugin for toggling the device speaker and retrieving the current audio route.

Audio route will be: speaker, receiver or the actual name of the connected device such as "Bill's Airpods Pro".

Speaker.on(callbackHandler, errorHandler)
Speaker.off(callbackHandler, errorHandler)
Speaker.route(function(route) {
    console.log(route)
}, function(e) {
    console.log(e)
})