vhall-mini-sdk 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/chat/chat-edit/chat-edit.js +7 -4
- package/lib/components/chat/chat-list/chat-list.js +1 -1
- package/lib/components/live-landscape/live-landscape.js +11 -7
- package/lib/components/live-landscape/live-landscape.wxml +2 -2
- package/lib/components/live-portrait/live-portrait.js +11 -7
- package/lib/components/live-portrait/live-portrait.wxml +3 -3
- package/lib/components/live-portrait/live-portrait.wxss +1 -1
- package/lib/components/lottery/lottery.wxml +2 -2
- package/lib/components/player/components/online-hot/index.js +2 -2
- package/lib/components/player/extensions/observers.js +5 -5
- package/lib/components/player/player.js +5 -0
- package/lib/components/player/player.wxml +3 -3
- package/lib/components/product/product-list/product-list.wxml +3 -11
- package/lib/components/signin/signin-dialog.js +1 -0
- package/lib/sdk/main/index.js +2 -1
- package/lib/sdk/player/index.js +1 -1
- package/lib/sdk/plugins/InviteCardServer.js +1 -1
- package/lib/sdk/plugins/MallRewardServer.js +1 -1
- package/lib/sdk/plugins/ProductServer.js +1 -1
- package/lib/shared/RequestUtil.js +1 -1
- package/lib/shared/logger.js +1 -1
- package/package.json +2 -4
- package/postinstall.js +21 -51
- package/dist/components/chat/chat-edit/chat-edit.js +0 -127
- package/dist/components/chat/chat-edit/chat-edit.json +0 -4
- package/dist/components/chat/chat-edit/chat-edit.wxml +0 -7
- package/dist/components/chat/chat-edit/chat-edit.wxss +0 -1
- package/dist/components/chat/chat-item/chat-item.js +0 -253
- package/dist/components/chat/chat-item/chat-item.json +0 -3
- package/dist/components/chat/chat-item/chat-item.wxml +0 -96
- package/dist/components/chat/chat-item/chat-item.wxss +0 -1
- package/dist/components/chat/chat-list/chat-list.js +0 -216
- package/dist/components/chat/chat-list/chat-list.json +0 -6
- package/dist/components/chat/chat-list/chat-list.wxml +0 -9
- package/dist/components/chat/chat-list/chat-list.wxss +0 -1
- package/dist/components/chat/chat.js +0 -98
- package/dist/components/chat/chat.json +0 -7
- package/dist/components/chat/chat.wxml +0 -7
- package/dist/components/chat/chat.wxss +0 -1
- package/dist/components/gift/gift-display/gift-display.js +0 -118
- package/dist/components/gift/gift-display/gift-display.json +0 -3
- package/dist/components/gift/gift-display/gift-display.wxml +0 -16
- package/dist/components/gift/gift-display/gift-display.wxss +0 -1
- package/dist/components/gift/gift-sender/gift-sender.js +0 -63
- package/dist/components/gift/gift-sender/gift-sender.json +0 -6
- package/dist/components/gift/gift-sender/gift-sender.wxml +0 -19
- package/dist/components/gift/gift-sender/gift-sender.wxss +0 -1
- package/dist/components/introduction/introduction.js +0 -43
- package/dist/components/introduction/introduction.json +0 -3
- package/dist/components/introduction/introduction.wxml +0 -8
- package/dist/components/introduction/introduction.wxss +0 -1
- package/dist/components/invite-rank/img/bronze.png +0 -0
- package/dist/components/invite-rank/img/gold.png +0 -0
- package/dist/components/invite-rank/img/silver.png +0 -0
- package/dist/components/invite-rank/index.js +0 -135
- package/dist/components/invite-rank/index.json +0 -8
- package/dist/components/invite-rank/index.wxml +0 -42
- package/dist/components/invite-rank/index.wxss +0 -1
- package/dist/components/invite-rank/invite-rank-item.js +0 -12
- package/dist/components/invite-rank/invite-rank-item.json +0 -4
- package/dist/components/invite-rank/invite-rank-item.wxml +0 -21
- package/dist/components/invite-rank/invite-rank-item.wxss +0 -1
- package/dist/components/invite-rank/my-invite-detail.js +0 -82
- package/dist/components/invite-rank/my-invite-detail.json +0 -7
- package/dist/components/invite-rank/my-invite-detail.wxml +0 -27
- package/dist/components/invite-rank/my-invite-detail.wxss +0 -1
- package/dist/components/invite-rank/util.wxs +0 -21
- package/dist/components/live-landscape/live-landscape.js +0 -216
- package/dist/components/live-landscape/live-landscape.json +0 -39
- package/dist/components/live-landscape/live-landscape.wxml +0 -73
- package/dist/components/live-landscape/live-landscape.wxss +0 -1
- package/dist/components/live-portrait/live-portrait.js +0 -274
- package/dist/components/live-portrait/live-portrait.json +0 -38
- package/dist/components/live-portrait/live-portrait.wxml +0 -106
- package/dist/components/live-portrait/live-portrait.wxss +0 -1
- package/dist/components/lottery/lottery-accept/index.js +0 -249
- package/dist/components/lottery/lottery-accept/index.json +0 -4
- package/dist/components/lottery/lottery-accept/index.wxml +0 -49
- package/dist/components/lottery/lottery-accept/index.wxss +0 -1
- package/dist/components/lottery/lottery-history/index.js +0 -36
- package/dist/components/lottery/lottery-history/index.json +0 -3
- package/dist/components/lottery/lottery-history/index.wxml +0 -28
- package/dist/components/lottery/lottery-history/index.wxss +0 -1
- package/dist/components/lottery/lottery-shake/lottery-shake.js +0 -328
- package/dist/components/lottery/lottery-shake/lottery-shake.json +0 -1
- package/dist/components/lottery/lottery-shake/lottery-shake.wxml +0 -52
- package/dist/components/lottery/lottery-shake/lottery-shake.wxss +0 -1
- package/dist/components/lottery/lottery-slot/lottery-slot.js +0 -230
- package/dist/components/lottery/lottery-slot/lottery-slot.json +0 -1
- package/dist/components/lottery/lottery-slot/lottery-slot.wxml +0 -62
- package/dist/components/lottery/lottery-slot/lottery-slot.wxss +0 -1
- package/dist/components/lottery/lottery-wheel/lottery-wheel.js +0 -153
- package/dist/components/lottery/lottery-wheel/lottery-wheel.json +0 -4
- package/dist/components/lottery/lottery-wheel/lottery-wheel.wxml +0 -91
- package/dist/components/lottery/lottery-wheel/lottery-wheel.wxss +0 -1
- package/dist/components/lottery/lottery-winners/index.js +0 -101
- package/dist/components/lottery/lottery-winners/index.json +0 -4
- package/dist/components/lottery/lottery-winners/index.wxml +0 -39
- package/dist/components/lottery/lottery-winners/index.wxss +0 -1
- package/dist/components/lottery/lottery.js +0 -388
- package/dist/components/lottery/lottery.json +0 -11
- package/dist/components/lottery/lottery.wxml +0 -78
- package/dist/components/lottery/lottery.wxss +0 -1
- package/dist/components/lottery/wheel.json +0 -49
- package/dist/components/mall-reward/common/reward-card.wxss +0 -0
- package/dist/components/mall-reward/duration-icon/index.js +0 -101
- package/dist/components/mall-reward/duration-icon/index.json +0 -3
- package/dist/components/mall-reward/duration-icon/index.wxml +0 -7
- package/dist/components/mall-reward/duration-icon/index.wxss +0 -1
- package/dist/components/mall-reward/f-count-down/index.js +0 -61
- package/dist/components/mall-reward/f-count-down/index.json +0 -3
- package/dist/components/mall-reward/f-count-down/index.wxml +0 -9
- package/dist/components/mall-reward/f-count-down/index.wxss +0 -1
- package/dist/components/mall-reward/f-empty/index.js +0 -11
- package/dist/components/mall-reward/f-empty/index.json +0 -3
- package/dist/components/mall-reward/f-empty/index.wxml +0 -8
- package/dist/components/mall-reward/f-empty/index.wxss +0 -1
- package/dist/components/mall-reward/f-history/index.js +0 -84
- package/dist/components/mall-reward/f-history/index.json +0 -4
- package/dist/components/mall-reward/f-history/index.wxml +0 -38
- package/dist/components/mall-reward/f-history/index.wxss +0 -1
- package/dist/components/mall-reward/f-open/index.js +0 -36
- package/dist/components/mall-reward/f-open/index.json +0 -3
- package/dist/components/mall-reward/f-open/index.wxml +0 -10
- package/dist/components/mall-reward/f-open/index.wxss +0 -1
- package/dist/components/mall-reward/f-receive/index.js +0 -36
- package/dist/components/mall-reward/f-receive/index.json +0 -3
- package/dist/components/mall-reward/f-receive/index.wxml +0 -9
- package/dist/components/mall-reward/f-receive/index.wxss +0 -1
- package/dist/components/mall-reward/index.js +0 -374
- package/dist/components/mall-reward/index.json +0 -8
- package/dist/components/mall-reward/index.wxml +0 -4
- package/dist/components/mall-reward/index.wxss +0 -0
- package/dist/components/mall-reward/main-popup/index.js +0 -46
- package/dist/components/mall-reward/main-popup/index.json +0 -12
- package/dist/components/mall-reward/main-popup/index.wxml +0 -16
- package/dist/components/mall-reward/main-popup/index.wxss +0 -1
- package/dist/components/player/assets/image/arrow-left.png +0 -0
- package/dist/components/player/assets/image/arrow-right.png +0 -0
- package/dist/components/player/assets/image/enterFullScreen.png +0 -0
- package/dist/components/player/assets/image/exitFullScreen.png +0 -0
- package/dist/components/player/assets/image/fullscreen_1.png +0 -0
- package/dist/components/player/assets/image/fullscreen_2.png +0 -0
- package/dist/components/player/assets/image/pause.png +0 -0
- package/dist/components/player/assets/image/pause_1.png +0 -0
- package/dist/components/player/assets/image/play.png +0 -0
- package/dist/components/player/assets/image/play_1.png +0 -0
- package/dist/components/player/assets/image/refresh.png +0 -0
- package/dist/components/player/assets/image/refresh_1.png +0 -0
- package/dist/components/player/assets/image/subtitle_close.png +0 -0
- package/dist/components/player/assets/image/subtitle_default.png +0 -0
- package/dist/components/player/assets/image/volume-off.png +0 -0
- package/dist/components/player/assets/image/volume-on.png +0 -0
- package/dist/components/player/common/config.js +0 -7
- package/dist/components/player/common/veComponent.js +0 -4
- package/dist/components/player/components/barrage/barrage-canvas.js +0 -488
- package/dist/components/player/components/barrage/barrage-dom.js +0 -471
- package/dist/components/player/components/barrage/index.js +0 -62
- package/dist/components/player/components/barrage/index.json +0 -4
- package/dist/components/player/components/barrage/index.wxml +0 -39
- package/dist/components/player/components/barrage/index.wxss +0 -1
- package/dist/components/player/components/barrage/utils.js +0 -71
- package/dist/components/player/components/controls/controls.js +0 -93
- package/dist/components/player/components/controls/controls.json +0 -6
- package/dist/components/player/components/controls/controls.wxml +0 -60
- package/dist/components/player/components/controls/controls.wxss +0 -1
- package/dist/components/player/components/danmaku/danmaku.js +0 -23
- package/dist/components/player/components/danmaku/danmaku.json +0 -4
- package/dist/components/player/components/danmaku/danmaku.wxml +0 -1
- package/dist/components/player/components/danmaku/danmaku.wxss +0 -0
- package/dist/components/player/components/error/error.js +0 -15
- package/dist/components/player/components/error/error.json +0 -3
- package/dist/components/player/components/error/error.wxml +0 -6
- package/dist/components/player/components/error/error.wxss +0 -1
- package/dist/components/player/components/loading/loading.js +0 -9
- package/dist/components/player/components/loading/loading.json +0 -3
- package/dist/components/player/components/loading/loading.wxml +0 -4
- package/dist/components/player/components/loading/loading.wxss +0 -1
- package/dist/components/player/components/main/extensions/data.js +0 -8
- package/dist/components/player/components/main/extensions/export.js +0 -83
- package/dist/components/player/components/main/extensions/methods.js +0 -110
- package/dist/components/player/components/main/extensions/observers.js +0 -41
- package/dist/components/player/components/main/extensions/props.js +0 -177
- package/dist/components/player/components/main/index.js +0 -44
- package/dist/components/player/components/main/index.json +0 -4
- package/dist/components/player/components/main/index.wxml +0 -7
- package/dist/components/player/components/main/index.wxss +0 -1
- package/dist/components/player/components/marquee/marquee.js +0 -304
- package/dist/components/player/components/marquee/marquee.json +0 -4
- package/dist/components/player/components/marquee/marquee.wxml +0 -14
- package/dist/components/player/components/marquee/marquee.wxss +0 -1
- package/dist/components/player/components/online-hot/assets/line-hot.png +0 -0
- package/dist/components/player/components/online-hot/assets/line-user.png +0 -0
- package/dist/components/player/components/online-hot/index.js +0 -66
- package/dist/components/player/components/online-hot/index.json +0 -3
- package/dist/components/player/components/online-hot/index.wxml +0 -15
- package/dist/components/player/components/online-hot/index.wxss +0 -1
- package/dist/components/player/components/poster/poster.js +0 -12
- package/dist/components/player/components/poster/poster.json +0 -3
- package/dist/components/player/components/poster/poster.wxml +0 -5
- package/dist/components/player/components/poster/poster.wxss +0 -1
- package/dist/components/player/components/watermark/watermark.js +0 -52
- package/dist/components/player/components/watermark/watermark.json +0 -4
- package/dist/components/player/components/watermark/watermark.wxml +0 -8
- package/dist/components/player/components/watermark/watermark.wxss +0 -1
- package/dist/components/player/extensions/data.js +0 -63
- package/dist/components/player/extensions/export.js +0 -325
- package/dist/components/player/extensions/methods.js +0 -406
- package/dist/components/player/extensions/observers.js +0 -114
- package/dist/components/player/extensions/props.js +0 -162
- package/dist/components/player/player.js +0 -83
- package/dist/components/player/player.json +0 -33
- package/dist/components/player/player.wxml +0 -48
- package/dist/components/player/player.wxss +0 -1
- package/dist/components/praise/praise.js +0 -150
- package/dist/components/praise/praise.json +0 -5
- package/dist/components/praise/praise.wxml +0 -17
- package/dist/components/praise/praise.wxss +0 -1
- package/dist/components/product/product-card/product-card.js +0 -109
- package/dist/components/product/product-card/product-card.json +0 -3
- package/dist/components/product/product-card/product-card.wxml +0 -47
- package/dist/components/product/product-card/product-card.wxss +0 -1
- package/dist/components/product/product-detail/product-detail.js +0 -127
- package/dist/components/product/product-detail/product-detail.json +0 -3
- package/dist/components/product/product-detail/product-detail.wxml +0 -57
- package/dist/components/product/product-detail/product-detail.wxss +0 -1
- package/dist/components/product/product-item/product-item.js +0 -56
- package/dist/components/product/product-item/product-item.json +0 -3
- package/dist/components/product/product-item/product-item.wxml +0 -35
- package/dist/components/product/product-item/product-item.wxss +0 -1
- package/dist/components/product/product-list/product-list.js +0 -67
- package/dist/components/product/product-list/product-list.json +0 -6
- package/dist/components/product/product-list/product-list.wxml +0 -16
- package/dist/components/product/product-list/product-list.wxss +0 -1
- package/dist/components/product/product-order/product-order.js +0 -394
- package/dist/components/product/product-order/product-order.json +0 -3
- package/dist/components/product/product-order/product-order.wxml +0 -75
- package/dist/components/product/product-order/product-order.wxss +0 -1
- package/dist/components/signin/signin-dialog.js +0 -305
- package/dist/components/signin/signin-dialog.json +0 -7
- package/dist/components/signin/signin-dialog.wxml +0 -19
- package/dist/components/signin/signin-dialog.wxss +0 -1
- package/dist/components/top-notify/index.js +0 -14
- package/dist/components/top-notify/index.json +0 -3
- package/dist/components/top-notify/index.wxml +0 -2
- package/dist/components/top-notify/index.wxss +0 -1
- package/dist/pubComponents/countdown/countdown.js +0 -97
- package/dist/pubComponents/countdown/countdown.json +0 -5
- package/dist/pubComponents/countdown/countdown.wxml +0 -19
- package/dist/pubComponents/countdown/countdown.wxss +0 -1
- package/dist/pubComponents/error-page/index.js +0 -146
- package/dist/pubComponents/error-page/index.json +0 -5
- package/dist/pubComponents/error-page/index.wxml +0 -37
- package/dist/pubComponents/error-page/index.wxss +0 -1
- package/dist/pubComponents/popup/popup.js +0 -161
- package/dist/pubComponents/popup/popup.json +0 -5
- package/dist/pubComponents/popup/popup.wxml +0 -17
- package/dist/pubComponents/popup/popup.wxss +0 -1
- package/dist/pubComponents/tabs/index.js +0 -95
- package/dist/pubComponents/tabs/index.json +0 -4
- package/dist/pubComponents/tabs/index.wxml +0 -22
- package/dist/pubComponents/tabs/index.wxss +0 -1
- package/dist/sdk/config/index.js +0 -1
- package/dist/sdk/main/index.js +0 -1
- package/dist/sdk/player/index.js +0 -1
- package/dist/sdk/plugins/ChatServer.js +0 -1
- package/dist/sdk/plugins/CustomMenuServer.js +0 -1
- package/dist/sdk/plugins/InteractServer.js +0 -1
- package/dist/sdk/plugins/InviteCardServer.js +0 -1
- package/dist/sdk/plugins/LotteryServer.js +0 -1
- package/dist/sdk/plugins/MallRewardServer.js +0 -1
- package/dist/sdk/plugins/ProductServer.js +0 -1
- package/dist/shared/RequestUtil.js +0 -1
- package/dist/shared/SerializableMap.js +0 -1
- package/dist/shared/base.server.js +0 -1
- package/dist/shared/cacheUtil.js +0 -1
- package/dist/shared/dateUtil.js +0 -1
- package/dist/shared/logger.js +0 -1
- package/dist/shared/mpUtils.js +0 -1
- package/dist/shared/utils.js +0 -1
|
@@ -1,325 +0,0 @@
|
|
|
1
|
-
export function createExport() {
|
|
2
|
-
const component = this;
|
|
3
|
-
return {
|
|
4
|
-
getWebinarInfo() {
|
|
5
|
-
return component.data.webinarInfo;
|
|
6
|
-
},
|
|
7
|
-
getType() {
|
|
8
|
-
return component.data.type;
|
|
9
|
-
},
|
|
10
|
-
/**
|
|
11
|
-
* 播放
|
|
12
|
-
* todo:video组件不支持回调函数
|
|
13
|
-
*/
|
|
14
|
-
play() {
|
|
15
|
-
return new Promise((resolve, reject) => {
|
|
16
|
-
try {
|
|
17
|
-
component.playerMain.play({
|
|
18
|
-
success: () => {
|
|
19
|
-
resolve(null);
|
|
20
|
-
},
|
|
21
|
-
fail: error => {
|
|
22
|
-
reject(error);
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
component.setData({
|
|
26
|
-
playStatus: "playing",
|
|
27
|
-
pausedFlag: false,
|
|
28
|
-
})
|
|
29
|
-
}
|
|
30
|
-
catch (error) {
|
|
31
|
-
reject(error);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
/**
|
|
36
|
-
* 停止
|
|
37
|
-
* todo:video组件不支持回调函数
|
|
38
|
-
*/
|
|
39
|
-
stop() {
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
try {
|
|
42
|
-
component.playerMain.stop({
|
|
43
|
-
success: () => {
|
|
44
|
-
resolve(null);
|
|
45
|
-
},
|
|
46
|
-
fail: error => {
|
|
47
|
-
reject(error);
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
component.setData({
|
|
51
|
-
playStatus: "paused",
|
|
52
|
-
pausedFlag: true,
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
reject(error);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
/**
|
|
61
|
-
* 暂停
|
|
62
|
-
* todo:video组件不支持回调函数
|
|
63
|
-
*/
|
|
64
|
-
pause() {
|
|
65
|
-
return new Promise((resolve, reject) => {
|
|
66
|
-
try {
|
|
67
|
-
component.playerMain.pause({
|
|
68
|
-
success: () => {
|
|
69
|
-
resolve(null);
|
|
70
|
-
},
|
|
71
|
-
fail: error => {
|
|
72
|
-
reject(error);
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
component.setData({
|
|
76
|
-
playStatus: "paused",
|
|
77
|
-
pausedFlag: true,
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
reject(error);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
/**
|
|
86
|
-
* 恢复(仅直播)
|
|
87
|
-
* todo:video组件不支持回调函数
|
|
88
|
-
*/
|
|
89
|
-
resume() {
|
|
90
|
-
return new Promise((resolve, reject) => {
|
|
91
|
-
try {
|
|
92
|
-
component.playerMain.resume({
|
|
93
|
-
success: () => {
|
|
94
|
-
resolve(null);
|
|
95
|
-
},
|
|
96
|
-
fail: error => {
|
|
97
|
-
reject(error);
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
component.setData({
|
|
101
|
-
playStatus: "playing",
|
|
102
|
-
pausedFlag: false,
|
|
103
|
-
})
|
|
104
|
-
}
|
|
105
|
-
catch (error) {
|
|
106
|
-
reject(error);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
},
|
|
110
|
-
/**
|
|
111
|
-
* 重新播放
|
|
112
|
-
*/
|
|
113
|
-
replay() {
|
|
114
|
-
return component.playerMain.replay();
|
|
115
|
-
},
|
|
116
|
-
/**
|
|
117
|
-
* 静音
|
|
118
|
-
*/
|
|
119
|
-
mute() {
|
|
120
|
-
const muted = true;
|
|
121
|
-
const mutedFlag = true;
|
|
122
|
-
component.setData(
|
|
123
|
-
{ muted, mutedFlag },
|
|
124
|
-
() => {
|
|
125
|
-
component.triggerEvent('mutedChange', { muted });
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
},
|
|
129
|
-
/**
|
|
130
|
-
* 取消静音
|
|
131
|
-
*/
|
|
132
|
-
unmute() {
|
|
133
|
-
const muted = false;
|
|
134
|
-
const mutedFlag = false;
|
|
135
|
-
component.setData(
|
|
136
|
-
{ muted, mutedFlag },
|
|
137
|
-
() => { component.triggerEvent('mutedChange', { muted }); }
|
|
138
|
-
)
|
|
139
|
-
},
|
|
140
|
-
/**
|
|
141
|
-
* 进入全屏
|
|
142
|
-
* @param {*} option
|
|
143
|
-
*/
|
|
144
|
-
requestFullScreen(option = { direction: 90 }) {
|
|
145
|
-
return new Promise((resolve, reject) => {
|
|
146
|
-
component.playerMain.requestFullScreen({
|
|
147
|
-
direction: option.direction,
|
|
148
|
-
success: () => {
|
|
149
|
-
resolve(null);
|
|
150
|
-
},
|
|
151
|
-
fail: error => {
|
|
152
|
-
reject(error);
|
|
153
|
-
},
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
},
|
|
157
|
-
/**
|
|
158
|
-
* 退出全屏
|
|
159
|
-
*/
|
|
160
|
-
exitFullScreen() {
|
|
161
|
-
return new Promise((resolve, reject) => {
|
|
162
|
-
component.playerMain.exitFullScreen({
|
|
163
|
-
success: () => {
|
|
164
|
-
resolve(null);
|
|
165
|
-
},
|
|
166
|
-
fail: error => {
|
|
167
|
-
reject(error);
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
},
|
|
172
|
-
/**
|
|
173
|
-
* 进入小窗模式
|
|
174
|
-
* 不支持主动调用?
|
|
175
|
-
*/
|
|
176
|
-
requestPictureInPicture() {
|
|
177
|
-
return new Promise((resolve, reject) => {
|
|
178
|
-
component.playerMain.requestPictureInPicture({
|
|
179
|
-
success: () => {
|
|
180
|
-
resolve(null);
|
|
181
|
-
},
|
|
182
|
-
fail: error => {
|
|
183
|
-
reject(error);
|
|
184
|
-
},
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
},
|
|
188
|
-
/**
|
|
189
|
-
* 退出小窗模式
|
|
190
|
-
*/
|
|
191
|
-
exitPictureInPicture() {
|
|
192
|
-
return new Promise((resolve, reject) => {
|
|
193
|
-
component.playerMain.exitPictureInPicture({
|
|
194
|
-
success: () => {
|
|
195
|
-
resolve(null);
|
|
196
|
-
},
|
|
197
|
-
fail: error => {
|
|
198
|
-
reject(error);
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
},
|
|
203
|
-
/**
|
|
204
|
-
* 设置倍速(仅点播)
|
|
205
|
-
*/
|
|
206
|
-
setPlaybackRate(rate) {
|
|
207
|
-
const PLAYBACK_RATE_LIST = [0.5, 1, 1.25, 1.5, 2];
|
|
208
|
-
if (PLAYBACK_RATE_LIST.indexOf(rate) < 0) {
|
|
209
|
-
console.log(`不支持的播放速度: ${rate}`)
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
component.setData({
|
|
213
|
-
currentPlaybackRate: rate
|
|
214
|
-
})
|
|
215
|
-
return component.playerMain.setPlaybackRate(rate);
|
|
216
|
-
},
|
|
217
|
-
/**
|
|
218
|
-
* seek(仅点播)
|
|
219
|
-
* @param {*} second
|
|
220
|
-
*/
|
|
221
|
-
seek(second) {
|
|
222
|
-
return component.playerMain.seek(second);
|
|
223
|
-
},
|
|
224
|
-
/**
|
|
225
|
-
* 获取当前播放进度(仅点播)
|
|
226
|
-
*/
|
|
227
|
-
getCurrentVodPlayTime() {
|
|
228
|
-
return component.data.currentVodPlayTime;
|
|
229
|
-
},
|
|
230
|
-
/**
|
|
231
|
-
* 获取点播视频总时长(仅点播)
|
|
232
|
-
*/
|
|
233
|
-
getVodDuration() {
|
|
234
|
-
return component.data.vodDuration;
|
|
235
|
-
},
|
|
236
|
-
/**
|
|
237
|
-
* 获取清晰度列表
|
|
238
|
-
*/
|
|
239
|
-
getQualitys() {
|
|
240
|
-
return component.data.qualitys;
|
|
241
|
-
},
|
|
242
|
-
/**
|
|
243
|
-
* 获取当前播放清晰度
|
|
244
|
-
*/
|
|
245
|
-
getCurrentQuality() {
|
|
246
|
-
return component.data.currentQuality;
|
|
247
|
-
},
|
|
248
|
-
/**
|
|
249
|
-
* 设置当前播放清晰度
|
|
250
|
-
* @param {*} quality
|
|
251
|
-
*/
|
|
252
|
-
setCurrentQuality(quality) {
|
|
253
|
-
console.log("setCurrentQuality: ", quality)
|
|
254
|
-
if (component.data.qualitys.indexOf(quality) < 0) {
|
|
255
|
-
console.log(`${quality}清晰度不存在`)
|
|
256
|
-
return
|
|
257
|
-
}
|
|
258
|
-
if (quality === component.data.currentQuality) {
|
|
259
|
-
console.log('新旧清晰度相同, 无需切换')
|
|
260
|
-
return
|
|
261
|
-
}
|
|
262
|
-
// 切换流地址
|
|
263
|
-
const videoSrc = component.getVideoSrc(quality, component.data.currentSubtitle);
|
|
264
|
-
component.setData({
|
|
265
|
-
videoSrc,
|
|
266
|
-
currentQuality: quality,
|
|
267
|
-
})
|
|
268
|
-
},
|
|
269
|
-
/**
|
|
270
|
-
* 获取当前活动支持的实时字幕
|
|
271
|
-
*/
|
|
272
|
-
getSubtitles() {
|
|
273
|
-
return component.data.subtitles;
|
|
274
|
-
},
|
|
275
|
-
/**
|
|
276
|
-
* 获取当前播放的实时字幕
|
|
277
|
-
*/
|
|
278
|
-
getCurrentSubtitle() {
|
|
279
|
-
return component.data.currentSubtitle;
|
|
280
|
-
},
|
|
281
|
-
/**
|
|
282
|
-
* 切换实时字幕
|
|
283
|
-
* @param {*} subtitle
|
|
284
|
-
*/
|
|
285
|
-
setCurrentSubtitle(subtitle) {
|
|
286
|
-
console.log("setCurrentSubtitle: ", subtitle)
|
|
287
|
-
if (component.data.subtitles.indexOf(subtitle) < 0) {
|
|
288
|
-
console.log(`${subtitle}字幕不存在`)
|
|
289
|
-
return
|
|
290
|
-
}
|
|
291
|
-
if (subtitle === component.data.currentSubtitle) {
|
|
292
|
-
console.log('切换字幕相同, 不进行切换')
|
|
293
|
-
return
|
|
294
|
-
}
|
|
295
|
-
// 切换流地址
|
|
296
|
-
const videoSrc = component.getVideoSrc(component.data.currentQuality, subtitle);
|
|
297
|
-
component.setData({
|
|
298
|
-
videoSrc,
|
|
299
|
-
currentSubtitle: subtitle,
|
|
300
|
-
})
|
|
301
|
-
},
|
|
302
|
-
/**
|
|
303
|
-
* 开启弹幕
|
|
304
|
-
*/
|
|
305
|
-
openBarrage() {
|
|
306
|
-
component.barrage.open()
|
|
307
|
-
},
|
|
308
|
-
/**
|
|
309
|
-
* 关闭弹幕
|
|
310
|
-
*/
|
|
311
|
-
closeBarrage() {
|
|
312
|
-
component.barrage.close()
|
|
313
|
-
},
|
|
314
|
-
/**
|
|
315
|
-
* 发送弹幕
|
|
316
|
-
* @param {*} data
|
|
317
|
-
*/
|
|
318
|
-
addBarrage(data) {
|
|
319
|
-
component.barrage.addData(data)
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
export function getVhallPlayer(ctx, selector) {
|
|
324
|
-
return ctx.selectComponent(selector);
|
|
325
|
-
}
|