UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[REQUEST]: Refactor the input remoting code into its own packages

Open doctorpangloss opened this issue 3 years ago • 5 comments

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:

  1. 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.

  1. A C# Unity package that pumps the messages from a data channel. It would depend on com.unity.webrtc only.

Describe alternatives you've considered

Writing the packages myself.

Additional context

No response

doctorpangloss avatar Jul 04 '22 15:07 doctorpangloss

@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?

karasusan avatar Jul 05 '22 02:07 karasusan

memo: URS-467

kannan-xiao4 avatar Jul 13 '22 06:07 kannan-xiao4

@doctorpangloss Could you tell me the detail of the suggestion 2?

karasusan avatar Jul 13 '22 06:07 karasusan

@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 avatar Jul 13 '22 12:07 doctorpangloss

@doctorpangloss I understood your opinion. I thought the same thing about the design of the InputRemoting before. I will consider the topic again. Thanks.

karasusan avatar Jul 14 '22 05:07 karasusan