SimpleWebRTC 同步定时器

问题描述

我目前正在使用 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> 
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <Timer.Minutes /> minutes 
                      &nbsp;
                      &nbsp;
                      <Timer.Seconds /> seconds
                      <br />   
                      &nbsp;
                      &nbsp;
                      <TimerButton onClick={start}>Start</TimerButton>
                      &nbsp;
                      &nbsp;
                      <TimerButton onClick={stop}>Stop</TimerButton>
                      &nbsp;
                      &nbsp;
                      <TimerButton onClick={reset}>Reset</TimerButton>
                  </div>
              </React.Fragment>
          )}
        </Timer> 
      

你可以找到原github here。我项目中的计时器位于 Sidebar.tsx

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...