MAUIverse MAUIverse
← Back to Toolkit Releases

MediaElement v10.0.0: StreamMediaSource

Contributors

CommunityToolkit.Maui.MediaElement v10.0.0

Introducing MediaSource.FromStream(Stream)

Thanks to Matt Goldman, MediaElement now supports streaming sources!

Use MediaSource.FromStream(Stream) to assign the MediaElement.Source to a Stream:

const string buckBunnyVideo = "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_30MB.mp4";

await using var networkStream = await httpClient.GetStreamAsync(buckBunnyVideo);

var sourceStream = new MemoryStream();
await stream.CopyToAsync(sourceStream);

sourceStream.Position = 0;

MediaElement.Source = MediaSource.FromStream(sourceStream);

Learn More: https://learn.microsoft.com/dotnet/communitytoolkit/maui/views/mediaelement

What’s Changed

Full Changelog: https://github.com/CommunityToolkit/Maui/compare/14.1.1…10.0.0-mediaelement

View on GitHub

← Back to Toolkit Releases