Search Unity

Unity Render Streaming Introduction & FAQ

Discussion in 'Unity Render Streaming' started by kazuki_unity729, Sep 10, 2019.

  1. sindharta_at_unity

    sindharta_at_unity

    Unity Technologies

    Joined:
    Jul 4, 2019
    Posts:
    24
    You will have to modify
    RemoteInput::ProcessMouseMoveEvent
    , so that it puts the position in the queue. Something like this, (not tested).

    Code (CSharp):
    1.  
    2. static void ProcessMouseMoveEvent(short x, short y, byte button)
    3. {
    4.     var position = new UnityEngine.Vector2Int(x, y);
    5.     var delta = position - m_prevMousePos;
    6.     InputSystem.QueueStateEvent(RemoteMouse, new MouseState { position = pos, delta = delta, buttons = button });
    7.     m_prevMousePos = position;
    8. }
    9.  
     
    bartburkhardt-sim-ci likes this.
  2. sindharta_at_unity

    sindharta_at_unity

    Unity Technologies

    Joined:
    Jul 4, 2019
    Posts:
    24
    The certificate is "invalid", because you created the certificate yourself and it wasn't assigned to you by a trusted Certificate Authority.
    For local testing, this is okay and you should be able to ignore the warning and proceed to see the page.
     
    bartburkhardt-sim-ci likes this.
  3. polygonfuture

    polygonfuture

    Joined:
    Feb 4, 2016
    Posts:
    4
    Yeah, except this does not work when the server webpages are loaded on iOS. The iPad Pro is not able to get past these invalid certificates, and no visuals are displayed. Either in Chrome or Safari.
     
  4. sindharta_at_unity

    sindharta_at_unity

    Unity Technologies

    Joined:
    Jul 4, 2019
    Posts:
    24
    It works, but you have to press some buttons to get past it.
    Try googling "safari ios bypass certificate error".
     
  5. bartburkhardt-sim-ci

    bartburkhardt-sim-ci

    Joined:
    Aug 21, 2017
    Posts:
    6
    Cool, that works!. It would be nice to have that position = pos in there in the example code so others can use it as well
    So now I am able to precisely click from the browser in the Unity world using this

    Code (CSharp):
    1.  
    2. var ray = MainCamera.ScreenPointToRay(new Vector2( (x/1280) * Screen.width, (y/720) * Screen.height ));
    3. if (Physics.Raycast(ray, out var hit, 1000))
    4. {
    5.    //do something with  hit.point or hit.collider
    6. }
    7.  
    Thanks!

     
  6. sindharta_at_unity

    sindharta_at_unity

    Unity Technologies

    Joined:
    Jul 4, 2019
    Posts:
    24
    Thanks for the suggestion. We are not using position in the demo, but as you said, it would be a good idea to just put it in and let others customize what they want to use with it.
     
  7. kayy

    kayy

    Joined:
    Jul 26, 2011
    Posts:
    57
    I like to integrate the UnityRenderStremaing and WebRTC packages into an existing project to provide a prototye for the Windows version. Now the nightly build crashes for all non-Windows platforms like WebGL, Android, ...

    How can I deal with this kind of problem?
    In another project I ended up with manipulating the package manifest in an editor callback method. This worked basically but was a pretty unstable approach.
     
  8. Tobs-

    Tobs-

    Joined:
    Feb 12, 2016
    Posts:
    10
    I can see Unity.webrtc release 2.0 is already in git, but is it actually official released yet? I am asking because I need the multi-camera support :)
     
  9. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    24
    version 2.0 is in development now. I am sorry to have kept you waiting.
     
  10. kayy

    kayy

    Joined:
    Jul 26, 2011
    Posts:
    57
    I post the workaround I found for my own problem. I made a copy of the WebRTC package content from /Library/PackageCache/com.unity.webrtc@1.0.1-preview to /Packages/com.unity.webrtc (without version! ) and make the following 2 changes:
    • Unity.WebRTC.Runtime.asmdef:
      Exlude non-Widnows-Platforms
    • Add some #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN to Assets/Scripts/RenderStreaming.cs so that it is considered only for Windows (or to whatever classes you have on your own that uses namespace Unity.WebRTC)
    It would be great if the asmdef changes will be included in the next version of WebRTC or an alternative approach like providing dummy DLLs, ... Thanks
     
  11. sindharta_at_unity

    sindharta_at_unity

    Unity Technologies

    Joined:
    Jul 4, 2019
    Posts:
    24
    Thank you for the feedback. As you said, the current released version only works on Windows, but we are also working to support other platforms as well. We'll try to see how we can prevent the problems that occurred on your side in the next version.
     
    kayy likes this.
  12. globalikslivov

    globalikslivov

    Joined:
    Dec 6, 2019
    Posts:
    1
    Why web server does not using web socket as signaling mechanism??
     
  13. cchang326

    cchang326

    Joined:
    Dec 6, 2019
    Posts:
    1
    I'm trying the plugin and got the following error for RenderStreaming in the Inspector window:
    The associated script can not be loaded. Please fix any compile errors and assign a valid script.

    I'm following the tutorial. Any idea how to resolve the error?
     
  14. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    24
    I agree to use Websocket as signaling technology but Websocket is not officially supported on Unity.
    If you want to use it, you can try "websocket-sharp" http://sta.github.io/websocket-sharp/
     
  15. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    24
  16. RanLehr

    RanLehr

    Joined:
    Nov 1, 2018
    Posts:
    1
    How can I use it in Android WebView ?
     
  17. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    24
    I am not sure about that but it might be working or not depends on the implementation of the WebView.

    This article is showing working WebRTC normally on Android WebView. (sorry this is written in Japanese)
    https://qiita.com/v-cube/items/09cf8d59b7a8e7821b89