Skip to content

Commit ad10a7d

Browse files
committed
Networked: add audio support
1 parent 1de675a commit ad10a7d

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

src/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.cs]
2+
3+
# CS1591: Missing XML comment for publicly visible type or member
4+
dotnet_diagnostic.CS1591.severity = silent

src/XRSharp.CommunityToolkit.Networked/NetworkedScene.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class NetworkedScene : RootComponent
3333

3434
/// <summary>
3535
/// Unique room name. Can be multiple per app. Spaces are not allowed.
36-
/// There can be multiple rooms per app and clients can only connect to clients in the same app & room.
36+
/// There can be multiple rooms per app and clients can only connect to clients in the same app and room.
3737
/// </summary>
3838
public string Room { get; set; } = "default";
3939

@@ -98,6 +98,8 @@ protected override void Init()
9898
Interop.ExecuteJavaScriptVoid($@"
9999
const template = document.getElementById('{AvatarTemplateId}');
100100
const el = {Avatar.JsElement}.cloneNode(true);
101+
if ({Audio.ToLowerString()})
102+
el.setAttribute('networked-audio-source', '');
101103
template.content.appendChild(el);
102104
");
103105
panel.Children.Remove(Avatar);

src/XRSharp.CommunityToolkit.Networked/XRSharp.CommunityToolkit.Networked.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
</ItemGroup>
2727

2828
<ItemGroup>
29+
<None Include="..\.editorconfig" Link=".editorconfig" />
2930
<None Include="Readme.md" />
3031
</ItemGroup>
3132

src/XRSharp.CommunityToolkit.sln

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ VisualStudioVersion = 17.9.34310.174
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XRSharp.CommunityToolkit.Networked", "XRSharp.CommunityToolkit.Networked\XRSharp.CommunityToolkit.Networked.csproj", "{A14AF71E-E150-4F35-8FA5-404F6120081B}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XRSharp.CommunityToolkit.Browser", "XRSharp.CommunityToolkit\XRSharp.CommunityToolkit.Browser\XRSharp.CommunityToolkit.Browser.csproj", "{88B7BB0E-F737-4761-9423-BD629184D0A3}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XRSharp.CommunityToolkit.Browser", "XRSharp.CommunityToolkit\XRSharp.CommunityToolkit.Browser\XRSharp.CommunityToolkit.Browser.csproj", "{88B7BB0E-F737-4761-9423-BD629184D0A3}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XRSharp.CommunityToolkit", "XRSharp.CommunityToolkit\XRSharp.CommunityToolkit\XRSharp.CommunityToolkit.csproj", "{999CB164-4178-47AA-A3AF-548DD8A1588B}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XRSharp.CommunityToolkit", "XRSharp.CommunityToolkit\XRSharp.CommunityToolkit\XRSharp.CommunityToolkit.csproj", "{999CB164-4178-47AA-A3AF-548DD8A1588B}"
11+
EndProject
12+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B4133832-4382-4ED6-8641-FBA844D6538D}"
13+
ProjectSection(SolutionItems) = preProject
14+
.editorconfig = .editorconfig
15+
EndProjectSection
1116
EndProject
1217
Global
1318
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/XRSharp.CommunityToolkit/XRSharp.CommunityToolkit/Examples/Networked/Networked.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<xr:BasicEnvironment BackgroundColor="LightBlue"/>
1010
</xr:Root3D.Environment>
1111
<xr:Root3D.Components>
12-
<n:NetworkedScene Debug="True" ServerURL="http://localhost:8080/">
12+
<n:NetworkedScene Debug="True" Audio="True" Adapter="easyrtc" ServerURL="http://localhost:8080/">
1313
<n:NetworkedScene.Avatar>
1414
<xr:Canvas3D>
1515
<xr:Box SizeX="0.5" SizeY="0.7" SizeZ="0.5"/>

0 commit comments

Comments
 (0)