#
Video renderer
The Video Renderer block is used to play the video stream on the selected part of the window or the screen, depending on the platform and UI framework.
A special platform-specific visual control, VideoView
, is used for video rendering. For Windows, it will use DirectX. In most cases, SDK will use OpenGL for other platforms. Avalonia and MAUI cross-platform UI frameworks are supported.
You can use several video views and renderers to display the same video stream in different parts of the window or on other windows.
#
Block info
Name: VideoRendererBlock.
#
Video view
#
The sample pipeline
graph LR; UniversalSourceBlock-->VideoRendererBlock;
#
Sample code
// Create a pipeline
var pipeline = new MediaBlocksPipeline();
// create a source block
var filename = "test.mp4";
var fileSource = new UniversalSourceBlock(await UniversalSourceSettings.CreateAsync(new Uri(filename)));
// create a video renderer block
var videoRenderer = new VideoRendererBlock(pipeline, VideoView1);
// connect the blocks
pipeline.Connect(fileSource.VideoOutput, videoRenderer.Input);
// start the pipeline
await pipeline.StartAsync();
#
Platforms
Windows, macOS, Linux, iOS, Android.