0

I receive empty EventArgs if i use the @onvolumechange event in a .NET Blazor MAUI app on windows.

Player in Razor file:

<video @onvolumechange="@(e => PlayerVolumeChanged(e))" class="video" controls disablepictureinpicture controlslist="nodownload nofullscreen noremoteplayback noplaybackrate" autoplay onloadstart="this.volume=@_videoPlayerVolume" onclick="this.paused ? this.play() : this.pause();">
    <source src="@video" type="video/mp4">
</video>

Logic in C# file: private void PlayerVolumeChanged(EventArgs e) { // e is empty here... }

I am looking for a non-JavaScript solution to store the current volume of the player. The requirement is that the video player plays the video at the same volume every time. I expected the volume is stored in EventArgs e. But e is empty. Debug session in Visual Studio 2022

  • You should use the JavaScript to control the volume and the C# code cannot get the value and control the video. Here is the [related issue](https://stackoverflow.com/questions/57879294/c-sharp-statehaschanged-in-a-razor-component-does-not-force-video-tag-to-loa?rq=2) you can refer to. – Guangyu Bai - MSFT Aug 29 '23 at 05:19

0 Answers0