unreal.PixelStreaming2Blueprints

class unreal.PixelStreaming2Blueprints(outer: Object | None = None, name: Name | str = 'None')

Bases: BlueprintFunctionLibrary

Pixel Streaming 2Blueprints

C++ Source:

  • Plugin: PixelStreaming2

  • Module: PixelStreaming2

  • File: PixelStreaming2Blueprints.h

classmethod add_json_string_value(descriptor, field_name, string_value) -> (new_descriptor=str, success=bool)

Helper function to add a string field to a JSON descriptor. This produces a new descriptor which may then be chained to add further string fields.

Parameters:
  • descriptor (str) – The initial JSON descriptor which may be blank initially.

  • field_name (str) – The name of the field to add to the JSON.

  • string_value (str) – The string value associated with the field name.

Returns:

new_descriptor (str): The JSON descriptor with the string field added.

success (bool): True if the string field could be added successfully.

Return type:

tuple

classmethod force_key_frame() None

Force a key frame to be sent to the default streamer (if there is one).

classmethod freeze_frame(texture) None

Freeze the video stream of the default streamer (if there is one).

Parameters:

texture (Texture2D) – The freeze frame to display. If null then show the last frame that was streamed.

classmethod get_connected_players() Array[str]

brief: Get the connected players

Returns:

TArray<FString> The connected players

Return type:

Array[str]

classmethod get_default_streamer_id() str

Get the default Streamer ID

Return type:

str

classmethod get_delegates() PixelStreaming2Delegates

Get the singleton. This allows application-specific blueprints to bind to delegates of interest.

Return type:

PixelStreaming2Delegates

classmethod get_json_string_value(descriptor, field_name) -> (string_value=str, success=bool)

Helper function to extract a string field from a JSON descriptor of a UI interaction given its field name. The field name may be hierarchical, delimited by a period. For example, to access the Width value of a Resolution command above you should use “Resolution.Width” to get the width value.

Parameters:
  • descriptor (str) – The UI interaction JSON descriptor.

  • field_name (str) – The name of the field to look for in the JSON.

Returns:

string_value (str): The string value associated with the field name.

success (bool): True if the field exists in the JSON data.

Return type:

tuple

classmethod kick_player(player_id) None

Kick a player that is connected to the default streamer (if there is a default streamer).

Parameters:

player_id (str) – The ID of the player to kick.

classmethod send_file(filepath, mime_type, file_extension) None

Send a specified file over the WebRTC peer connection data channel. The extension and mime type are used for file reconstruction on the front end

Parameters:
  • filepath (str) – The path to the file that will be sent

  • mime_type (str) – The mime type of the file. Used for file reconstruction on the front end

  • file_extension (str) – The file extension. Used for file reconstruction on the front end

classmethod send_file_as_byte_array(byte_array, mime_type, file_extension) None

Send a specified byte array over the WebRTC peer connection data channel. The extension and mime type are used for file reconstruction on the front end

Parameters:
  • byte_array (Array[uint8]) – The raw data that will be sent over the data channel

  • mime_type (str) – The mime type of the file. Used for reconstruction on the front end

  • file_extension (str) – The file extension. Used for file reconstruction on the front end

classmethod send_response(descriptor) None

Send Response

Parameters:

descriptor (str)

classmethod streamer_force_key_frame(streamer_id) None

Force a key frame to be sent to the specified streamer.

Parameters:

streamer_id (str)

classmethod streamer_freeze_stream(streamer_id, texture) None

Freeze the video stream of the specified video stream.

Parameters:
  • streamer_id (str) – The id of the streamer to freeze.

  • texture (Texture2D) – The freeze frame to display. If null then show the last frame that was streamed.

classmethod streamer_get_connected_players(streamer_id) Array[str]

brief: Get the connected players

Parameters:

streamer_id (str) – The streamer whose list of players you wish to get

Returns:

TArray<FString> The connected players

Return type:

Array[str]

classmethod streamer_kick_player(streamer_id, player_id) None

Kick a player connected to the specified streamer.

Parameters:
  • streamer_id (str) – The streamer which the player belongs

  • player_id (str) – The ID of the player to kick.

classmethod streamer_send_file(streamer_id, filepath, mime_type, file_extension) None

Send a specified file over the WebRTC peer connection data channel. The extension and mime type are used for file reconstruction on the front end

Parameters:
  • streamer_id (str) – The streamer use when sending the data

  • filepath (str) – The path to the file that will be sent

  • mime_type (str) – The mime type of the file. Used for file reconstruction on the front end

  • file_extension (str) – The file extension. Used for file reconstruction on the front end

classmethod streamer_send_file_as_byte_array(streamer_id, byte_array, mime_type, file_extension) None

Send a specified byte array over the WebRTC peer connection data channel. The extension and mime type are used for file reconstruction on the front end

Parameters:
  • streamer_id (str) – The streamer use when sending the data

  • byte_array (Array[uint8]) – The raw data that will be sent over the data channel

  • mime_type (str) – The mime type of the file. Used for reconstruction on the front end

  • file_extension (str) – The file extension. Used for file reconstruction on the front end

classmethod streamer_send_response(streamer_id, descriptor) None

Streamer Send Response

Parameters:
  • streamer_id (str)

  • descriptor (str)

classmethod streamer_unfreeze_stream(streamer_id) None

Unfreeze the video stream of the specified streamer.

Parameters:

streamer_id (str) – The id of the streamer to unfreeze.

classmethod unfreeze_frame() None

Unfreeze the video stream of the default streamer (if there is one).