Polyv Help Center

Help Center

Set Video Player

Updated: 2022-05-23 19:02:59

Interface URL

https://api.polyv.net/v2/play/set-video-player

Interface Description

Set the video player

Supported Format

JSON

Request Method

POST

Request Parameters

Parameter Required Type & Scope Description
userid Yes string User ID
ptime Yes long Current time in milliseconds (13 digits), valid within 3 minutes
sign Yes String Signature, a 40-character uppercase SHA1 value [See Signature Generation Rules]
vid Yes string Video VID
playerId Yes string Player ID

Example of Successful JSON Response

{
    "code": 200,
    "status": "success",
    "message": "success",
    "data": null
}

Example of Error JSON Response

签名不正确
{
    "code":400,
    "status":"error",
    "message":"the sign is not right",
    "data":""
}
时间戳过期
{
    "code":400,
    "status":"error",
    "message":"ptime is too old.",
    "data":""
}

Field Description

Field Type Description
code int Return code
status string Return status
message string Return message
data object Operation result

Java Request Example:

    public void testSetVideoPlayer() throws Exception {
        String url = "https://api.polyv.net/v2/play/set-video-player";
        Map<String, String> params = new HashMap<>();
        params.put("userid", userid);
        params.put("ptime", String.valueOf(System.currentTimeMillis()));
        params.put("vid", "a2dc4f25174db4e911ce6fbf2cbd81cc_a");
        params.put("playerId", "xEmAR1T2b4");
        params.put("sign", getSign(params, secretkey));
        String response = HttpClientUtil.getInstance().sendHttpPost(url, params);
        System.out.println(response);
    }
联系客服,在线咨询