0.1.1 • Published 5 years ago
react-remote-screen-control v0.1.1
React remote screen control (rrsc)
Video demo
Live Demo
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);
...