@livo-tv/sdk 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5332,6 +5332,14 @@ function studioMeetingFromRtk(raw) {
5332
5332
  await meeting.self.disableVideo?.();
5333
5333
  await meeting.self.enableVideo?.();
5334
5334
  }
5335
+ async function acceptAllowedStageIfOffAir() {
5336
+ if (currentStageStatus() !== "OFF_STAGE") return;
5337
+ if (meeting.self?.permissions?.stageAccess !== "ALLOWED") return;
5338
+ try {
5339
+ await meeting.stage?.requestAccess?.();
5340
+ } catch {
5341
+ }
5342
+ }
5335
5343
  async function runJoinStageAttempts() {
5336
5344
  let lastError;
5337
5345
  for (let attempt = 0; attempt < STAGE_JOIN_MAX_ATTEMPTS; attempt++) {
@@ -5340,6 +5348,11 @@ function studioMeetingFromRtk(raw) {
5340
5348
  return;
5341
5349
  }
5342
5350
  try {
5351
+ await acceptAllowedStageIfOffAir();
5352
+ if (currentStageStatus() === "ON_STAGE") {
5353
+ notifyStage();
5354
+ return;
5355
+ }
5343
5356
  await meeting.stage?.join?.();
5344
5357
  joinedStageLocally = true;
5345
5358
  await republishCameraIfOn();
@@ -5592,6 +5605,10 @@ function studioMeetingFromRtk(raw) {
5592
5605
  async setStageAccess(userId, on) {
5593
5606
  const target = findByUserId(meeting, userId);
5594
5607
  if (isRecorder(target)) return;
5608
+ if (on && meeting.self?.userId === userId && meeting.self?.permissions?.stageAccess === "ALLOWED") {
5609
+ await joinStageWithRetry();
5610
+ return;
5611
+ }
5595
5612
  if (on) await meeting.stage?.grantAccess?.([userId]);
5596
5613
  else await meeting.stage?.kick?.([userId]);
5597
5614
  notifyStage();