tcplayer.js 5.0.2-beta.1 → 5.1.0-beta.1
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/dist/examples/vod/tcplayer-vod-pdt-seek.html +8 -4
- package/dist/examples/vod/tcplayer-vod-trial.html +150 -0
- package/dist/examples/webrtc/tcplayer-src-meeting.html +21 -8
- package/dist/examples/webrtc/tcplayer-src-webrtc-abr-new.html +9 -14
- package/dist/libs/TXLivePlayer-1.3.4.min.js +1 -1
- package/dist/libs/TXLivePlayer-1.3.5.min.js +1 -0
- package/dist/libs/flv.min.1.6.4.js +10 -0
- package/dist/tcplayer.v5.1.0.min.js +20 -0
- package/package.json +2 -2
- package/dist/tcplayer.v5.0.1.min.js +0 -19
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
<link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.6.0/tcplayer.min.css" rel="stylesheet"/>
|
|
9
9
|
|
|
10
10
|
<!--播放器脚本文件-->
|
|
11
|
-
<script src="https://vincentlli-1306264703.cos.ap-nanjing.myqcloud.com/tcplayer/hls.min.1.1.7.js"></script>
|
|
12
|
-
|
|
11
|
+
<!-- <script src="https://vincentlli-1306264703.cos.ap-nanjing.myqcloud.com/tcplayer/hls.min.1.1.7.js"></script> -->
|
|
12
|
+
<script src="http://10.21.39.55:8080/libs/hls.min.1.1.7.js"></script>
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
<script src="https://vincentlli-1306264703.cos.ap-nanjing.myqcloud.com/tcplayer/tcplayer.v4.8.0.min.js"></script>
|
|
16
|
-
|
|
15
|
+
<!-- <script src="https://vincentlli-1306264703.cos.ap-nanjing.myqcloud.com/tcplayer/tcplayer.v4.8.0.min.js"></script> -->
|
|
16
|
+
<script src="http://10.21.39.55:8080/dist/tcplayer.v4.8.0.js"></script>
|
|
17
17
|
<style>
|
|
18
18
|
html,body{
|
|
19
19
|
margin: 0;
|
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
// 是否开启显示pdt时间
|
|
56
56
|
// PDTDisplay: false,
|
|
57
57
|
},
|
|
58
|
+
|
|
59
|
+
plugins: {
|
|
60
|
+
// PDT: true,
|
|
61
|
+
}
|
|
58
62
|
//其他参数请在开发文档中查看
|
|
59
63
|
});
|
|
60
64
|
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
6
|
+
<meta name="viewport"
|
|
7
|
+
content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
|
|
8
|
+
<title>Tcplayer Demo</title>
|
|
9
|
+
<link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.9.0/tcplayer.min.css" rel="stylesheet">
|
|
10
|
+
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.9.0/tcplayer.v4.9.0.min.js"></script>
|
|
11
|
+
<style>
|
|
12
|
+
html, body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 0;
|
|
15
|
+
}
|
|
16
|
+
.tcplayer {
|
|
17
|
+
margin: 0 auto;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#player-container-id {
|
|
21
|
+
width: 640px;
|
|
22
|
+
height: 360px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.tip-node {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
position: absolute;
|
|
29
|
+
bottom: 5em;
|
|
30
|
+
left: 1em;
|
|
31
|
+
background: rgba(0, 0, 0, 0.4);
|
|
32
|
+
border-radius: 4px;
|
|
33
|
+
padding: 5px 10px;
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.tip-icon-close {
|
|
38
|
+
width: 14px;
|
|
39
|
+
height: 14px;
|
|
40
|
+
display: inline-block;
|
|
41
|
+
margin-left: 10px;
|
|
42
|
+
background-image: url(https://tcplayer-1306264703.cos.ap-nanjing.myqcloud.com/picture/icon-close.png);
|
|
43
|
+
background-size: cover;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.page-node {
|
|
48
|
+
position: absolute;
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
background: #000;
|
|
52
|
+
z-index: 999;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.page-content {
|
|
59
|
+
text-align: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.page-content a{
|
|
63
|
+
display: flex;
|
|
64
|
+
width: 120px;
|
|
65
|
+
height: 28px;
|
|
66
|
+
border-radius: 14px;
|
|
67
|
+
color: #663d00;
|
|
68
|
+
background-image: linear-gradient(90deg,#ffdf89 0,#f2ca5b 100%);
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
margin: 0 auto;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.page-content #replay-btn::before {
|
|
76
|
+
content: '';
|
|
77
|
+
width: 12px;
|
|
78
|
+
height: 12px;
|
|
79
|
+
display: inline-block;
|
|
80
|
+
vertical-align: middle;
|
|
81
|
+
margin-right: 5px;
|
|
82
|
+
background: url(https://tcplayer-1306264703.cos.ap-nanjing.myqcloud.com/picture/icon-replay.png);
|
|
83
|
+
background-size: contain;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.page-content #replay-btn {
|
|
87
|
+
margin: 10px auto 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@media screen and (max-width: 480px) {
|
|
91
|
+
#player-container-id {
|
|
92
|
+
width: 100%;
|
|
93
|
+
height: 240px;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
</style>
|
|
99
|
+
</head>
|
|
100
|
+
<body>
|
|
101
|
+
|
|
102
|
+
<video id="player-container-id" preload="auto" playsinline webkit-playsinline>
|
|
103
|
+
</video>
|
|
104
|
+
|
|
105
|
+
<script>
|
|
106
|
+
var player = TCPlayer("player-container-id", {
|
|
107
|
+
fileID: "3701925924406245944",
|
|
108
|
+
appID: "1500006438",
|
|
109
|
+
psign: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MTUwMDAwNjQzOCwiZmlsZUlkIjoiMzcwMTkyNTkyNDQwNjI0NTk0NCIsImN1cnJlbnRUaW1lU3RhbXAiOjE2MzE3ODEyMzYsImV4cGlyZVRpbWVTdGFtcCI6MTkxNTg2NDQxNCwicGNmZyI6ImJhc2ljRHJtUHJlc2V0IiwidXJsQWNjZXNzSW5mbyI6eyJleHBlciI6MzAsInQiOiIxOTE1ODY0NDE0In19.F9gD5SidAoQPH4rDz4dr9-Z6DpoojOkHX_23kZPJ72A",
|
|
110
|
+
autoplay: false,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
player.one("playing", function() {
|
|
114
|
+
var tipNode = document.createElement("div");
|
|
115
|
+
tipNode.innerHTML = "可试看30秒,开通 VIP 观看完整视频";
|
|
116
|
+
tipNode.className = "tip-node";
|
|
117
|
+
|
|
118
|
+
var tipIconClose = document.createElement("i");
|
|
119
|
+
tipIconClose.className = "tip-icon-close";
|
|
120
|
+
tipIconClose.onclick = function() {
|
|
121
|
+
tipNode.remove();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
tipNode.appendChild(tipIconClose);
|
|
125
|
+
player.el_.appendChild(tipNode);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
player.on("ended", function() {
|
|
130
|
+
var pageNode = document.createElement("div");
|
|
131
|
+
pageNode.className = "page-node";
|
|
132
|
+
|
|
133
|
+
pageNode.innerHTML = `<div class="page-content">
|
|
134
|
+
<p>试看结束,VIP会员可观看完整视频</p>
|
|
135
|
+
<a href="https://cloud.tencent.com/document/product/881/30818" target="_blank">开通VIP会员</a>
|
|
136
|
+
<button id="replay-btn">重新试看</button>
|
|
137
|
+
</div>
|
|
138
|
+
`;
|
|
139
|
+
|
|
140
|
+
player.el_.appendChild(pageNode);
|
|
141
|
+
|
|
142
|
+
document.querySelector('#replay-btn').onclick = function() {
|
|
143
|
+
player.play();
|
|
144
|
+
pageNode.remove();
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
</script>
|
|
149
|
+
</body>
|
|
150
|
+
</html>
|
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.9.1/vconsole.min.js"></script>
|
|
13
13
|
|
|
14
14
|
<script src="https://imgcache.qq.com/open/qcloud/video/tcplayer/libs/hls.min.0.13.2m.js"></script>
|
|
15
|
+
<!-- <script src="https://hlsjs.video-dev.org/dist/hls.js"></script> -->
|
|
15
16
|
<!-- <script src="https://cloudcache.tencent-cloud.com/open/qcloud/live/webrtc/js/TXLivePlayer-1.1.0.min.js"></script> -->
|
|
16
17
|
<script src="https://wliap-1306264703.cos.ap-nanjing.myqcloud.com/TXLivePlayer-1.2.0.min.js "></script>
|
|
17
18
|
<!-- 引入播放器 js 文件 -->
|
|
18
|
-
<script src="../../../dist/tcplayer.v4.
|
|
19
|
+
<script src="../../../dist/tcplayer.v4.7.2.js"></script>
|
|
20
|
+
<!-- <script src="https://static.futunn.com/nnlive/lib/js/tcplayer.v4.5.2.min-d98d38ad6c0d398de78b6ad4ae40ba27.js"></script> -->
|
|
19
21
|
<!-- <script src="https://web.sdk.cloud.tencent.cn/player/tcplayer/release/v4.5.3/tcplayer.v4.5.3.min.js"></script> -->
|
|
20
22
|
|
|
21
23
|
<!-- 示例 CSS 样式可自行删除 -->
|
|
@@ -80,9 +82,8 @@ src="https://5664.liveplay.myqcloud.com/live/5664_harchar1.m3u8?txSecret=f22a813
|
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
var player = TCPlayer('player-container-id', {
|
|
83
|
-
autoplay: false,
|
|
84
85
|
// 封面图
|
|
85
|
-
// poster:'https://1256993030.vod2.myqcloud.com/20f8b585vodgzp1256993030/0/player/5285890781393938051.png',
|
|
86
|
+
// poster: 'https://1256993030.vod2.myqcloud.com/20f8b585vodgzp1256993030/0/player/5285890781393938051.png',
|
|
86
87
|
sources: [/* {
|
|
87
88
|
// 快直播地址
|
|
88
89
|
src: 'webrtc://5664.liveplay.myqcloud.com/live/5664_harchar1?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=6403f7bb'
|
|
@@ -91,7 +92,9 @@ src="https://5664.liveplay.myqcloud.com/live/5664_harchar1.m3u8?txSecret=f22a813
|
|
|
91
92
|
src: 'https://5664.liveplay.myqcloud.com/live/5664_harchar1.m3u8?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=6403f7bb'
|
|
92
93
|
}, */{
|
|
93
94
|
// src: 'https://1256993030.vod2.myqcloud.com/d520582dvodtransgzp1256993030/7732bd367447398157015849771/v.f40.mp4'
|
|
94
|
-
src: 'https://liveplay.wemeet.tencent.com/trtc_1400143280/stream_18219061098254429397_648623388.m3u8?txTime=62da4bb7&txSecret=BEDDE265B11E30308A254C7E7AD24095'
|
|
95
|
+
// src: 'https://liveplay.wemeet.tencent.com/trtc_1400143280/stream_18219061098254429397_648623388.m3u8?txTime=62da4bb7&txSecret=BEDDE265B11E30308A254C7E7AD24095'
|
|
96
|
+
// src: 'https://liveplay.futunn.com/live/3159_e8c6d97e97531cd9e552d3805e3b63bb.m3u8?txWMID=173540'
|
|
97
|
+
src: 'https://liveplaydemo.qcloud.com/trtc_1400704311/1400704311_666004_666004_0_main.m3u8?txSecret=6d36db21b33795c07f0de8b283d9f128&txTime=643FD606'
|
|
95
98
|
// src: 'https://5664.liveplay.myqcloud.com/live/5664_harchar1.m3u8?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=6403f7bb'
|
|
96
99
|
}],
|
|
97
100
|
// 可配置参数说明 https://cloud.tencent.com/document/product/881/30820#options-.E5.8F.82.E6.95.B0.E5.88.97.E8.A1.A8
|
|
@@ -106,7 +109,8 @@ src="https://5664.liveplay.myqcloud.com/live/5664_harchar1.m3u8?txSecret=f22a813
|
|
|
106
109
|
},
|
|
107
110
|
hlsConfig: {
|
|
108
111
|
// 参考 hls.js config 说明 https://github.com/video-dev/hls.js/blob/f3c6b2712e63ee6ed32957e4035254856d24605e/docs/API.md#fine-tuning
|
|
109
|
-
}
|
|
112
|
+
},
|
|
113
|
+
autoplay: true
|
|
110
114
|
});
|
|
111
115
|
|
|
112
116
|
player.on('ready', function () {
|
|
@@ -162,10 +166,19 @@ src="https://5664.liveplay.myqcloud.com/live/5664_harchar1.m3u8?txSecret=f22a813
|
|
|
162
166
|
}
|
|
163
167
|
});
|
|
164
168
|
});
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
// 规避 hls.js 偶现seeking后不触发seeked 的问题
|
|
170
|
+
let timeout
|
|
171
|
+
player.one('seeking', (event) => {
|
|
172
|
+
console.log('on seek');
|
|
173
|
+
timeout = setTimeout(function () {
|
|
174
|
+
player.currentTime(Math.ceil(player.currentTime()));
|
|
175
|
+
}, 500);
|
|
176
|
+
player.one('seeked', (event) => {
|
|
177
|
+
console.log('on seeked', timeout);
|
|
178
|
+
clearTimeout(timeout);
|
|
179
|
+
})
|
|
168
180
|
})
|
|
181
|
+
|
|
169
182
|
function playFail() {
|
|
170
183
|
if (player.src().indexOf('webrtc://') === 0) {
|
|
171
184
|
player.tech(true).webrtcProvider && player.tech(true).webrtcProvider.onPlayEvent(-2005);
|
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
<link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.8.0/tcplayer.min.css" rel="stylesheet"/>
|
|
10
10
|
<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.9.1/vconsole.min.js"></script>
|
|
11
11
|
<!-- 引入播放器 js 文件 -->
|
|
12
|
-
|
|
13
|
-
<!-- <script src="http://localhost:8080/dist/tcplayer.v4.8.0.js"></script> -->
|
|
14
|
-
<script src="http://localhost:8080/dist/tcplayer.v5.0.1.js"></script>
|
|
12
|
+
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.8.0/tcplayer.v4.8.0.min.js"></script>
|
|
15
13
|
<!-- 示例 CSS 样式可自行删除 -->
|
|
16
14
|
<style>
|
|
17
15
|
html,body{
|
|
@@ -58,8 +56,7 @@
|
|
|
58
56
|
autoplay: true,
|
|
59
57
|
language: 'en',
|
|
60
58
|
// sources: 'webrtc://global-lebtest-play.myqcloud.com/live/lebtest?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=69f1eb8c&tabr_bitrates=d1080p,d540p,d360p&tabr_start_bitrate=d540p&tabr_control=auto',
|
|
61
|
-
|
|
62
|
-
sources: 'webrtc://global-lebtest-play.myqcloud.com/live/lebtest?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=69f1eb8c',
|
|
59
|
+
sources: 'webrtc://play-t-live.eastbuy.com/live/1067328319987733?txSecret=86cc5042a609979ae0d3cf76f415bc66&txTime=663E447F&tabr_bitrates=efhd,ehd,esd,eld&tabr_start_bitrate=eld&tabr_control=auto',
|
|
63
60
|
// sources: 'webrtc://global-lebtest-play.myqcloud.com/live/lebtest?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=69f1eb8c&tabr_bitrates=d1080p,d540p,d360p&tabr_start_bitrate=d360p&tabr_control=auto',
|
|
64
61
|
// sources: 'webrtc://5664.liveplay.myqcloud.com/live/5664_harchar1?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=6403f7bb',
|
|
65
62
|
// sources: 'webrtc://arrontest.play.elementtest.org/live/shiftTest',
|
|
@@ -71,7 +68,6 @@
|
|
|
71
68
|
|
|
72
69
|
licenseUrl: 'https://license.vod2.myqcloud.com/license/v2/1306264703_1/v_cube.license',
|
|
73
70
|
|
|
74
|
-
|
|
75
71
|
webrtcConfig: {
|
|
76
72
|
// receiveSEI: true,
|
|
77
73
|
connectRetryCount: 0,
|
|
@@ -88,7 +84,10 @@
|
|
|
88
84
|
},
|
|
89
85
|
});
|
|
90
86
|
|
|
91
|
-
|
|
87
|
+
|
|
88
|
+
player.on('webrtcfallback', function(event) {
|
|
89
|
+
|
|
90
|
+
});
|
|
92
91
|
|
|
93
92
|
player.on('webrtcfallback', function(event) {
|
|
94
93
|
|
|
@@ -97,13 +96,9 @@
|
|
|
97
96
|
// player.on('webrtcevent', function(event) {
|
|
98
97
|
// console.log('webrtcEvent', event);
|
|
99
98
|
// });
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
-
player.on('webrtcfallback', function(event) {
|
|
105
|
-
console.log('webrtcfallback', event);
|
|
106
|
-
});
|
|
99
|
+
// player.on('webrtcfallback', function(event) {
|
|
100
|
+
// console.log('webrtcfallback', event);
|
|
101
|
+
// });
|
|
107
102
|
|
|
108
103
|
// player.on('webrtceventtest', function(event) {
|
|
109
104
|
// console.log('webrtceventtest', event);
|