4.82.0 • Published 10 months ago

youtube-demo-jewel v4.82.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Playground with AGORA (Simple Way)

this package simplify the using of agora so you don't have to know anything about tokens and channels you just have to return RootContainer and pass the correct parameters to it, and it's DONE!

hiiii

ROOTCONTAINER component

please make sure to name the parameters correctly like this:

{
  <RootContainer
    token="xxxxx"
    fetchRtmURL={'https://..../RtmToken'}
    callURL={'https://..../Call'}
    callChannelURL={'https://..../CallChannel'}
    endURL={'https://..../EndCall'}
    clientID={clientID}
    employeeID={employeeID}
    callTypeID={callTypeID}
    setCallReturnedObj={setcallObj}
    setErrorCallMsg={setErrorCallMsg}
    setReplyCallStatus={setReplyCallStatus}
    setReturnedCallChannelObj={setReturnedCallChannelObj}
    setErrorCallChannel={setErrorCallChannel}
    btnStyle={{
      backgroundColor: '#833dcc',
      margin: '10px',
      padding: '10px 20px',
      color: 'white',
      border: 'none',
      borderRadius: '5px',
      cursor: 'pointer',
    }}
    btnText="Root Dial 📞"
  />;
} // return a button with the provided Style and Text

Example:

import { useState } from 'react';
import { RootContainer } from 'youtube-demo-jewel';

function TestPackage() {
  const clientID = 25;
  const employeeID = 13;
  const callTypeID = 2;
  const [callObj, setcallObj] = useState(null);
  const [replyCallStatus, setReplyCallStatus] = useState(null);
  const [errorCallMsg, setErrorCallMsg] = useState(null);
  const [returnedCallChannelObj, setReturnedCallChannelObj] = useState('');
  const [errorCallChannel, setErrorCallChannel] = useState('');

  return (
    <div>
      <RootContainer
        token="274B0C41-0"
        fetchRtmURL={'https://..../RtmToken'}
        callURL={'https://..../Call'}
        callChannelURL={'https://..../CallChannel'}
        endURL={'https://..../EndCall'}
        clientID={clientID}
        employeeID={employeeID}
        callTypeID={callTypeID}
        setCallReturnedObj={setcallObj}
        setErrorCallMsg={setErrorCallMsg}
        setReplyCallStatus={setReplyCallStatus}
        setReturnedCallChannelObj={setReturnedCallChannelObj}
        setErrorCallChannel={setErrorCallChannel}
        btnStyle={{
          backgroundColor: '#833dcc',
          margin: '10px',
          padding: '10px 20px',
          color: 'white',
          border: 'none',
          borderRadius: '5px',
          cursor: 'pointer',
        }}
        btnText="Root Dial 📞"
      />
    </div>
  );
}

export default TestPackage;

More details if you need it

RTMCONTAINER component

please make sure to name the parameters correctly like this:

{
  <RtmContainer
    token="274B0C41-0"
    fetchRtmURL={fetchURL}
    callURL={callURL}
    callChannelURL={callChannelURL}
    clientID={clientID}
    employeeID={employeeID}
    callTypeID={callTypeID}
    setRtmReturnedObject={setRtmReturnedObj}
    setCallReturnedObj={setcallObj}
    setErrorCallMsg={setErrorCallMsg} //optional
    setReplyCallStatus={setReplyCallStatus}
    setRtcToken={setRtcToken} //optional
    setChannel={setChannel} //optional
    setReturnedCallChannelObj={setReturnedCallChannelObj} //optional
    setErrorCallChannel={setErrorCallChannel} //optional
    btnStyle={{
      backgroundColor: '#833dcc',
      margin: '10px',
      padding: '10px 20px',
      color: 'white',
      border: 'none',
      borderRadius: '5px',
      cursor: 'pointer',
    }}
    btnText="Dial 📞"
  />;
} // return a button with the provided Style and Text

RTCCONTAINER component

please make sure to name the parameters correctly like this:

