Proper Video Player Documentation

Events

ProperVideoPlayer exposes 17 UnityEvent properties. Configure them in the Inspector or subscribe in code with AddListener. WebGL events are forwarded from the HTML media element; the fallback backend uses equivalent VideoPlayer callbacks or documented synthesized events.

player.OnOpened.AddListener(() => spinner.SetActive(false));
player.OnWaiting.AddListener(() => spinner.SetActive(true));
player.OnPlaybackStarted.AddListener(() => spinner.SetActive(false));
player.OnError.AddListener(message => Debug.LogWarning($"Video error: {message}"));
player.OnRecoveryAttempted.AddListener(stage => Debug.Log($"Video recovery: {stage}"));

Playback and recovery events#

EventInvoked when
OnOpenedThe current source has decoded its first frame.
OnPlaybackStartedPlayback starts or resumes.
OnEndedA non-looping source reaches the end.
OnSeekingA seek operation starts.
OnSeekedA seek operation completes.
OnError(string)A media error occurs. The argument contains a readable error message, including HLS- or DASH-specific details for streaming-engine failures.
OnRecoveryAttempted(string)The playback watchdog performs a recovery action. The stage identifier is mute_dance, kick, seek_flush, reload, or reload_paused.

Media-state events#

EventInvoked when
OnLoadedMetadataDuration and intrinsic dimensions are available. This occurs before OnOpened.
OnDurationChangedThe reported duration changes, including updates from live or adaptive sources.
OnResizedThe intrinsic video dimensions change. Query VideoWidth and VideoHeight in the handler.
OnCanPlayEnough data is available to begin playback.
OnCanPlayThroughThe browser estimates that playback can reach the end without waiting for more data.
OnWaitingPlayback waits for additional data. This event is available only on WebGL.
OnStalledThe browser stops receiving media data unexpectedly. This event is available only on WebGL.
OnPausedPlayback pauses. On WebGL, this includes pauses initiated by the application, browser, operating system, or watchdog.
OnRateChangedThe playback rate changes.
OnVolumeChangedVolume or mute state changes, including temporary autoplay-recovery changes on WebGL.

Platform availability#

EventWebGL backendNon-WebGL VideoPlayer fallback
OnLoadedMetadataloadedmetadataInvoked when preparation completes.
OnDurationChangeddurationchangeInvoked when preparation completes.
OnResizedresizeInvoked once when preparation completes.
OnOpenedloadeddataInvoked when preparation completes.
OnCanPlay / OnCanPlayThroughcanplay / canplaythroughInvoked when preparation completes.
OnPlaybackStartedplayingVideoPlayer.started
OnPausedpauseSynthesized when the backend pauses active playback.
OnSeeking / OnSeekedseeking / seekedSynthesized on seek / VideoPlayer.seekCompleted.
OnWaitingwaitingNot available.
OnStalledstalledNot available.
OnRateChangedratechangeSynthesized by SetPlaybackRate.
OnVolumeChangedvolumechangeSynthesized by SetVolume and SetMuted.
OnEndedendedVideoPlayer.loopPointReached when looping is disabled.
OnErrorerror or a streaming-engine errorVideoPlayer.errorReceived
OnRecoveryAttemptedInvoked by the component watchdog whenever it performs a recovery action.