1 Overview
1.1 Project Address
1.2 Overview
The basic initialization of the polyv-android-sdk-2.0-demo can use the SDK加密串 加密密钥 加密向量 provided by the Polyv official website, or use account parameters such as userid writetoken readtoken secretkey. If using an externally provided playback authentication method, there is no need to configure SDK加密串 or secretkey. Instead, call client.settingsUserid(userId, null, null) to complete initialization.
For security reasons, it is not recommended to write account authentication information such as SDK加密串 and secretkey in plaintext into client code or APP configuration files. In a production environment, it is more advisable to store sensitive information like secretkey on your server, generate the token required for playback or download on the server, and then deliver it to the client. When using externally provided playback authentication, replace the original configuration of SDK加密串 or secretkey with client.settingsUserid(userId, null, null). For playback scenarios, refer to "Externally Provided Playback Credentials" in 4. Video Playback; for download scenarios, refer to "Token Callback for Video Download" in 5. Video Download.
Definition
SDK加密串 is a unique ID string provided by Polyv for developers. It is a string encrypted using 加密密钥 加密向量 based on userid writetoken readtoken secretkey. Meanwhile, 加密密钥 加密向量 are used to encrypt and decrypt SDK加密串.
userid writetoken readtoken secretkey are account parameters used to verify legitimacy when using services provided by Polyv. SDK加密串 is essentially generated by encrypting these account parameters, and like directly using secretkey, it is not recommended as a client authentication solution in production environments. To reduce the risk of account information leakage, prioritize using the server-generated token method to complete playback and download authorization.
How to Obtain
Log in to the Polyv official website backend > Cloud Video on Demand > Settings (top right corner) > API Interface page.
In the demo, either set of these parameters can be used to run correctly. For the differences between these two sets of parameters, see here. When officially launching, combine playback token and download token solutions for permission control, and do not rely on fixed authentication information embedded in the client to protect video resources.
