Skip to content

Commit 40afab9

Browse files
committed
feat(HikVision): add IsStartRecord parameter
1 parent 81271e6 commit 40afab9

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/components/BootstrapBlazor.HikVision/Components/HikVisionWebPlugin.razor.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ public partial class HikVisionWebPlugin
115115
/// </summary>
116116
public bool IsRealPlaying { get; private set; }
117117

118+
/// <summary>
119+
/// 获得 是否已经打开声音
120+
/// </summary>
121+
public bool IsOpenSound { get; private set; }
122+
123+
/// <summary>
124+
/// 获得 是否开始录像
125+
/// </summary>
126+
public bool IsStartRecord { get; private set; }
127+
118128
/// <summary>
119129
/// <inheritdoc/>
120130
/// </summary>
@@ -164,6 +174,7 @@ public async Task Logout()
164174
{
165175
await InvokeVoidAsync("logout", Id);
166176
}
177+
IsStartRecord = false;
167178
IsRealPlaying = false;
168179
IsLogin = false;
169180
await TriggerLogout();
@@ -221,6 +232,7 @@ public async Task StopRealPlay()
221232
{
222233
await InvokeVoidAsync("stopRealPlay", Id);
223234
IsRealPlaying = false;
235+
IsStartRecord = false;
224236
await TriggerStopRealPlay();
225237
}
226238
}
@@ -281,6 +293,7 @@ public async Task<bool> OpenSound()
281293
{
282294
var code = await InvokeAsync<int>("openSound", Id);
283295
ret = code == 100;
296+
IsOpenSound = true;
284297
}
285298
return ret;
286299
}
@@ -296,6 +309,7 @@ public async Task<bool> CloseSound()
296309
{
297310
var code = await InvokeAsync<int>("closeSound", Id);
298311
ret = code == 100;
312+
IsOpenSound = false;
299313
}
300314
return ret;
301315
}
@@ -378,6 +392,7 @@ public async Task<bool> StartRecord()
378392
if (IsLogin && IsRealPlaying)
379393
{
380394
ret = await InvokeAsync<bool>("startRecord", Id);
395+
IsStartRecord = ret;
381396
}
382397
return ret;
383398
}
@@ -392,6 +407,10 @@ public async Task<bool> StopRecord()
392407
if (IsLogin && IsRealPlaying)
393408
{
394409
ret = await InvokeAsync<bool>("stopRecord", Id);
410+
if (ret)
411+
{
412+
IsStartRecord = false;
413+
}
395414
}
396415
return ret;
397416
}

0 commit comments

Comments
 (0)