{
  <RtcContainer
    uid={userid}
    rtcToken={rtcToken}
    appId={appid}
    channel={channel}
    callTypeId={callTypeID}
    setReply={setReply}
    setStatus={setStatus}
    endURL={endURL}
    callID={callID}
  />;
} // return video player with mute and speaker buttons

RTC Client

please make sure to name the parameters correctly like this:

{
  rtcClient();
} // return RTC client

RTM Token

please make sure to name the parameters correctly like this:

{
  rtmToken({
    fetchURL,
    clientID,
    employeeID,
    callTypeID,
    token,
    setReturnedObject,
  });
} // return nothing

RTM Client

please make sure to name the parameters correctly like this:

{
  rtmClient({ appId });
} // return RTM client

RTM LOGIN

please make sure to name the parameters correctly like this:

{
  rtmLogin({ rtmClient, uid, rtmToken });
} // return RTM login

Call

please make sure to name the parameters correctly like this:

{
  call({
    fetchURL,
    clientID,
    employeeID,
    callTypeID,
    token,
    setReturnedObject,
    setError,
    setReply,
  });
} // return nothing
// console.log(callObj, "call Object");
// console.log(errorCallMsg, "ERROR CALL MSG");
// console.log(replyCallStatus, "Reply Call Status (Refused, Calling,..)");
// console.log(rtcToken, "RTC TOKEN");

you can view the error by passing the setter [error, setError] and then you can view the error state

you can view the returned object by passing the setter [returnded, setReturnedObject] and then you can view the returnded state

you can view the status of the call (Calling, Refused, Going on,...) by passing the setter [reply, setReply] and then you can view the reply state

4.82.0

10 months ago

4.81.0

10 months ago

4.80.0

10 months ago

4.79.0

10 months ago

4.78.0

10 months ago

4.77.0

10 months ago

4.76.0

10 months ago

4.75.0

10 months ago

4.74.0

10 months ago

4.73.0

10 months ago

4.72.0

10 months ago

4.71.0

10 months ago

4.70.0

10 months ago

4.69.0

10 months ago

4.68.0

10 months ago

4.67.0

10 months ago

4.66.0

10 months ago

4.65.0

10 months ago

4.64.0

10 months ago

4.63.0

10 months ago

4.62.0

10 months ago

4.61.0

10 months ago

4.60.0

10 months ago

4.59.0

10 months ago

4.58.0

10 months ago

4.57.0

10 months ago

4.56.0

10 months ago

4.55.0

10 months ago

4.54.0

10 months ago

4.53.0

10 months ago

4.52.0

10 months ago

4.51.0

10 months ago

4.50.0

10 months ago

4.49.0

10 months ago

4.48.0

10 months ago

4.47.0

10 months ago

4.46.0

10 months ago

4.45.0

10 months ago

4.44.0

10 months ago

4.43.0

10 months ago

4.42.0

10 months ago

4.41.0

10 months ago

4.40.0

10 months ago

4.39.0

10 months ago

4.38.0

10 months ago

4.37.0

10 months ago

4.36.0

10 months ago

4.34.0

10 months ago

4.33.0

10 months ago

4.32.0

10 months ago

4.31.0

10 months ago

4.30.0

10 months ago

4.29.0

10 months ago

4.28.0

10 months ago

4.27.0

10 months ago

4.26.0

10 months ago

4.25.0

10 months ago

4.23.0

10 months ago

4.22.0

10 months ago

4.21.0

10 months ago

4.20.0

10 months ago

4.19.0

10 months ago

4.18.0

10 months ago

4.17.0

10 months ago

4.16.0

10 months ago

4.15.0

10 months ago

4.14.0

10 months ago

4.13.0

10 months ago

4.12.0

10 months ago

4.11.0

10 months ago

4.10.0

10 months ago

4.9.0

10 months ago

4.8.0

10 months ago

4.7.0

10 months ago

4.6.0

10 months ago

4.5.0

10 months ago

4.3.0

10 months ago

4.2.0

10 months ago

4.1.0

10 months ago

4.0.0

10 months ago

3.0.0

10 months ago

2.0.0

10 months ago

1.1.0

10 months ago

1.0.0

10 months ago

0.1.0

10 months ago