Steamworks Documentation
ISteamRemotePlay Interface
Functions that provide information about Steam Remote Play sessions, streaming your game content to another computer or to a Steam Link app or hardware.

See Steam Remote Play for more information.

Member Functions


Member functions for ISteamRemotePlay are called through the global accessor function SteamRemotePlay().

GetSessionCount

uint32 GetSessionCount();
Get the number of currently connected Steam Remote Play sessions

Returns: uint32
The number of currently connected Steam Remote Play sessions

Example:
bool BSteamRemotePlayActive() { uint32 unSessionCount = SteamRemotePlay()->GetSessionCount(); for ( uint32 iIndex = 0; iIndex < unSessionCount; iIndex++ ) { RemotePlaySessionID_t unSessionID = SteamRemotePlay()->GetSessionID( iIndex ); if ( !unSessionID ) { continue; } return true; } return false; }

GetSessionID

uint32 GetSessionID( int iSessionIndex );
NameTypeDescription
iSessionIndexintThe index of the specified session

Get the currently connected Steam Remote Play session ID at the specified index

Returns: uint32
The session ID of the session at the specified index, or 0 if the index is less than 0 or greater than or equal to GetSessionCount()

GetSessionSteamID

CSteamID GetSessionSteamID( uint32 unSessionID );
NameTypeDescription
unSessionIDuint32The session ID to get information about

Get the SteamID of the connected user

Returns: CSteamID
The Steam ID of the user associated with the Remote Play session. This would normally be the logged in user, or a friend in the case of Remote Play Together.

GetSessionClientName

const char *GetSessionClientName( uint32 unSessionID );
NameTypeDescription
unSessionIDuint32The session ID to get information about

Get the name of the session client device

Returns: const char *
The name of the device associated with the Remote Play session, or NULL if the session ID is not valid.

GetSessionClientFormFactor

ESteamDeviceFormFactor GetSessionClientFormFactor( uint32 unSessionID );
NameTypeDescription
unSessionIDuint32The session ID to get information about

Get the form factor of the session client device

Returns: ESteamDeviceFormFactor
The form factor of the device associated with the Remote Play session, or k_ESteamDeviceFormFactorUnknown if the session ID is not valid.

Example:
bool BSteamRemotePlayToPhone() { uint32 unSessionCount = SteamRemotePlay()->GetSessionCount(); for ( uint32 iIndex = 0; iIndex < unSessionCount; iIndex++ ) { RemotePlaySessionID_t unSessionID = SteamRemotePlay()->GetSessionID( iIndex ); if ( !unSessionID ) { continue; } ESteamDeviceFormFactor eFormFactor = SteamRemotePlay()->GetSessionClientFormFactor( unSessionID ); if ( eFormFactor == k_ESteamDeviceFormFactorPhone ) { return true; } } return false; }

BGetSessionClientResolution

bool BGetSessionClientResolution( uint32 unSessionID, int *pnResolutionX, int *pnResolutionY );
NameTypeDescription
unSessionIDuint32The session ID to get information about
pnResolutionXintA pointer to a variable to fill with the device resolution width
pnResolutionYintA pointer to a variable to fill with the device resolution height

Get the resolution, in pixels, of the session client device. This is set to 0x0 if the resolution is not available.

Returns: bool
true if the session ID is valid; otherwise, false.

Example:
// This can return false if the remote device doesn't provide device resolution information bool BGetSteamRemotePlayResolution( int *pnX, int *pnY ) { int nMaxResolutionX = 0, nMaxResolutionY = 0; uint32 unSessionCount = SteamRemotePlay()->GetSessionCount(); for ( uint32 iIndex = 0; iIndex < unSessionCount; iIndex++ ) { RemotePlaySessionID_t unSessionID = SteamRemotePlay()->GetSessionID( iIndex ); if ( !unSessionID ) { continue; } int nResolutionX = 0, nResolutionY = 0; SteamRemotePlay()->BGetSessionClientResolution( unSessionID, &nResolutionX, &nResolutionY ); if ( nResolutionX > nMaxResolutionX ) { nMaxResolutionX = nResolutionX; nMaxResolutionY = nResolutionY; } } if ( pnX ) { *pnX = nMaxResolutionX; } if ( pnY ) { *pnY = nMaxResolutionY; } return ( nMaxResolutionX > 0 && nMaxResolutionY > 0 ); }

BStartRemotePlayTogether

bool BStartRemotePlayTogether();

Show the Remote Play Together UI.

Returns: bool
true if your game is configured for Remote Play Together; otherwise, false.

BSendRemotePlayTogetherInvite

bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend );
NameTypeDescription
steamIDFriend CSteamIDThe Steam ID of the friend you'd like to invite

Invite a friend to join the game using Remote Play Together

Returns: bool
true if the invite was successfully sent; otherwise, false.

Callbacks

These are callbacks which can be fired by calling SteamAPI_RunCallbacks.

SteamRemotePlaySessionConnected_t


NameTypeDescription
m_unSessionIDuint32The session ID of the session that just connected

SteamRemotePlaySessionDisconnected_t


NameTypeDescription
m_unSessionIDuint32The session ID of the session that just disconnected

Enums

These are enums which are defined for use with ISteamRemotePlay.

ESteamDeviceFormFactor

The form factor of a device

NameValueDescription
k_ESteamDeviceFormFactorUnknown0The device form factor isn't available.
k_ESteamDeviceFormFactorPhone1The device is a phone or other small handheld device with touchscreen.
k_ESteamDeviceFormFactorTablet2The device is a tablet or other large handheld device with a touchscreen.
k_ESteamDeviceFormFactorComputer3The device is a desktop computer or laptop.
k_ESteamDeviceFormFactorTV4The device is a TV.