File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
src/BootstrapBlazor.Server/Components/Samples Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ namespace BootstrapBlazor.Server.Components.Samples;
88/// <summary>
99/// VideoDevice Component
1010/// </summary>
11- public partial class VideoDevices
11+ public partial class VideoDevices : IAsyncDisposable
1212{
1313 [ Inject , NotNull ]
1414 private IVideoDevice ? VideoDeviceService { get ; set ; }
@@ -60,4 +60,23 @@ private async Task OnCapture()
6060 {
6161 _previewUrl = await VideoDeviceService . GetPreviewUrl ( ) ;
6262 }
63+
64+ private async Task DisposeAsync ( bool disposing )
65+ {
66+ if ( disposing )
67+ {
68+ await OnCloseVideo ( ) ;
69+ }
70+ }
71+
72+ /// <summary>
73+ /// <inheritdoc/>
74+ /// </summary>
75+ /// <returns></returns>
76+ /// <exception cref="NotImplementedException"></exception>
77+ public async ValueTask DisposeAsync ( )
78+ {
79+ await DisposeAsync ( true ) ;
80+ GC . SuppressFinalize ( this ) ;
81+ }
6382}
You can’t perform that action at this time.
0 commit comments