Polyv Help Center

Help Center

Update Player Logo Information

Updated: 2025-02-20 19:09:11

API Description

更新一个播放器的logo设置信息

API URL

http://api.polyv.net/v2/player/update-logo

Online API Call

Request Method

POST

API Constraints

  1. The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details

Request Parameter Description

Parameter Required Type Description
userid true String Account ID
ptime true Long Current time in milliseconds timestamp, valid for 3 minutes
sign true String Signature, a 40-character uppercase SHA1 value. The secretkey used to generate the signature is critical for communication data security. It must never be used directly on the client side. All APIs must be called through your own server to relay requests to the POLYV server for response data. See signature generation rules
playerId true String Player ID
logoImageFile false File Logo image file, max size 5MB
Supported file types: jpg, jpeg, png, gif
logoLinkUrl false String Logo click redirect URL
logoOpacity false String Logo opacity, 0~100, must be a multiple of 10, e.g., 0, 10, 20, etc.
logoDisplayLocation false String Logo display position
0: Do not display
1: Top left
2: Top right
3: Bottom left
4: Bottom right

Example

http://api.polyv.net/v2/player/update-logo?userid=abcde12345sign=F809B946258A112A78627A832B1F6A7D&ptime=1617845463779&playerId=xxx&logoOpacity=100&logoDisplayLocation=1&logoLinkUrl=xxx

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure See global error description
status String Response status text
message String Response description message, assists in describing the error reason when code is 400 or 500
data Object Returns updated player information on success [See data field description](/vod/api/player/update_logo.md?id=data字段说明], returns empty on failure

data Field Description

Field Type Description
playerId String Player ID, e.g., "1b448be323"
playerName String Player name
isDefault Integer Whether it is the default player, 1: Yes, 0: No
updateTime String Last update time, e.g., "2025-02-18 14:51:36"
skin Object Player skin settings, see skin field description
logo Object Player logo settings, see logo field description
teaserTrailer Object Player teaser/trailer settings, see teaserTrailer field description

skin Field Description

Field Type Description
skinTheme String Skin theme
skin_blue: Simple Elegant Black
skin_gold: Noble Gold
skin_green: Fresh Green
skin_red: Vibrant Red
skinColor String Skin color, e.g., "#03a9f4"
skinColorApplyType String Skin color application type
panel: Panel
control: Control bar
skinControlLocation String Control bar position
0: Do not display
1: Inside video
2: Outside video

logo Field Description

Field Type Description
logoImageUrl String Logo image URL
logoLinkUrl String Logo click redirect URL
logoOpacity Integer Logo opacity, 0~100
logoDisplayLocation Integer Logo display position
0: Do not display
1: Top left
2: Top right
3: Bottom left
4: Bottom right

teaserTrailer Field Description

Field Type Description
teaserShow Integer Show teaser, 1: Yes, 0: No
teaserMediaUrl String Teaser video or image URL
teaserPlayTime Integer Teaser play duration (seconds)
trailerShow Integer Show trailer, 1: Yes, 0: No
trailerMediaUrl String Trailer video or image URL
trailerPlayTime Integer Trailer play duration (seconds)

Java Request Example

For quick integration of the base code, please download the relevant dependency source code. Click to download source code. After downloading, add it to your own source code project. The HttpUtil.java and VodSignUtil.java in the test cases are included in the download file.

It is strongly recommended to use the VOD Java SDK for API integration. The VOD Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.

private static final Logger log = LoggerFactory.getLogger(VodVideoPlayerTest.class);

/**
 * 查询播放器列表
 */
@Test
public void testPlayerUpdateLogo() throws Exception, NoSuchAlgorithmException {
        //公共参数,填写自己的实际参数
        String secretKey = "xxx";
        String userid = "xxx";
        String ptime = String.valueOf(System.currentTimeMillis());
        String url = "http://api.polyv.net/v2/player/update-logo";

        Map<String, String> requestMap = new HashMap<>();
        requestMap.put("userid", userid);
        requestMap.put("ptime", ptime);
        requestMap.put("sign", VodSignUtil.getSign(requestMap, secretKey));
        
        requestMap.put("playerId", "xxx");
        requestMap.put("logoOpacity", "100");
        requestMap.put("logoDisplayLocation", "1");
        requestMap.put("logoLinkUrl", "xxx");
    
        Map<String,File> fileMap = new HashMap<>();
        fileMap.put("logoImageFile",new File("abc.jpg"));
    
        String response = HttpUtil.postFile(url, requestMap, fileMap, Constant.UTF8);
        log.debug("测试更新播放器logo,{}", response);
        //do something
}

Response Example

For global error descriptions, see Global Error Description

Success Example

{
    "code": 200,
    "status": "success",
    "message": "success",
    "data": {
        "playerId": "abcde12345",
        "playerName": "默认播放器",
        "isDefault": 1,
        "updateTime": "2025-02-18 17:10:39",
        "skin": {
            "skinTheme": "skin_39",
            "skinColor": "#d1d1d1",
            "skinColorApplyType": "",
            "skinControlLocation": 2
        },
        "logo": {
            "logoImageUrl": "https://img.videocc.netxxx.jpg",
            "logoLinkUrl": "http://www.polyv.net",
            "logoOpacity": 100,
            "logoDisplayLocation": 1
        },
        "teaserTrailer": {
            "teaserShow": 0,
            "teaserMediaUrl": "",
            "teaserPlayTime": 0,
            "trailerShow": 0,
            "trailerMediaUrl": "",
            "trailerPlayTime": 0
        }
    }
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "the sign is not right.",
    "data": ""
}
联系客服,在线咨询