Documentation
  • Welcome to Odyssey
  • Upload a project
    • Getting Started
    • Set up your project
    • Package for Linux (it's easy)
    • Upload your project
    • Create and publish your space
  • Instant Multiplayer
    • Quickstart
    • Spatial voice & video
      • Add spatial comms to player
      • Huddle
      • Share your screen
    • Avatars
      • Using Avatars
      • Avatar Blueprints
  • Realtime Configurator
    • Quickstart
    • Sketchfab importer
    • Actor importer
    • Level & object configurator
      • Level configurator
      • Object configurator
      • Configurator blueprint API
    • Media importer
      • Vimeo & web panels
      • Dolby.io in-world streams
  • Embed in a website
    • Enable embedding
    • Pass messages to and from Unreal
      • Sending messages to Unreal
      • Receiving messages from Unreal
    • Manage your stream
      • Stream loading states
      • Session states
      • Stream quality settings
      • Dynamic styling
  • Admin
    • Sharing and permissions
    • Subscriptions
    • Purchase stream hours
  • FAQ
    • Our GPUs (Coreweave)
    • Concurrent user limits
    • Vulkan renderer
    • In-world video support on Linux
  • Guides
    • Add the Odyssey plugin
    • Validate your project settings
    • Troubleshoot "Project zip is invalid"
Powered by GitBook
On this page
  • Overview
  • Sending messages from webpage
  • Example payload
  • Receiving Pixel Streaming messages in UE
  1. Embed in a website
  2. Pass messages to and from Unreal

Sending messages to Unreal

Overview

In this step-by-step guide, we implement a gameplay feature where a colored cube gets spawned in front of the player whenever we receive a Pixel Streaming message. This simple interaction showcases the seamless integration between your webpage and Unreal project.

Sending messages from webpage

Once a connection between your webpage and the Odyssey iframe has been established, you will be able to send Pixel Streaming messages to Odyssey using the function:

function sendPixelStreamMessage(psKey: string, psValue: any) {
    // stringify and send data
    if (channel ) {
          const data = { type: 'ps', psKey, psValue }
          const jsonString = JSON.stringify(data)
          channel.port2.postMessage(jsonString)
    } else {
          console.error('Message channel not established.')
    }
}

Example payload

{
  "type": "ps",
  "psKey": "SpawnCube",
  "psValue": "0.863,0.208,0.271"
}

Receiving Pixel Streaming messages in UE

Documentation coming soon...

Last updated 1 year ago