Skip to content

Commit b701625

Browse files
committed
doc: 更新文档
1 parent 3924027 commit b701625

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/BootstrapBlazor.Server/Components/Samples/VideoDevices.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ 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" IsDisabled="_isOpen" class="ms-2"></Button>
17+
<Button Text="@Localizer["VideoDeviceOpenText"]" Icon="fa-solid fa-play" OnClick="OnOpenVideo" IsDisabled="_isOpen || string.IsNullOrEmpty(_deviceId)" class="ms-2"></Button>
1818
<Button Text="@Localizer["VideoDeviceCloseText"]" Icon="fa-solid fa-stop" OnClick="OnCloseVideo" IsDisabled="!_isOpen" class="ms-2"></Button>
1919
<Button Text="@Localizer["VideoDeviceCaptureText"]" Icon="fa-solid fa-camera" OnClick="OnCapture" IsDisabled="!_isOpen" class="ms-2"></Button>
2020
</div>

src/BootstrapBlazor.Server/Components/Samples/VideoDevices.razor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ private async Task OnOpenVideo()
4343
DeviceId = _deviceId,
4444
VideoSelector = ".bb-video"
4545
};
46-
_isOpen = await VideoDeviceService.Open(constraints);
46+
_isOpen = await VideoDeviceService.Open(constraints);
4747
}
4848
}
4949

5050
private async Task OnCloseVideo()
5151
{
52+
_isOpen = false;
5253
_previewUrl = "";
5354
await VideoDeviceService.Close(".bb-video");
5455
}

0 commit comments

Comments
 (0)