VueJS

triangle-exclamation

The example below demonstrates how to integrate the Arcware Pixel Streaming WebSDK into a Vue.js application (Vue 3).

This example shows how to:

  • initialize the WebSDK inside a Vue component

  • attach the stream to a DOM container using Vue refs

  • send commands from the web interface to Unreal Engine

You can also experiment with this example using CodePen:

Open the Vue example on CodePenarrow-up-right

Replace the example shareId with your own project Share ID to connect to your application.


Code Template

For a quick start, you can use the following implementation.


Step 1 — Create the PixelStreaming Component

Create a new file called:

PixelStreaming.vue

Step 2 — Import the Component

Now import the component into your main application file.

Example App.vue:


How This Example Works

1. Initialize the SDK

The ArcwareInit function creates the WebSDK components and prepares the streaming connection.


2. Mount the Stream

A Vue ref (videoContainerRef) is used to access the container element.

The SDK provides the streaming container via:

This element contains the video player and input handling logic.


3. Send Messages to Unreal Engine

The function

allows the web UI to send commands to the Unreal application.

In this example, clicking the button sends a simple test message.


Notes

  • Replace <your-shareId-goes-here> with your project’s Share ID.

  • The stream should always be mounted inside onMounted() to ensure the DOM container exists.

  • Vue refs are used to safely access DOM elements inside the component lifecycle.

Last updated