{"record":{"id":"0223d45160f092c7","repo":"unoplatform/uno","slug":"stepforwardoneframe-is-not-supported","errorCode":null,"errorMessage":"StepForwardOneFrame is not supported","messagePattern":"StepForwardOneFrame is not supported","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/AddIns/Uno.UI.MediaPlayer.WebAssembly/MediaPlayerExtension.cs","lineNumber":492,"sourceCode":"\n\tpublic void SetUriSource(Uri uri)\n\t{\n\t\tif (this.Log().IsEnabled(LogLevel.Debug))\n\t\t{\n\t\t\tthis.Log().Debug($\"MediaPlayerExtension.SetUriSource({uri})\");\n\t\t}\n\n\t\tif (_player is not null)\n\t\t{\n\t\t\t_player.Source = uri.OriginalString;\n\t\t}\n\t}\n\n\tpublic void StepBackwardOneFrame()\n\t\t=> throw new NotSupportedException($\"StepBackwardOneFrame is not supported\");\n\n\tpublic void StepForwardOneFrame()\n\t\t=> throw new NotSupportedException($\"StepForwardOneFrame is not supported\");\n\n\tpublic void Stop()\n\t{\n\t\tif (this.Log().IsEnabled(LogLevel.Debug))\n\t\t{\n\t\t\tthis.Log().Debug($\"MediaPlayerExtension.Stop()\");\n\t\t}\n\n\t\tif (_owner.PlaybackSession.PlaybackState == MediaPlaybackState.Playing\n\t\t\t|| _owner.PlaybackSession.PlaybackState == MediaPlaybackState.Paused)\n\t\t{\n\t\t\t_player?.Pause(); // Do not call stop, otherwise player will need to be prepared again\n\t\t\t_owner.PlaybackSession.Position = TimeSpan.Zero;\n\t\t\t_owner.PlaybackSession.PlaybackState = MediaPlaybackState.None;\n\t\t}\n\t}\n\n\tpublic void ToggleMute()","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/AddIns/Uno.UI.MediaPlayer.WebAssembly/MediaPlayerExtension.cs#L474-L510","documentation":"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.","triggerScenarios":"Calling mediaPlayer.StepForwardOneFrame() on a WebAssembly target, or on Skia.WebAssembly.Browser (which throws NotImplementedException from the same method).","commonSituations":"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.","solutions":["Guard the call by platform: call StepForwardOneFrame() only where a backing primitive exists (Skia/macOS, Skia/X11 via libvlc).","Catch NotSupportedException and fall back to a small Position nudge (e.g. Position += frameDuration) as an approximation.","Hide/disable the step-forward control on platforms whose extension throws."],"exampleFix":"// before\nmediaPlayer.StepForwardOneFrame();\n\n// after\ntry\n{\n\tmediaPlayer.StepForwardOneFrame();\n}\ncatch (NotSupportedException)\n{\n\t// HTML5 video has no frame-step primitive; approximate it.\n\tmediaPlayer.Position += TimeSpan.FromMilliseconds(33);\n}","handlingStrategy":"try-catch","validationCode":"// Forward step is supported on Skia/macOS and Skia/X11 (libvlc)\nif (OperatingSystem.IsMacOS() || (OperatingSystem.IsLinux() && _isSkiaX11WithVlc))\n{\n\tmediaPlayer.StepForwardOneFrame();\n}","typeGuard":"static bool SupportsForwardFrameStep() => OperatingSystem.IsMacOS() || IsSkiaX11WithLibVlc();","tryCatchPattern":"try { mediaPlayer.StepForwardOneFrame(); }\ncatch (NotSupportedException) { mediaPlayer.Position += TimeSpan.FromMilliseconds(33); }","preventionTips":["Provide a Position-based fallback for platforms lacking a true frame step.","Disable the step-forward UI affordance on WASM targets.","Test media transport controls on every target runtime, not just desktop."],"tags":["media","wasm","notsupported","mediaplayer"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}