Desktop Vision for Unity
Desktop Vision is a package that allows Desktop Vision to be integrated into Unity applications.
If you are interested in using Desktop Vision in your application, please contact us contact@desktop.vision.
Overview
Desktop Vision utilizes webRTC to connect desktops (mac/linux/windows) through the use of a Streamer App. Once the Desktop Vision streamer app is installed and signed in, the computer will appear in your computers list. You will be able to connect to & control this device from any web browser.
Desktop Vision grants oauth access to device lists with the Desktop Vision API through an oauth code flow. The Desktop Vision Unity Package automatically generates and displays a code through the menu prefab, but as long as you have a valid API key and APP ID, it is possible to create custom oauth flows.
Ultimately, any generated oauth code will be invalid until it is manually activated by a user from the Desktop Vision platform here. This page will inform users that they are granting temporary access to their devices by activating the oauth code.
After an oauth token has been validated, an access token is requested from the Desktop Vision API, which grants access to the users computers. The menu prefab will automatically use the token to list user computers after the "validate" button is pressed. The computers listed are UI buttons that, when triggered, will spawn a Desktop Vision Computer in the scene.
Installation
From Package file
- Download the package file from here
- Drag the Desktop Vision unity package file into your project
- Download Unity WebRTC from here
- Case of Unity 2020.3 or newer:
- Select Window/Package Manager in the menu bar.
- Check Package Manager window, Click + button and select Add package from git URL....
- Enter:
com.unity.webrtc@2.4.0-exp.11
- Click add
- Case of Unity 2020.3 or newer:
From disk (not recommended)
- Navigate to Window > Package Manager
- Click
+
button and selectAdd package from disk
. - Select the
package.json
file
Requirements
This page lists the Unity version and platform that the package supports.
Unity Version
It is recommended to use the latest Long-Term Support (LTS) version of Unity, see the post in Unity blog for LTS versions.
This version of the package is confirmed to be compatible with at least the following versions of the Unity Editor:
- Unity 2019.4
- Unity 2020.3
- Unity 2021.3
Support Platform
- Windows
- Linux
- macOS (Intel and Apple Slicon)
- iOS
- Android (ARM64 only. ARMv7 is not supported)
Additional Notes
Please note that there are unsupported platforms below.
- Windows UWP platform is not supported.
- Building for iOS Simulator is not supported.
- WebGL platform is not supported.
Build on Linux
On Linux, libc++1
libc++abi1
packages should be installed.
Please install like command below
sudo apt install -y libc++1 libc++abi1
Build on Android
To build the apk file for Android platform, you need to configure player settings below.
- Choose IL2CPP for Scripting backend in Player Settings Window.
- Set enadle ARM64 and Set disable ARMv7 for Target Architectures setting in Player Settings Window.
Note
Set disable Optimized Frame Pacing in Player Settings Window. ( Known issues https://github.com/Unity-Technologies/com.unity.webrtc/issues/437)
Quick Start
Menu Quick Start from Prefab
After adding Desktop Vision to your project, drag the Menu Prefab from Packages > Runtime > Prefabs > Menu
into your scene. Configure your API key & APP ID, then click play.
- On the menu script & prefab you may set a custom position where the screen will spawn. Alternatively, you can have computers spawn infront of the camera.
- The menu can track camera movement, or remain fixed.
- Screen Size determines the height of the screen. The width will be determined by the computer aspect ratio.
Managed Computer Quick Start from Prefab
After adding Desktop Vision to your project, drag the Menu Prefab from Packages > Runtime > Prefabs > ManagedComputer
into your scene. Set the z coordinate of the game object to be in front of the camera. Configure your API key & APP ID, then click play.
- You can reset the screen to a "screensaver" by clicking the refresh button.
- You can generate a new oauth code by clicking the desktop vision logo button.
Menu Quick Start from Sample
- Navigate to
Window > Package Manager > Packages - Vali Ventures > Desktop Vision
. - Expand
Samples
. - Import
Desktop Vision Open XR - Menu
. - In the Unity Editor, under
Samples/Desktop Vision/1.0.0/Desktop Vision Open XR/Scenes
, open theDesktop Vision Open XR.unity
file. - Click on the menu prefab.
- Edit the DV Menu script to add your Desktop Vision App Id & Desktop Vision Api key.
- Click the play button.
Managed Computer Quick Start from Sample
- Navigate to
Window > Package Manager > Packages - Vali Ventures > Desktop Vision
. - Expand
Samples
. - Import
Desktop Vision Open XR - Computer
. - In the Unity Editor, under
Samples/Desktop Vision/1.0.0/Desktop Vision Open XR/Scenes
, open theDesktop Vision Open XR.unity
file. - Click on the Managed Computer prefab.
- Edit the DV Managed Computer script to add your Desktop Vision App Id & Desktop Vision Api key.
- Click the play button.
Managed Computer Quick Start from Fresh Project
- Enable OpenXR in project settings.
Edit > Project Settings > XR Plug-in Management
- Enable XR Plug-in Management if not already enabled.
- Under Plugin-in Providers, select Open XR.
- Add the Desktop Vision Unity Package from
Window > Package Manager
. - Enable TMP Pro.
- In the scene, add an XR Origin Action based.
- Add the Desktop Vision ManagedComputer prefab from
Packages > Desktop Vision > Runtime > Assets > Prefabs > ManagedComputer
. - Select the ManagedComputer and fill in the
App Id
&Api Key
fields. - Set the ManagedComputer Position to
{ x: 0, y: 0, z: 2 }
. - Press the play button, a screen with an oauth code should appear. Enter this code at https://desktop.vision/app/#/authorize
- You will automatically be connected to the selected computer.
- Click the refresh button to reset the computer.
- Click the Desktop Vision logo to generate a new code.
Menu Quick Start from Fresh Project
- Enable OpenXR in project settings.
Edit > Project Settings > XR Plug-in Management
- Enable XR Plug-in Management if not already enabled.
- Under Plugin-in Providers, select Open XR.
- Add the Desktop Vision Unity Package from
Window > Package Manager
. - Enable TMP Pro.
- In the scene, add an XR Origin Action based.
- Add the Desktop Vision Menu prefab from
Packages > Desktop Vision > Runtime > Assets > Prefabs > Menu
. - Select the menu and fill in the
App Id
&Api Key
fields. - Set the Screen Position to
{ x: 0, y: 0, z: 2 }
. - Press the play button, a menu with an oauth code should appear. Enter this code at https://desktop.vision/app/#/authorize
- A confirmation note will appear at the bottom of https://desktop.vision/app/#/authorize
- Back in our unity application, click the validate button.
- Select a desktop to control from the list of computers.
- The desktop will appear in the game view. It can also be viewed from the scene view.
- Click the refresh button to remove the computer.
Additional notes:
- In order to use Desktop Vision in XR, you may need to set up the XR origin again, and apply left/right controller filters to the project.
Demo
You can find various videos and demonstrations of Desktop Vision on our YouTube Channel.
Demo of the Unity Package
Streamer App
Computer select screen
Desktop Vision Menu oauth code
Authorizescreen for oauth code validation
Computer list screen after activating the oauth code
Desktop Vision Computer in Game View
Desktop Vision Unity Documentation & More
View our documentation here