Skip to content

Commit

Permalink
Networked: add audio support
Browse files Browse the repository at this point in the history
  • Loading branch information
avdynut committed Dec 6, 2023
1 parent 1de675a commit ad10a7d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = silent
4 changes: 3 additions & 1 deletion src/XRSharp.CommunityToolkit.Networked/NetworkedScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class NetworkedScene : RootComponent

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

Expand Down Expand Up @@ -98,6 +98,8 @@ protected override void Init()
Interop.ExecuteJavaScriptVoid($@"
const template = document.getElementById('{AvatarTemplateId}');
const el = {Avatar.JsElement}.cloneNode(true);
if ({Audio.ToLowerString()})
el.setAttribute('networked-audio-source', '');
template.content.appendChild(el);
");
panel.Children.Remove(Avatar);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</ItemGroup>

<ItemGroup>
<None Include="..\.editorconfig" Link=".editorconfig" />
<None Include="Readme.md" />
</ItemGroup>

Expand Down
9 changes: 7 additions & 2 deletions src/XRSharp.CommunityToolkit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ VisualStudioVersion = 17.9.34310.174
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XRSharp.CommunityToolkit.Networked", "XRSharp.CommunityToolkit.Networked\XRSharp.CommunityToolkit.Networked.csproj", "{A14AF71E-E150-4F35-8FA5-404F6120081B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XRSharp.CommunityToolkit.Browser", "XRSharp.CommunityToolkit\XRSharp.CommunityToolkit.Browser\XRSharp.CommunityToolkit.Browser.csproj", "{88B7BB0E-F737-4761-9423-BD629184D0A3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XRSharp.CommunityToolkit.Browser", "XRSharp.CommunityToolkit\XRSharp.CommunityToolkit.Browser\XRSharp.CommunityToolkit.Browser.csproj", "{88B7BB0E-F737-4761-9423-BD629184D0A3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XRSharp.CommunityToolkit", "XRSharp.CommunityToolkit\XRSharp.CommunityToolkit\XRSharp.CommunityToolkit.csproj", "{999CB164-4178-47AA-A3AF-548DD8A1588B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XRSharp.CommunityToolkit", "XRSharp.CommunityToolkit\XRSharp.CommunityToolkit\XRSharp.CommunityToolkit.csproj", "{999CB164-4178-47AA-A3AF-548DD8A1588B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B4133832-4382-4ED6-8641-FBA844D6538D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<xr:BasicEnvironment BackgroundColor="LightBlue"/>
</xr:Root3D.Environment>
<xr:Root3D.Components>
<n:NetworkedScene Debug="True" ServerURL="http://localhost:8080/">
<n:NetworkedScene Debug="True" Audio="True" Adapter="easyrtc" ServerURL="http://localhost:8080/">
<n:NetworkedScene.Avatar>
<xr:Canvas3D>
<xr:Box SizeX="0.5" SizeY="0.7" SizeZ="0.5"/>
Expand Down

0 comments on commit ad10a7d

Please sign in to comment.