Skip to content

Latest commit

 

History

History
63 lines (42 loc) · 1.41 KB

api_transition_guide.md

File metadata and controls

63 lines (42 loc) · 1.41 KB

Migrating from libspsfrontend <=0.1.4

All SPS versions after 0.1.4 are now using the Epic Games' Pixel Streaming frontend. This shift to the Epic frontend has caused us to change both our API and our NPM packages.


API Usage

Below are common usage of SPS Frontend API that have now changed (this list is not exhaustive, if there are more you would like documented please open an issue).

Listening for UE messages

Before:

iWebRtcController.dataChannelController.onResponse = (messageBuffer) => { 
	/* whatever */ 
}

Now:

pixelstreaming.addResponseEventListener(name, funct)

// or

pixelstreaming.removeResponseEventListener(name)

(More details here)


Sending messages to UE

Before:

iWebRtcController.sendUeUiDescriptor(JSON.stringify({ /* whatever */ } )) 

Now:

pixelstreaming.emitUIInteraction(data: object | string)

(More details here)


Listen for WebRTC stream start?

Before:

override onVideoInitialised()

Now:

pixelStreaming.addEventListener("videoInitialized", ()=> { /* Do something */ });

(More details here)