yozkut commited on
Commit
59897e0
·
verified ·
1 Parent(s): 8b18b23

Sync from GitHub via hub-sync

Browse files
Files changed (1) hide show
  1. port_hf.js +3 -2
port_hf.js CHANGED
@@ -533,8 +533,6 @@ async function setupRobot() {
533
 
534
  robot.addEventListener('streaming', async () => {
535
  isStreaming = true;
536
- const videoEl = document.getElementById('rv-video');
537
- detachVideo = robot.attachVideo(videoEl);
538
  showRVState('rv-monitoring');
539
  populatePersonalities();
540
  startStreakTimer();
@@ -558,9 +556,12 @@ async function setupRobot() {
558
  async function startSession(robotId) {
559
  if (!robot || robot.state !== 'connected') return;
560
  try {
 
 
561
  await robot.startSession(robotId);
562
  } catch (e) {
563
  console.error('startSession failed:', e);
 
564
  }
565
  }
566
 
 
533
 
534
  robot.addEventListener('streaming', async () => {
535
  isStreaming = true;
 
 
536
  showRVState('rv-monitoring');
537
  populatePersonalities();
538
  startStreakTimer();
 
556
  async function startSession(robotId) {
557
  if (!robot || robot.state !== 'connected') return;
558
  try {
559
+ const videoEl = document.getElementById('rv-video');
560
+ detachVideo = robot.attachVideo(videoEl);
561
  await robot.startSession(robotId);
562
  } catch (e) {
563
  console.error('startSession failed:', e);
564
+ if (detachVideo) { detachVideo(); detachVideo = null; }
565
  }
566
  }
567