Skip to content

Commit 27ac0d9

Browse files
ArgoZhangj4587698
andauthored
feat(Meeting): add Meeting component (#448)
* 增加jitsi meet会议室功能 * 删除调试信息 * 移除log * refactor: 代码格式化 --------- Co-authored-by: jx <jx@jvxiang.com>
1 parent b2a9182 commit 27ac0d9

7 files changed

Lines changed: 207 additions & 0 deletions

File tree

BootstrapBlazor.Extensions.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazor.Graph", "sr
186186
EndProject
187187
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazor.Html2Pdf.Playwright", "src\components\BootstrapBlazor.Html2Pdf.Playwright\BootstrapBlazor.Html2Pdf.Playwright.csproj", "{F3043A78-1942-4524-BDC4-7E88F56DF3D5}"
188188
EndProject
189+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazor.JitsiMeet", "src\components\BootstrapBlazor.JitsiMeet\BootstrapBlazor.JitsiMeet.csproj", "{08458CA3-BF81-48E8-870D-9389DC037808}"
190+
EndProject
189191
Global
190192
GlobalSection(SolutionConfigurationPlatforms) = preSolution
191193
Debug|Any CPU = Debug|Any CPU
@@ -504,6 +506,10 @@ Global
504506
{F3043A78-1942-4524-BDC4-7E88F56DF3D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
505507
{F3043A78-1942-4524-BDC4-7E88F56DF3D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
506508
{F3043A78-1942-4524-BDC4-7E88F56DF3D5}.Release|Any CPU.Build.0 = Release|Any CPU
509+
{08458CA3-BF81-48E8-870D-9389DC037808}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
510+
{08458CA3-BF81-48E8-870D-9389DC037808}.Debug|Any CPU.Build.0 = Debug|Any CPU
511+
{08458CA3-BF81-48E8-870D-9389DC037808}.Release|Any CPU.ActiveCfg = Release|Any CPU
512+
{08458CA3-BF81-48E8-870D-9389DC037808}.Release|Any CPU.Build.0 = Release|Any CPU
507513
EndGlobalSection
508514
GlobalSection(SolutionProperties) = preSolution
509515
HideSolutionNode = FALSE
@@ -591,6 +597,7 @@ Global
591597
{1FDDF0AD-7AB6-4706-A183-26C680817BB4} = {FF1089BE-C704-4374-B629-C57C08E1798F}
592598
{CED55D86-57CF-CB0D-E880-370C44C0DB1F} = {FF1089BE-C704-4374-B629-C57C08E1798F}
593599
{F3043A78-1942-4524-BDC4-7E88F56DF3D5} = {FF1089BE-C704-4374-B629-C57C08E1798F}
600+
{08458CA3-BF81-48E8-870D-9389DC037808} = {FF1089BE-C704-4374-B629-C57C08E1798F}
594601
EndGlobalSection
595602
GlobalSection(ExtensibilityGlobals) = postSolution
596603
SolutionGuid = {D5EB1960-6F30-4CE1-B375-EAE1F787D6FF}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
2+
3+
<PropertyGroup>
4+
<Version>9.0.0</Version>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Meeting</PackageTags>
9+
<Description>Bootstrap UI components extensions of Meeting</Description>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="BootstrapBlazor" Version="$(BBVersion)" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<Using Include="Microsoft.JSInterop" />
18+
</ItemGroup>
19+
20+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
@inherits BootstrapModuleComponentBase
2+
@attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.JitsiMeet/Meet.razor.js", JSObjectReference = true)]
3+
4+
<div @attributes="@AdditionalAttributes" id="@Id"></div>
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
using Microsoft.AspNetCore.Components;
2+
3+
namespace BootstrapBlazor.Components;
4+
5+
/// <summary>
6+
/// Meet 组件用于显示会议室
7+
/// </summary>
8+
public partial class Meet
9+
{
10+
/// <summary>
11+
/// 获得/设置 服务器地址
12+
/// </summary>
13+
[Parameter]
14+
[EditorRequired]
15+
public string? Domain { get; set; }
16+
17+
/// <summary>
18+
/// 获得/设置 会议信息
19+
/// </summary>
20+
[EditorRequired]
21+
[Parameter]
22+
public MeetOption? Option { get; set; }
23+
24+
/// <summary>
25+
/// 获得/设置 会议室初始化完成事件
26+
/// </summary>
27+
[Parameter]
28+
public Action? OnLoad { get; set; }
29+
30+
/// <summary>
31+
/// <inheritdoc/>
32+
/// </summary>
33+
/// <returns></returns>
34+
protected override async Task InvokeInitAsync()
35+
{
36+
await InvokeVoidAsync("init", Id, Interop, Domain, Option);
37+
}
38+
39+
/// <summary>
40+
/// 执行命令
41+
/// </summary>
42+
/// <param name="command"></param>
43+
/// <param name="args"></param>
44+
/// <returns></returns>
45+
public Task ExecuteCommand(string command, object? args = null)
46+
{
47+
return InvokeVoidAsync("executeCommand", Id, command, args);
48+
}
49+
50+
/// <summary>
51+
/// 会议室加载完成回调
52+
/// </summary>
53+
[JSInvokable]
54+
public void OnLoadCallBack()
55+
{
56+
OnLoad?.Invoke();
57+
}
58+
}
59+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { addScript } from '../BootstrapBlazor/modules/utility.js';
2+
import Data from '../BootstrapBlazor/modules/data.js';
3+
4+
export async function init(id, invoke, domain, options) {
5+
await addScript('./_content/BootstrapBlazor.JitsiMeet/external_api.js');
6+
7+
const el = document.getElementById(id);
8+
options.parentNode = el;
9+
options.onload = () => {
10+
invoke.invokeMethodAsync('OnLoadCallBack');
11+
}
12+
const api = new JitsiMeetExternalAPI(domain, options);
13+
const jitsi = { el, invoke, api };
14+
Data.set(id, jitsi);
15+
}
16+
17+
export function dispose(id) {
18+
const p = Data.get(id);
19+
Data.remove(id);
20+
21+
if (p) {
22+
const { api } = p;
23+
if (api) {
24+
api.dispose();
25+
}
26+
}
27+
}
28+
29+
export function executeCommand(id, command, option) {
30+
const p = Data.get(id);
31+
if (p) {
32+
const { api } = p;
33+
if (api) {
34+
api.executeCommand(command, option);
35+
}
36+
}
37+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
// Website: https://www.blazor.zone or https://argozhang.github.io/
4+
5+
namespace BootstrapBlazor.Components;
6+
7+
/// <summary>
8+
/// IFrame 参数类
9+
/// </summary>
10+
public class MeetOption
11+
{
12+
/// <summary>
13+
/// 要加入的房间名称
14+
/// </summary>
15+
public string? RoomName { get; set; }
16+
17+
/// <summary>
18+
/// 创建的 IFrame 宽度,可以是数值(像素单位)或字符串(格式:数字 + px、em、pt 或 %)
19+
/// </summary>
20+
public object? Width { get; set; }
21+
22+
/// <summary>
23+
/// 创建的 IFrame 高度,可以是数值(像素单位)或字符串(格式:数字 + px、em、pt 或 %)
24+
/// </summary>
25+
public object? Height { get; set; }
26+
27+
/// <summary>
28+
/// config.js 文件中选项的重写配置
29+
/// </summary>
30+
public object? ConfigOverwrite { get; set; }
31+
32+
/// <summary>
33+
/// interface_config.js 文件中选项的重写配置
34+
/// </summary>
35+
public object? InterfaceConfigOverwrite { get; set; }
36+
37+
/// <summary>
38+
/// JWT token
39+
/// </summary>
40+
public string? Jwt { get; set; }
41+
42+
/// <summary>
43+
/// 邀请参加会议的参与者信息数组
44+
/// </summary>
45+
public object? Invitees { get; set; }
46+
47+
/// <summary>
48+
/// 会议中使用的设备信息映射
49+
/// </summary>
50+
public object? Devices { get; set; }
51+
52+
/// <summary>
53+
/// 参与者启动或加入会议的信息(例如,电子邮件)
54+
/// </summary>
55+
public UserInfo? UserInfo { get; set; }
56+
57+
/// <summary>
58+
/// 默认会议语言(默认为中文)
59+
/// </summary>
60+
public string Lang { get; set; } = "zh";
61+
}
62+
63+
/// <summary>
64+
/// 参会人员信息
65+
/// </summary>
66+
public class UserInfo
67+
{
68+
/// <summary>
69+
/// 参与者的电子邮件地址
70+
/// </summary>
71+
public string? Email { get; set; }
72+
73+
/// <summary>
74+
/// 参与者的名称
75+
/// </summary>
76+
public string? DisplayName { get; set; }
77+
}
78+

src/components/BootstrapBlazor.JitsiMeet/wwwroot/external_api.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)