Polyv Help Center

Help Center

4-加密视频版权保护

Updated: 2026-06-15 14:35:12

To protect your video resources and enhance video playback security, we recommend reading the Best Practices for Copyright Protection in advance to understand how POLYV safeguards your video assets.

Configuring Account Keys

If you configure the account key secretKey directly on the client side, the key may be obtained through reverse engineering after the app is packaged, leading to key leakage. This method is only recommended for local debugging or controlled testing scenarios and is not advised for production environments.

In production environments, it is recommended to store the key on your server. The server generates a playback credential token and delivers it to the client, which is then passed to the player via "token configuration."

Configuring Token Passing

By default, any user holding secretKey can obtain a video playback credential token through POLYV's API and play the video.

You can configure an IP whitelist in the Encryption Settings of the VOD backend. This ensures that only your server can request the API to obtain the playback credential, reducing the risk of large-scale video leakage caused by key exposure.

After configuring the IP whitelist, you need to set up the player accordingly to correctly pass the playback credential token. An example is shown below:

mediaPlayer.getBusinessListenerRegistry().setVodTokenRequestListener(new IPLVVodMediaTokenRequestListener() {
    @Override
    public void onRequestToken(@NotNull PLVVodMediaResource mediaResource, @NotNull PLVSugarUtil.Consumer<PLVVodVideoTokenVO> callback) {
        // 通过网络请求,向您的服务器请求视频播放token
        PLVVodVideoTokenVO token;
        // 将token返回给播放器
        callback.accept(token);
    }
});
联系客服,在线咨询