Blazorise Video API
Explore the Blazorise Video API reference for media sources, playback events, methods, and streaming options.
For examples and usage guidance, see the Video documentation.
API
Parameters
| Parameter | Default | Type |
|---|---|---|
AutomaticallyHideControls | false | bool |
Determines whether the controls hide automatically when the player becomes idle. | ||
AutoPause | true | bool |
Determines whether starting this player pauses any other active player. | ||
AutoPlay | false | bool |
Determines whether playback starts automatically. | ||
AvailableQualities | null | int[] |
Specifies the list of available quality options. Defaults to [4320, 2880, 2160, 1440, 1080, 720, 576, 480, 360, 240]. | ||
ChildContent | null | RenderFragment |
Specifies the content to be rendered inside this Video. | ||
ClickToPlay | true | bool |
Click (or tap) of the video container will toggle play/pause. | ||
Controls | true | bool |
Determines whether player controls are visible. | ||
ControlsDelay | 2000 | double |
Specifies how long the controls remain visible after the last user interaction, in milliseconds. | ||
ControlsList | new string[] { VideoControlsType.PlayLarge, VideoControlsType.Play, VideoControlsType.Progress, VideoControlsType.CurrentTime, VideoControlsType.Mute, VideoControlsType.Volume, VideoControlsType.Captions, VideoControlsType.Settings, VideoControlsType.Pip, VideoControlsType.Airplay, VideoControlsType.Fullscreen } | string[] |
Specifies the customized list of player controls in the order in which they are rendered. | ||
CurrentTime | 0 | double |
Specifies the current playback time, in seconds. | ||
DefaultQuality | null | int? |
Specifies the default playback quality. | ||
DisableContextMenu | true | bool |
Disable right click menu on video to help as very primitive obfuscation to prevent downloads of content. | ||
DoubleClickToFullscreen | true | bool |
If defined the player will go fullscreen when the video is double-clicked. | ||
InvertTime | true | bool |
Display the current time as a countdown rather than an incremental counter. | ||
Muted | false | bool |
Determines whether playback starts muted. | ||
Poster | Source.Poster | string |
Specifies the poster image shown before playback begins. | ||
ProtectionData | null | object |
Specifies the manual structure of the protection data. If defined, it will override the usage of ProtectionServerUrl and ProtectionHttpRequestHeaders. | ||
ProtectionHttpRequestHeaders | — | string |
Specifies the protection token for the http header that is sent to the server. | ||
ProtectionServerCertificateUrl | — | string |
Specifies the server certificate url of the DRM protection (currently used only with FairPlay). | ||
ProtectionServerUrl | — | string |
Specifies the server url of the DRM protection. | ||
ProtectionType | VideoProtectionType.None | VideoProtectionType |
Specifies the encoding type used for the DRM protection. Possible values: NonePlayReadyWidevineFairPlay | ||
Ratio | — | string |
Force an aspect ratio for all videos. The format is 'w:h' - e.g. '16:9' or '4:3'. If this is not specified then the native resolution of the media is used. | ||
ResetOnEnd | false | bool |
Reset the playback to the start once playback is complete. | ||
SeekTime | 10 | int |
Specifies how many seconds to skip when seeking forward or backward. | ||
SettingsList | new VideoSettingsType[] { VideoSettingsType.Captions, VideoSettingsType.Quality, VideoSettingsType.Speed, VideoSettingsType.Loop } | VideoSettingsType[] |
If the default controls are used, you can specify which settings to show in the menu. | ||
Source | null | VideoSource |
Specifies the media source used by the player. | ||
StreamingLibrary | None | StreamingLibrary |
Specifies the streaming library used for playback. Possible values: NoneDashHls | ||
Thumbnails | — | string |
Specifies the thumbnail track used for timeline previews and chapter navigation. | ||
Volume | 1 | double |
A number, between 0 and 1, representing the initial volume of the player. | ||
Events
| Event | Type |
|---|---|
CaptionsDisabled | Func<Task> |
Sent when captions are disabled. | |
CaptionsEnabled | Func<Task> |
Sent when captions are enabled. | |
ControlsHidden | Func<Task> |
Sent when the controls are hidden. | |
ControlsShown | Func<Task> |
Sent when the controls are shown. | |
Ended | Func<Task> |
Sent when playback completes. Note: This does not fire if autoplay is true. | |
FullScreenEntered | Func<Task> |
Sent when the player enters fullscreen mode (either the proper fullscreen or full-window fallback for older browsers). | |
FullScreenExited | Func<Task> |
Sent when the player exits fullscreen mode. | |
LanguageChange | Func<string, Task> |
Sent when the caption language is changed. | |
Paused | Func<Task> |
Sent when playback is paused. | |
Played | Func<Task> |
Sent when playback of the media starts after having been paused; that is, when playback is resumed after a prior pause event. | |
Playing | Func<Task> |
Sent when the media begins to play (either for the first time, after having been paused, or after ending and then restarting). | |
Progress | Func<double, Task> |
Sent periodically to inform interested parties of progress downloading the media. Information about the current amount of the media that has been downloaded is available in the media element's buffered attribute. | |
QualityChanged | Func<int?, Task> |
The quality of playback has changed. If the quality argument is | |
RateChange | Func<double, Task> |
Sent when the playback speed changes. | |
Ready | Func<Task> |
Triggered when the instance is ready for API calls. | |
Seeked | Func<double, Task> |
Sent when a seek operation completes. | |
Seeking | Func<double, Task> |
Sent when a seek operation begins. | |
TimeUpdate | Func<double, Task> |
The time indicated by the element's currentTime attribute has changed. | |
VolumeChange | Func<double, bool, Task> |
Sent when the audio volume changes (both when the volume is set and when the muted state is changed). | |
Methods
| Method | Return | Parameters |
|---|---|---|
AddTextTrack | Task | VideoTrack track |
Adds a new text track to the list of tracks.
| ||
Airplay | Task | — |
Trigger the airplay dialog on supported devices.
| ||
ClearTextTracks | Task | — |
Clear all the text tracks.
| ||
DecreaseVolume | Task | double step |
Decrease volume by the specified step. If no parameter is passed, the default step will be used.
| ||
EnterFullscreen | Task | — |
Enter fullscreen. If fullscreen is not supported, a fallback "full window/viewport" is used instead.
| ||
ExitFullscreen | Task | — |
Exit fullscreen.
| ||
Forward | Task | double seekTime |
Fast forward by the specified seek time. If no parameter is passed, the default seek time will be used.
| ||
HideTextTrack | Task | int textTrackId |
Hide the track from the list of tracks.
| ||
IncreaseVolume | Task | double step |
Increase volume by the specified step. If no parameter is passed, the default step will be used.
| ||
Pause | Task | — |
Pause playback.
| ||
Play | Task | — |
Start playback.
| ||
Restart | Task | — |
Restart playback.
| ||
Rewind | Task | double seekTime |
Rewind playback by the specified seek time.
| ||
SetPlaybackRate | Task | double playbackRate |
Dispatch an event to change the media playback rate.
| ||
ShowTextTrack | Task | int textTrackId |
Show the track from the list of tracks.
| ||
Stop | Task | — |
Stop playback and reset to start.
| ||
ToggleCaptions | Task | — |
Toggle captions display.
| ||
ToggleControls | Task | — |
Toggle the controls (video only). Takes optional truthy value to force it on/off.
| ||
ToggleFullscreen | Task | — |
Toggle fullscreen.
| ||
TogglePlay | Task | — |
Toggle playback, if no parameters are passed, it will toggle based on current status.
| ||
UpdateSource | Task | VideoSource source, VideoProtectionType protectionType, object protectionData, string protectionServerUrl, string protectionHttpRequestHeaders, string protectionServerCertificateUrl |
Updates the media source.
| ||