Hi,
I was following this link to try to customize the player.html page:
## Communicating from UE5 to the Player Page
You can make your Unreal Engine application emit custom events to all connected player HTML pages, which you can respond to in the player's JavaScript environment. This lets you change your web page UI in response to gameplay events.
To set this up:
1. In your Unreal Engine application, any time you want to emit an event to the player page, you need an actor with a **Pixel Streaming Input** component. This component has access to the **Send Pixel Streaming Response** node. Specify a custom string argument to the node to send a message to the web frontend.
<p align="center">
<img src="Resources\Images\pixelstreaming-send-game-event.png" alt="Send game event">
</p>
2. In your TypeScript frontend implementation these messages are consumed by an event listener. This event will be invoked every time the frontend receives a custom message from the Unreal Engine application. The original string argument given to the **Send Pixel Streaming Response** node will be passed to the function as the `response` argument. For example:
```typescript
public myHandleResponseFunction(response: string) => void {
Logger.Info(Logger.GetStackTrace(), "Response received!");
switch (response) {
case "MyCustomEvent":
This file has been truncated. show original
However, when I followed this:
Upon inspection of the webpage, I found this error:
Based on the GitHub documentation, addResponseEventListener was supposed to be defined within PixelStreaming.ts; however, it does not seem that the player.html is accessing it.
I have very little experience with JavaScript, let alone TypeScript, so I am very stumped for now; would much appreciate if someone can help me on this.
Thank you!
system
(system)
Closed
September 6, 2023, 8:49am
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.