Steamworks Documentation
ISteamVideo Interface
Provides functions to interface with the Steam video and broadcasting platforms.

See features/streaming_video for more information.

Member Functions

Member functions for ISteamVideo are called through the global accessor function SteamVideo().

GetOPFSettings

void GetOPFSettings( AppId_t unVideoAppID );
NameTypeDescription
unVideoAppIDAppId_tThe video app ID to get the OPF details of.

Get the OPF details for 360 video playback

To retrieve the 360 OPF (open projection format) data to playback a 360 video, start by making a call to this, then the callback will indicate whether the request was successful. If it was successful, the actual OPF JSON data can be retrieved with a call to GetOPFStringForApp.

Returns: void
Triggers a GetOPFSettingsResult_t callback.

GetOPFStringForApp

bool GetOPFStringForApp( AppId_t unVideoAppID, char *pchBuffer, int32 *pnBufferSize );
NameTypeDescription
unVideoAppIDAppId_tThe video app ID to get the OPF string for.
pchBufferchar *Returns the OPF string by writing it to this buffer.
pnBufferSizeint32 *This should be set to the size of pchBuffer, and returns the number of bytes written to pchBuffer.

Gets the OPF string for the specified video App ID.

Once the callback for GetOPFSettingsResult_t has been raised and the EResult indicates success, then calling this will return back the actual OPF data in a JSON format. The size of the OPF string varies, but at this time 48,000 bytes should be sufficient to contain the full string. If it is not, pnBufferSize will be set to the size required. In that case, make a second call with the correct buffer size.

NOTE: The data returned in a successful call to GetOPFStringForApp() can only be retrieved once. If you need to retrieve it multiple times, a call to GetOPFSettings will need to be made each time.

Returns: bool
true if we have the OPF details from a previous call to GetOPFSettings, otherwise false.

Returns the details in pchBuffer.

For a description of the OPF format and an example response, please see the Pixvana OPF web page.

GetVideoURL

void GetVideoURL( AppId_t unVideoAppID );
NameTypeDescription
unVideoAppIDAppId_tThe video app ID to receive the video stream for.

Asynchronously gets the URL suitable for streaming the video associated with the specified video app ID.

Returns: void
Triggers a GetVideoURLResult_t callback.


See Also: DASH on Wikipedia

IsBroadcasting

bool IsBroadcasting( int *pnNumViewers );
NameTypeDescription
pnNumViewersint *Returns the number of viewers currently watching the live broadcast.

Checks if the user is currently live broadcasting and gets the number of users.

Returns: bool
true if user is uploading a live broadcast, otherwise false.

Returns the number of viewers via pnNumViewers if the user is currently broadcasting.

Callbacks

These are callbacks which can be fired by calling SteamAPI_RunCallbacks. Many of these will be fired directly in response to the member functions of ISteamVideo.

BroadcastUploadStart_t

Automatically called whenever the user starts broadcasting.

This callback has no fields.

BroadcastUploadStop_t

Automatically called whenever the user stops broadcasting.

NameTypeDescription
m_eResultEBroadcastUploadResultThe reason why the broadcast has stopped.

GetOPFSettingsResult_t

Triggered when the OPF Details for 360 video playback are retrieved.
After receiving this you can use GetOPFStringForApp to access the OPF details.

NameTypeDescription
m_eResultEResultThe result of the operation.
Possible values:
m_unVideoAppIDAppId_tThe app ID of the video that we got the details of.

Associated Functions: GetOPFSettings

GetVideoURLResult_t

Provides the result of a call to GetVideoURL.

NameTypeDescription
m_eResultEResultThe result of the operation.
m_unVideoAppIDAppId_tThe App ID provided in the original call to GetVideoURL.
m_rgchURLchar[256]If the call was successful this contains the URL to the MPEG-DASH Standard schema formatted xml document which can be used to stream the content.

Associated Functions: GetVideoURL

Constants

These are constants which are defined for use with ISteamVideo.

NameTypeValueDescription
STEAMVIDEO_INTERFACE_VERSIONconst char *"STEAMVIDEO_INTERFACE_V002"