0.1.1 • Published 4 years ago

react-remote-screen-control v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

React remote screen control (rrsc)

Video demo

YouTube

Live Demo

Remote user
Admin

How to use?

Default connection plate component:

import {RrscPlate} from "rrsc";
...
    <RrscPlate
      normalCursorKey={/* keycode for showing mouse cursor (not required) */}
      videoContainer={/* HOC for video (not required) */}
      videoProps={/* props for video (not required) */}
      isAbleCall={/* define if user is admin */}
      server={/* server_url */}
    />
...

Create your own component via HOC:

import {withRRSC} from "rrsc";
...
    const MyComponent = 
      ({
       rrscMyId,
       rrscContrUserId,
       rrscSetContrUserId,
       rrscAskContrUser,
       rrscIsStreaming,
       rrscDisconnect,
       isAbleCall
     }) => 
      <div>
        <div>My id: {rrscMyId}</div>
          {
            isAbleCall &&
              <>
                <input
                  value={rrscContrUserId}
                  onChange={e => rrscSetContrUserId(e.target.value)}
                  disabled={rrscIsStreaming}
                />
                {!rrscIsStreaming && (
                  <button disabled={!rrscContrUserId} onClick={rrscAskContrUser}>
                    call
                  </button>
                )}
              </>
          }
          {rrscIsStreaming && (
            <button onClick={rrscDisconnect}>disconnect</button>
          )}
      </div>;

    const MyRRSCPlate = withRRSC(MyComponent);
...
0.1.1

4 years ago

0.1.0

4 years ago