1.0.9 • Published 6 years ago

react-live-assistant-officer v1.0.9

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

React Live Assistant Officer

React Live Assistant For Officer

Getting Started

$ npm install react-live-assistant-officer
$ const VideoCall = require('react-live-assistant-officer')

How to use

Insert this code in render

<VideoCall
  onHangUp={this.handleHangUp}
  onErrors={this.handleError}
  onCalling={this.handleVideoCall}
  onInComing={this.handleIncoming}
  onReload={this.handleReload}
  onlineStatus={onlineStatus}
  id='1'
  type='callcenter'
  zone={activeLang}
  videoWidth={400}
  videoHeight={536}
  delayAutoHangUp={30}
  delayAfterDisConnect={1.5}
  audio
  server={config.serverVideCall}
  videoUI={(myVideo, theirVideo, handleHangUp, handleAccept, inComingCall, talking) => {
    let btnControl = null
    if (inComingCall) btnControl = <button className='btn-accept' onClick={() => handleAccept()}><i className='icon-end-call' />Accept</button>
    if (talking) btnControl = <button className='btn-hangup' onClick={() => handleHangUp()}><i className='icon-end-call' />Hang Up</button>
    return (
      <div className='video-call-panel'>
        {myVideo()}
        {theirVideo()}
        <div className='control-container'>
          {btnControl}
        </div>
      </div>
    )
  }}
/>

CSS stylesheet \ css/style.css

Option

PropstypeDescription
onHangUpfunctioncallback for hangup
onErrorsfunctioncallback for erros return not-available, device, peer, user
onCallingfunctioncallback for compared and calling
onInComingfunctioncallback for have incoming call
onInComingfunctioncallback after reload component
onlineStatusboolenThis is online status get true or false
idstringThis is machine id
typestringThis is machine type ( callcenter )
zonearrayThis is machine zone. \ 'en', 'th' or 'department1', 'department2'
videoWidthnumbervideo width
videoHeightnumbervideo height
audiobooleantrue for enable audio
delayAutoHangUpnumberset time when not missed call, auto hangup
delayAfterDisConnectnumberset delay time after hangup
serverobjectconfig for call ip: 1 port: 9000 path: /peerjs debug: 3 protocol: http
videoUIfunctioncustom UI

Thank you for your suggestions!