WebView2 memory leak issue in playing video loop
Hi,
In our WPF project, We use WebView2 control to display a local HTML file where a local video is playing in loop. The memory consumption of "Microsoft Edge WebView2" keeps increasing until the OutOfMemory Exception is thrown.
The content of the local HTML file is like
<!DOCTYPE html>
<html>
<head>
<style>
body {
margin: 0;
padding: 0;
overflow: hidden;
}
video {
width: 100%;
height: 100%;
position: absolute;
}
</style>
</head>
<body scroll="no">
<video src="myVideo.mp4" type="video/mp4" autoplay muted loop />
</body>
</html>
Video file "myVideo.mp4" is located at the same folder as the HTML file.
WPF application is pretty simple, only one WebView2 control in the MainWindow.xaml, set the source to the HTML file path (using file:///C/xxxxxxx ). The usage of WebView2 follows the guide from Microsoft.
Memory consumption of "Microsoft Edge WebView2" is stable if I remove the "loop" attribute from video tag, but OutOfMemory exception thrown if I keep "loop" attribute.
I have installed the latest WebView2 runtime. I tried to open this HTML file directly in Microsoft Edge and the memory consumption seems stable.
Has anyone the similar issue? Any advice and help will be appreciated.