unoplatform/uno · error · NotSupportedException

StepForwardOneFrame is not supported

Error message

StepForwardOneFrame is not supported

What it means

Symmetric to StepBackwardOneFrame: the WASM MediaPlayer extension throws NotSupportedException from StepForwardOneFrame() because the underlying HTML5 <video> exposes no forward-frame-step primitive. Forward frame stepping IS implemented on Skia/macOS (NativeUno.uno_mediaplayer_step_by) and Skia.X11 (VlcPlayer.NextFrame), but not on the WASM HTML5 player nor on the Skia.Wasm.Browser extension (NotImplementedException). This is a deliberate platform-capability gap, not a bug.

Source

Thrown at src/AddIns/Uno.UI.MediaPlayer.WebAssembly/MediaPlayerExtension.cs:492

	public void SetUriSource(Uri uri)
	{
		if (this.Log().IsEnabled(LogLevel.Debug))
		{
			this.Log().Debug($"MediaPlayerExtension.SetUriSource({uri})");
		}

		if (_player is not null)
		{
			_player.Source = uri.OriginalString;
		}
	}

	public void StepBackwardOneFrame()
		=> throw new NotSupportedException($"StepBackwardOneFrame is not supported");

	public void StepForwardOneFrame()
		=> throw new NotSupportedException($"StepForwardOneFrame is not supported");

	public void Stop()
	{
		if (this.Log().IsEnabled(LogLevel.Debug))
		{
			this.Log().Debug($"MediaPlayerExtension.Stop()");
		}

		if (_owner.PlaybackSession.PlaybackState == MediaPlaybackState.Playing
			|| _owner.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)
		{
			_player?.Pause(); // Do not call stop, otherwise player will need to be prepared again
			_owner.PlaybackSession.Position = TimeSpan.Zero;
			_owner.PlaybackSession.PlaybackState = MediaPlaybackState.None;
		}
	}

	public void ToggleMute()

View on GitHub (pinned to 0418340488)

Solutions

  1. Guard the call by platform: call StepForwardOneFrame() only where a backing primitive exists (Skia/macOS, Skia/X11 via libvlc).
  2. Catch NotSupportedException and fall back to a small Position nudge (e.g. Position += frameDuration) as an approximation.
  3. Hide/disable the step-forward control on platforms whose extension throws.

Example fix

// before
mediaPlayer.StepForwardOneFrame();

// after
try
{
	mediaPlayer.StepForwardOneFrame();
}
catch (NotSupportedException)
{
	// HTML5 video has no frame-step primitive; approximate it.
	mediaPlayer.Position += TimeSpan.FromMilliseconds(33);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Forward step is supported on Skia/macOS and Skia/X11 (libvlc)
if (OperatingSystem.IsMacOS() || (OperatingSystem.IsLinux() && _isSkiaX11WithVlc))
{
	mediaPlayer.StepForwardOneFrame();
}

Type guard

static bool SupportsForwardFrameStep() => OperatingSystem.IsMacOS() || IsSkiaX11WithLibVlc();

Try / catch

try { mediaPlayer.StepForwardOneFrame(); }
catch (NotSupportedException) { mediaPlayer.Position += TimeSpan.FromMilliseconds(33); }

Prevention

When it happens

Trigger: Calling mediaPlayer.StepForwardOneFrame() on a WebAssembly target, or on Skia.WebAssembly.Browser (which throws NotImplementedException from the same method).

Common situations: A frame-stepping transport control shared across platforms; runtime test harnesses iterating the full media API; apps migrated from native UWP that assumed StepForwardOneFrame is universally available.

Related errors


AI-assisted analysis of unoplatform/uno@0418340488 (2026-08-13). Data as JSON: /api/errors/0223d45160f092c7. Report an issue: GitHub.