Upgrade Migration
1. Upgrading from 1.x to 2.x
1.1 Module Renaming
All occurrences of watchCore.subtitles must be changed to watchCore.subtitle.
1.2 API Changes
The chat module has been split, with the emotion module extracted. The corresponding APIs need to be updated as follows:
watchCore.chat.getEmotionFaceDomList => watchCore.emotion.getEmotionFaceDomList
watchCore.chat.getEmotionFaceClickTarget => watchCore.emotion.getEmotionFaceClickTarget
watchCore.chat.getEmotionImages => watchCore.emotion.getEmotionImages
Additionally, after splitting the emotion module, you need to manually call watchCore.emotion.setupEmotionParser to load the emotion parser.
The API for retrieving chat history in the question module has also changed:
watchCore.ask.getAskHistory => watchCore.ask.getAskHistoryByUserId
1.3 Deprecated APIs
The following APIs were deprecated in versions 1.x and 0.x but still retained functionality. However, version 2.x has removed the corresponding features. Please switch to the recommended alternatives:
watchCore.ask.sendQuestion => watchCore.ask.sendAskSpeak
watchCore.chat.getOnlineUserList => watchCore.chat.getOnlineUserListNew
watchCore.chat.setChatMsgReplayPlaybackTarget => watchCore.playback.setCurrentPlaybackTarget
Furthermore, some authentication APIs are deprecated in version 2.0 and will no longer be supported. If you need to use a user system, please contact POLYV technical staff to integrate the unified authorization SDK:
watchCore.identity.checkIdentityWxAuthwatchCore.identity.checkIdentityInfoLogin
1.4 Business Impact
Note that version 2.0 adds card push replay, which is enabled by default. This will affect the currentPlaybackTarget.chatReplayEnabled judgment. If you are upgrading directly from the UI layer provided with V1, please change it to currentPlaybackTarget.chatMsgReplayEnabled.
1.5 CDN External Link Changes
When importing via external links in version 1.x, use the following method:
<!-- 通过1.x版本号引入 -->
<script src="https://websdk.videocc.net/live-watch-sdk/{version}/lib/polyv-live-watch.umd.js"></script>
When importing via external links in version 2.x, use the following method:
<!-- 通过2.x版本号引入 -->
<script src="https://websdk.videocc.net/live-watch-sdk/{version}/lib/polyv-live-watch-sdk.umd.js"></script>
1.6 Companion Project Upgrade Guide
- If you are using the Live Viewing Page Open Source Project v1.11.0, refer to the ui-1.x-with-sdk-2.x branch in the open source project repository. This branch provides an example of
开源项目 v1.11.0integrating with逻辑层SDK v2.0.0, which runs normally. However, the POLYV user system is no longer used. - If you are using an earlier version of the open source project, please upgrade to
v1.11.0first.
