File tree Expand file tree Collapse file tree
src/BootstrapBlazor.Server/Components/Samples Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ private IBluetooth? BluetoothService { get; set; }</Pre>
1414 <div class =" row form-inline g-3" >
1515 <div class =" col-12" >
1616 <Button Text =" @Localizer[" VideoDeviceRequestText " ]" Icon =" fa-solid fa-photo-film" OnClick =" OnRequestDevice" ></Button >
17- <Button Text =" @Localizer[" VideoDeviceOpenText " ]" Icon =" fa-solid fa-play" OnClick =" OnOpenVideo" class =" ms-2" ></Button >
18- <Button Text =" @Localizer[" VideoDeviceCloseText " ]" Icon =" fa-solid fa-stop" OnClick =" OnCloseVideo" class =" ms-2" ></Button >
19- <Button Text =" @Localizer[" VideoDeviceCaptureText " ]" Icon =" fa-solid fa-camera" OnClick =" OnCapture" class =" ms-2" ></Button >
17+ <Button Text =" @Localizer[" VideoDeviceOpenText " ]" Icon =" fa-solid fa-play" OnClick =" OnOpenVideo" IsDisabled = " _isOpen " class =" ms-2" ></Button >
18+ <Button Text =" @Localizer[" VideoDeviceCloseText " ]" Icon =" fa-solid fa-stop" OnClick =" OnCloseVideo" IsDisabled = " !_isOpen " class =" ms-2" ></Button >
19+ <Button Text =" @Localizer[" VideoDeviceCaptureText " ]" Icon =" fa-solid fa-camera" OnClick =" OnCapture" IsDisabled = " !_isOpen " class =" ms-2" ></Button >
2020 </div >
2121 <div class =" col-12" >
2222 <Select Items =" @_items" @bind-Value =" _deviceId" DisplayText =" Devices" ShowLabel =" true" ></Select >
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ public partial class VideoDevices
2121
2222 private string ? _previewUrl ;
2323
24+ private bool _isOpen = false ;
25+
2426 private async Task OnRequestDevice ( )
2527 {
2628 var devices = await VideoDeviceService . GetDevices ( ) ;
@@ -41,7 +43,7 @@ private async Task OnOpenVideo()
4143 DeviceId = _deviceId ,
4244 VideoSelector = ".bb-video"
4345 } ;
44- await VideoDeviceService . Open ( constraints ) ;
46+ _isOpen = await VideoDeviceService . Open ( constraints ) ;
4547 }
4648 }
4749
You can’t perform that action at this time.
0 commit comments