问题描述
我目前正在使用 Andy 的 SimpleWebRTC 开发一个直播平台,我正在尝试创建一个任何加入直播的人都可以看到的计时器。我正在使用反应复合计时器。计时器需要跨多个浏览器同步,但我目前只能让它在本地工作。如果有人对 SimpleWebRTC 或一般的 WebRTC 有经验,我将不胜感激。
<Timer
initialTime={0}
startImmediately={false}
onStart={() => console.log('onStart hook')}
onStop={() => console.log('onStop hook')}
onReset={() => console.log('onReset hook')}
>
{({ start,stop,reset } : any) => (
<React.Fragment>
<div>
<Timer.Minutes /> minutes
<Timer.Seconds /> seconds
<br />
<TimerButton onClick={start}>Start</TimerButton>
<TimerButton onClick={stop}>Stop</TimerButton>
<TimerButton onClick={reset}>Reset</TimerButton>
</div>
</React.Fragment>
)}
</Timer>
你可以找到原github here。我项目中的计时器位于 Sidebar.tsx
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)