Property | Type | Description |
playerId | string | Player Id |
playletPlugin.onPageLoad((res) => {console.log('Page loaded, Player ID:', res.playerId);});
Property | Type | Description |
playerId | string | Player ID |
playletPlugin.onPageDestory((res) => {console.log('Page destroyed, Player ID:', res.playerId);});
plugin.onPageLoad((info) => {const playletManager = plugin.PlayletManager.getPageManager(info.playerId);console.log('manager',manager);})
Field | Type | Required | Default value | Description |
id | string | true | - | Drama ID |
serialNo | number | true | - | Episode ID |
title | string | true | - | Drama name |
imgUrl | string | false | '' | Drama cover image |
introduction | string | false | '' | Short drama description |
tags | list | false | [] | Short drama tags |
playRate | number | false | 1 | Playback speed |
extParam | string | false | {} | Extended parameters |
clarity | list | false | [ { clarity: 240 * 426, title: "360P" }, { clarity: 480 * 852, title: "480P" }, { clarity: 720 * 1280, title: "720P" }, { clarity: 1080 * 1920, title: "1080P" } ] | Video quality options |
defaultClarity | object | false | { clarity: 480 * 852, title: "480P" } | Default video quality |
initial-time | number | false | 0 | Initial playback time |
data | list | true | - | List of episode status |
Field | Type | Required | Default value | Description |
status | number | true | - | Playback status: 0 = free; 1 = unlocked; 2 = locked |
VideoUrl | string | false | '' | Video URL; not required for paid episodes |
coverImg | string | false | - | Cover image; shown if imgUrl is not set |
license-url | string | false | '' | The license URL for playback |
certificate-url | string | false | '' | Certificate URL |
provision-url | string | false | '' | Device provisioning URL |
PlayletManager.setPlaylets({id:"sid", // Drama IDserialNo:1 // Episode ID, starting from 1title:"Name",imgUrl:"Image URL",introduction:"Short drama introduction",tags: ["Friendship", "Fantasy"],playRate: 1extParam:"{{xxx}}",clarity:[{"360p": 240 * 426},{"480p":480 * 852},"720p":720 * 1280,"1080p":1080 * 1920] // Effective only under HLSdefalutClarity: {"720p":720 * 1280 }// Default video quality'initial-time': 0,data: [{license-url:"",certificate-url:"",provision-url:"",status: 0,videoUrl: "Playback URL" // Not required for paid episodescoverImg: "Cover image" // Not required}]})
Field | Type | Required | Default value | Description |
List | Array<FreeItem> | true | - | Episode unlock pop-up items, supports up to four entries |
Field | Type | Required | Default value | Description |
Title | string | true | - | Name of the unlock operation |
Callback | function | true | - | The specific unlock operation |
PlayletManager.setLockMenu([{title: "Watch ad to unlock",callback: (data) => {if (!data.serialNo) {return;}PlayletManager.setCanPlay(data.serailNo, 1)}},{title: "Purchase single episode",callback: (data) => {if (!data.serialNo) {return;}PlayletManager.setCanPlay(data.serailNo, 1)}}])
Field | Type | Required | Default value | Description |
SerialNo | number | true | - | Episode ID |
Status | number | true | - | Playback status |
VideoUrl | string | true | - | Playback URL |
const unlockData = [{serialNo: 6, // Episode numberstatus: 1,videoUrl: videoUrl // Playback URL}];PlayletManager.setCanPlay(unlockData);
manager.onCheckIsCanPlay((data) => {let episodes = [];if (data.episodes) {episodes = data.episodes;}// Batch check and set statusconst results = episodes.map(ep => {const serialNo = ep.serialNo;let status;if (parseInt(serialNo) <= 3) {// Assume the first 3 episodes are freestatus = 0;} else {status = 2;}return { serialNo: serialNo, status: status };});manager.setCanPlay(results);});
Property | Type | Description |
eventId | number | Type of playback error event |
Property | Type | Description |
serialNo | number | Episode ID |
playerId | string | Player ID |
exParam | string | Sharing extension parameters |
duration | string | Total duration of the current episode |
playtime | string | Current playback time |
Property | Type | Description |
EventType | string | 'CHANGE_SERIAL': Episode changed. Example: { slideType: 1 }. slideType values: 1: Auto-switch after playback ends (regardless of completion). 2: Switched by gesture slide. 3: Switched via episode selection popup. 'CHANGE_SPEED': Playback speed changed. Example: { source: 1, speedType: 1.5 }, source: Currently fixed at 1; speedType: Current playback speed. 'CHANGE_CLARITY': Playback clarity changed; returns the current clarity level. |
manager.onCustomEvent((data) => {if (data.eventType === 'CHANGE_CLARITY') {console.log('User changed clarity:', data.clarity);}if (data.eventType === 'CHANGE_SERIAL') {console.log('User switched episode:', data.slideType);}if (data.eventType === 'CHANGE_SPEED') {console.log('User changed playback speed:', data.speedType, data.source);}});
Field | Description |
playerId | Player Id |
extParam | Sharing extension parameters |
serialNo | Current episode index, starting from 1 |
playTime | Current playback time |
duration | Total duration of the current episode |
totalCount | Total number of episodes |
Field | Description | Description of additional fields |
LOAD | Enter the player page | - |
SHOW | Player page show | - |
START_PLAY | Start to play | - |
UNLOAD_OR_HIDE | Leave the page or return to the background | Example: {{type}} 1 }. Where type 1 = unload, type 2 = hide. |
video.play() | Play event | - |
VIDEO_TIME_UPDATE | Time update event | Parameters correspond to video component’s timeupdate event. |
VIDEO_END | Video playback ended | - |
Feedback