videojs/video.js · warning · Error

Rejection at manualAutoplay. Restoring muted value. ${err ?

Error message

Rejection at manualAutoplay. Restoring muted value. ${err ? err : ''}

What it means

During the muted-autoplay fallback path, video.js calls play() while temporarily unmuting; if that play() promise rejects (browser autoplay policy), it restores the original muted value and rethrows wrapped in this message. The error is informational — the player returns to its prior state — but it surfaces the rejection so callers can react.

Source

Thrown at src/js/player.js:1535

      this.muted(true);

      const restoreMuted = () => {
        this.muted(previouslyMuted);
      };

      // restore muted on play terminatation
      this.playTerminatedQueue_.push(restoreMuted);

      const mutedPromise = this.play();

      if (!isPromise(mutedPromise)) {
        return;
      }

      return mutedPromise.catch(err => {
        restoreMuted();
        throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${err ? err : ''}`);
      });
    };

    let promise;

    // if muted defaults to true
    // the only thing we can do is call play
    if (type === 'any' && !this.muted()) {
      promise = this.play();

      if (isPromise(promise)) {
        promise = promise.catch(resolveMuted);
      }
    } else if (type === 'muted' && !this.muted()) {
      promise = resolveMuted();
    } else {
      promise = this.play();
    }

View on GitHub (pinned to c3a7e0e6d2)

Solutions

  1. Catch the rejection at the call site: const p = player.play(); if (p) p.catch(() => {/* show play button */});
  2. Ensure the media element is actually muted before relying on muted autoplay, and the iframe has allow='autoplay'.
  3. Provide a visible play button UI as a fallback when autoplay is blocked.

Example fix

// before
player.autoplay('any'); // uncaught rejection possible
// after
player.autoplay('any');
player.on('autoplayfailure', () => showPlayButton());
Defensive patterns

Strategy: try-catch

Type guard

const isPlayPromise = (p) => p && typeof p.then === 'function';

Try / catch

const p = player.play();
if (p && typeof p.then === 'function') {
  p.catch((err) => {
    showPlayButton();
    player.log('autoplay blocked:', err);
  });
}

Prevention

When it happens

Trigger: Browser blocks muted autoplay (rare) or unmuted-after-mute autoplay; calling player.autoplay('muted') or 'any' in a browser with strict autoplay policy and low engagement; play() rejecting for a media-error reason during the fallback.

Common situations: Mobile Safari/Chrome autoplay restrictions; iframe without allow='autoplay'; muted state changed by another caller mid-flight; media decode error surfacing through the play promise.

Related errors


AI-assisted analysis of videojs/video.js@c3a7e0e6d2 (2026-08-13). Data as JSON: /api/errors/3226d51f02b0c3b3. Report an issue: GitHub.