@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.
@@ -5308,6 +5308,14 @@ function studioMeetingFromRtk(raw) {
5308
5308
  await meeting.self.disableVideo?.();
5309
5309
  await meeting.self.enableVideo?.();
5310
5310
  }
5311
+ async function acceptAllowedStageIfOffAir() {
5312
+ if (currentStageStatus() !== "OFF_STAGE") return;
5313
+ if (meeting.self?.permissions?.stageAccess !== "ALLOWED") return;
5314
+ try {
5315
+ await meeting.stage?.requestAccess?.();
5316
+ } catch {
5317
+ }
5318
+ }
5311
5319
  async function runJoinStageAttempts() {
5312
5320
  let lastError;
5313
5321
  for (let attempt = 0; attempt < STAGE_JOIN_MAX_ATTEMPTS; attempt++) {
@@ -5316,6 +5324,11 @@ function studioMeetingFromRtk(raw) {
5316
5324
  return;
5317
5325
  }
5318
5326
  try {
5327
+ await acceptAllowedStageIfOffAir();
5328
+ if (currentStageStatus() === "ON_STAGE") {
5329
+ notifyStage();
5330
+ return;
5331
+ }
5319
5332
  await meeting.stage?.join?.();
5320
5333
  joinedStageLocally = true;
5321
5334
  await republishCameraIfOn();
@@ -5568,6 +5581,10 @@ function studioMeetingFromRtk(raw) {
5568
5581
  async setStageAccess(userId, on) {
5569
5582
  const target = findByUserId(meeting, userId);
5570
5583
  if (isRecorder(target)) return;
5584
+ if (on && meeting.self?.userId === userId && meeting.self?.permissions?.stageAccess === "ALLOWED") {
5585
+ await joinStageWithRetry();
5586
+ return;
5587
+ }
5571
5588
  if (on) await meeting.stage?.grantAccess?.([userId]);
5572
5589
  else await meeting.stage?.kick?.([userId]);
5573
5590
  notifyStage();