This topic provides API calling examples for you to obtain playback URLs and playback credentials. The API operations used in this topic are encapsulated in ApsaraVideo server operation SDK for Java.
Usage notes
For more information about the request and response parameters of API operations, visit OpenAPI Explorer and find the documentation of the API operation in the left-side navigation pane.
To obtain sample code of the SDK, visit OpenAPI Explorer. Visit Alibaba Cloud OpenAPI Explorer. In the left-side navigation pane, find the API operation whose sample code you want to obtain and specify the required parameters on the Parameters tab. Then, click Initiate Call. On the SDK Sample Code tab, select the desired language to view and download the sample code. For more information, see Automatic generation of SDK examples.
Initialize the client
Before you use the SDK, initialize a client. For more information, see Initialization.
Obtain a playback URL
You can call the GetPlayInfo operation to obtain a playback URL.
For more information, visit OpenAPI Explorer.
After you obtain the playback URL, you can use the playback URL to play the video in a client. For more information, see Use playback URLs to play videos.
Obtain a playback credential
You can call the GetVideoPlayAuth operation to obtain a playback credential.
For more information, visit OpenAPI Explorer.
After you obtain the playback credential, you can use the playback credential to play the video in a client. For more information, see Use playback credentials to play videos.