Git Product home page Git Product logo

flutter-incall-manager's Introduction

flutter-incall-manager

#change react-native-incall-manager to flutter-incall-manager

#react-native-incall-manager url https://github.com/zxcpoiu/react-native-incall-manager

#Handling media-routes/sensors/events during a audio/video chat on Flutter

API:

Methods

Method android ios description
start({media: ?string, auto: ?boolean, ringback: ?string}) ๐Ÿ˜„ ๐Ÿ˜„ start incall manager.
ringback accept non-empty string or it won't play
default: {media:'audio', auto: true, ringback: ''}
stop({busytone: ?string}) ๐Ÿ˜„ ๐Ÿ˜„ stop incall manager
busytone accept non-empty string or it won't play
default: {busytone: ''}
turnScreenOn() ๐Ÿ˜„ ๐Ÿ˜ก force turn screen on
turnScreenOff() ๐Ÿ˜„ ๐Ÿ˜ก force turn screen off
setKeepScreenOn(enable: ?boolean) ๐Ÿ˜„ ๐Ÿ˜„ set KeepScreenOn flag = true or false
default: false
setSpeakerphoneOn(enable: ?boolean) ๐Ÿ˜„ ๐Ÿ˜ก toggle speaker ON/OFF once. but not force
default: false
setForceSpeakerphoneOn(flag: ?boolean) ๐Ÿ˜„ ๐Ÿ˜„ true -> force speaker on
false -> force speaker off
null -> use default behavior according to media type
default: null
setMicrophoneMute(enable: ?boolean) ๐Ÿ˜„ ๐Ÿ˜ก mute/unmute micophone
default: false
p.s. if you use webrtc, you can just use track.enabled = false to mute
async checkRecordPermission() ๐Ÿ˜„ ๐Ÿ˜„ check record permission without promt. return Promise. see about permission section above
async requestRecordPermission() ๐Ÿ˜„ ๐Ÿ˜„ request record permission to user. return Promise. see about permission section above
async getAudioUriJS() ๐Ÿ˜„ ๐Ÿ˜„ get audio Uri path. this would be useful when you want to pass Uri into another module.
startRingtone(ringtone: string, ?vibrate_pattern: array, ?ios_category: string, ?seconds: number) ๐Ÿ˜„ ๐Ÿ˜„ play ringtone.
ringtone: 'DEFAULT' or 'BUNDLE'
vibrate_pattern: same as RN, but does not support repeat
ios_category: ios only, if you want to use specific audio category
seconds: android only, specify how long do you want to play rather than play once nor repeat. in sec.
stopRingtone() ๐Ÿ˜„ ๐Ÿ˜„ stop play ringtone if previous started via startRingtone()
stopRingback() ๐Ÿ˜„ ๐Ÿ˜„ stop play ringback if previous started via start()
setFlashOn(enable: ?boolean, brightness: ?number) ๐Ÿ˜ก ๐Ÿ˜„ set flash light on/off
async getIsWiredHeadsetPluggedIn() ๐Ÿ˜ก ๐Ÿ˜„ return wired headset plugged in state

Events

Event android ios description
'Proximity' ๐Ÿ˜„ ๐Ÿ˜„ proximity sensor detected changes.
data: {'isNear': boolean}
'WiredHeadset' ๐Ÿ˜„ ๐Ÿ˜„ fire when wired headset plug/unplug
data: {'isPlugged': boolean, 'hasMic': boolean, 'deviceName': string }
'NoisyAudio' ๐Ÿ˜„ ๐Ÿ˜ก see andriod doc.
data: null
'MediaButton' ๐Ÿ˜„ ๐Ÿ˜ก when external device controler pressed button. see android doc
data: {'eventText': string, 'eventCode': number }
'onAudioFocusChange' ๐Ÿ˜„ ๐Ÿ˜ก see andriod doc
data: {'eventText': string, 'eventCode': number }

flutter-incall-manager's People

Contributors

kangshaojun avatar mralek 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.