UnityRenderStreaming
UnityRenderStreaming copied to clipboard
[REQUEST]: Refactor the input remoting code into its own packages
Is your feature request related to a problem?
Dealing with the input remoting from this repo is painful.
Describe the solution you'd like
Two packages:
- A TypeScript NPM package that implements DOM to Unity Input System events:
interface UnityToRemoteMessage {
Uint8Array buffer
bool isCanceled;
}
interface Connection {
write/*FromRemoteToUnity*/(Uint8Array bytes):void
async readNext/*FromUnityToRemote*/(): UnityToRemoteMessage
}
class RemotePlayer {
constructor(inputRect:HTMLVideoElement|null)
close()
}
Observe you can represent a connection however you want - it makes sense to do it with a data channel.
Input is strongly coupled to the on-screen representation of a remote stream. Mouse and touch events should only be enabled if a non-null video element is supplied. You should also be subscribed to resize observations / DOM mutations.
- A C# Unity package that pumps the messages from a data channel. It would depend on
com.unity.webrtconly.
Describe alternatives you've considered
Writing the packages myself.
Additional context
No response
@doctorpangloss Your suggestion 1. is good for me. The browser code should be packed and published as a npm package to make comfortable for many web develoers.
The suggession 2. is slightly difficult to understand for me. Would you tell me the reason you suggest?
memo: URS-467
@doctorpangloss Could you tell me the detail of the suggestion 2?
@doctorpangloss Could you tell me the detail of the suggestion 2?
I would want to use Input Remoting in Unity without the rest of the render streaming package
@doctorpangloss I understood your opinion. I thought the same thing about the design of the InputRemoting before. I will consider the topic again. Thanks.