@scarlett-player/embed 0.4.0 → 0.4.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.
@@ -144,6 +144,9 @@ function setupVideoEventHandlers(video, api) {
144
144
  video.addEventListener(event, handler);
145
145
  handlers.push({ event, handler });
146
146
  };
147
+ addHandler("play", () => {
148
+ api.setState("paused", false);
149
+ });
147
150
  addHandler("playing", () => {
148
151
  api.setState("playing", true);
149
152
  api.setState("paused", false);
@@ -608,6 +611,20 @@ function createHLSPlugin(config) {
608
611
  if (!isNaN(levelIndex) && levelIndex >= 0 && levelIndex < hls.levels.length) {
609
612
  hls.nextLevel = levelIndex;
610
613
  api?.logger.debug(`Quality: queued switch to level ${levelIndex}`);
614
+ const targetLevel = hls.levels[levelIndex];
615
+ if (targetLevel) {
616
+ const label = formatLevel(targetLevel);
617
+ api?.setState("currentQuality", {
618
+ id: `level-${levelIndex}`,
619
+ label: `${label}...`,
620
+ // Ellipsis indicates switching in progress
621
+ width: targetLevel.width,
622
+ height: targetLevel.height,
623
+ bitrate: targetLevel.bitrate,
624
+ active: false
625
+ // Not yet active
626
+ });
627
+ }
611
628
  }
612
629
  }
613
630
  });