Skip to content

Commit 4d21d9a

Browse files
committed
增加jitsi meet会议室功能
1 parent fdc5558 commit 4d21d9a

7 files changed

Lines changed: 210 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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
2+
3+
<PropertyGroup>
4+
<Version>9.0.1</Version>
5+
</PropertyGroup>
6+
7+
<PropertyGroup>
8+
<PackageTags>Bootstrap Blazor WebAssembly wasm UI Components Video Player</PackageTags>
9+
<Description>Bootstrap UI components extensions of Plyr</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+
<ItemGroup>
21+
<Folder Include="wwwroot\" />
22+
</ItemGroup>
23+
24+
</Project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@inherits BootstrapModuleComponentBase
2+
@attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.JitsiMeet/Meet.razor.js", JSObjectReference = true)]
3+
4+
<div @attributes="@AdditionalAttributes" id="@Id"></div>
5+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
using Microsoft.AspNetCore.Components;
2+
3+
namespace BootstrapBlazor.Components;
4+
5+
public partial class Meet
6+
{
7+
/// <summary>
8+
/// 获得/设置 服务器地址
9+
/// </summary>
10+
[Parameter]
11+
[EditorRequired]
12+
public string? Domain { get; set; }
13+
14+
/// <summary>
15+
/// 获得/设置 会议信息
16+
/// </summary>
17+
[EditorRequired]
18+
[Parameter]
19+
public MeetOption? Option { get; set; }
20+
21+
/// <summary>
22+
/// 获得/设置 会议室初始化完成事件
23+
/// </summary>
24+
[Parameter]
25+
public Action? OnLoad { get; set; }
26+
27+
/// <summary>
28+
/// <inheritdoc/>
29+
/// </summary>
30+
/// <returns></returns>
31+
protected override async Task InvokeInitAsync()
32+
{
33+
await InvokeVoidAsync("init", Id, Interop, Domain, Option);
34+
}
35+
36+
/// <summary>
37+
/// 执行命令
38+
/// </summary>
39+
/// <param name="command"></param>
40+
/// <param name="args"></param>
41+
/// <returns></returns>
42+
public Task ExecuteCommand(string command, object? args = null)
43+
{
44+
return InvokeVoidAsync("executeCommand", Id, command, args);
45+
}
46+
47+
/// <summary>
48+
/// 会议室加载完成回调
49+
/// </summary>
50+
[JSInvokable]
51+
public void OnLoadCallBack()
52+
{
53+
OnLoad?.Invoke();
54+
}
55+
}
56+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
console.log('onload' + invoke)
11+
invoke.invokeMethodAsync('OnLoadCallBack');
12+
}
13+
const api = new JitsiMeetExternalAPI(domain, options);
14+
const jitsi = { el, invoke, api };
15+
Data.set(id, jitsi);
16+
}
17+
18+
export function dispose(id) {
19+
const p = Data.get(id);
20+
Data.remove(id);
21+
22+
if (p) {
23+
const { api } = p;
24+
if (api) {
25+
api.dispose();
26+
}
27+
}
28+
}
29+
30+
export function executeCommand(id, command, option) {
31+
const p = Data.get(id);
32+
if (p) {
33+
const { api } = p;
34+
if (api) {
35+
api.executeCommand(command, option);
36+
}
37+
}
38+
}
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)