tcplayer.js 4.8.0 → 5.0.0
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-skip.html +105 -0
- package/dist/examples/vod/tcplayer-vod-all.html +101 -8
- package/dist/examples/vod/tcplayer-vod-event.html +7 -4
- package/dist/examples/vod/tcplayer-vod-ghost-watermark.html +6 -2
- package/dist/examples/vod/tcplayer-vod-vr.html +138 -0
- package/dist/examples/webrtc/tcplayer-src-webrtc-abr-new.html +109 -0
- package/dist/examples/webrtc/tcplayer-src-webrtc-abr.html +1 -2
- package/dist/examples/webrtc/tcplayer-src-webrtc.html +9 -84
- package/dist/libs/TXLivePlayer-1.3.4.min.js +1 -0
- package/dist/libs/tcpcrypto.1.0.0.js +2 -0
- package/dist/plugins/tcplayer-safe-check-plugin.1.0.0.js +2 -0
- package/dist/plugins/tcplayer-vr-plugin.1.0.0.js +2 -0
- package/dist/tcplayer.css +154 -2
- package/dist/tcplayer.min.css +1 -1
- package/dist/tcplayer.v5.0.0.min.js +26 -0
- package/package.json +2 -2
- package/dist/libs/TXLivePlayer-1.3.0.min.js +0 -1
- package/dist/tcplayer.v4.8.0.min.js +0 -17
|
@@ -7,17 +7,10 @@
|
|
|
7
7
|
<title>腾讯视频云快直播示例</title>
|
|
8
8
|
<!-- 引入播放器 css 文件 -->
|
|
9
9
|
<link href="https://web.sdk.cloud.tencent.cn/player/tcplayer/release/v4.5.0/tcplayer.min.css" rel="stylesheet">
|
|
10
|
-
<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.9.1/vconsole.min.js"></script>
|
|
11
|
-
|
|
12
|
-
<script src="https://imgcache.qq.com/open/qcloud/video/tcplayer/libs/hls.min.0.13.2m.js"></script>
|
|
13
|
-
<!-- <script src="https://cloudcache.tencent-cloud.com/open/qcloud/live/webrtc/js/TXLivePlayer-1.1.0.min.js"></script> -->
|
|
14
|
-
<!-- <script src="https://wliap-1306264703.cos.ap-nanjing.myqcloud.com/TXLivePlayer-1.2.0.min.js "></script> -->
|
|
15
|
-
<script src="https://testmig-1306264703.cos.ap-guangzhou.myqcloud.com/wm/TXLivePlayer-1.2.1.min.js"></script>
|
|
16
|
-
|
|
17
|
-
|
|
18
10
|
|
|
19
11
|
<!-- 引入播放器 js 文件 -->
|
|
20
|
-
<script src="https://
|
|
12
|
+
<script src="https://tcplayer.vcube.tencent.com/tcplayer/temp/tcplayer.v4.8.0.min.js"></script>
|
|
13
|
+
<script src="https://cdn.bootcdn.net/ajax/libs/vConsole/3.9.1/vconsole.min.js"></script>
|
|
21
14
|
<!-- 示例 CSS 样式可自行删除 -->
|
|
22
15
|
<style>
|
|
23
16
|
html,body{
|
|
@@ -50,48 +43,28 @@
|
|
|
50
43
|
<!-- 设置播放器容器 -->
|
|
51
44
|
<video id="player-container-id" preload="auto" width="640" height="360" playsinline webkit-playsinline>
|
|
52
45
|
</video>
|
|
53
|
-
|
|
54
|
-
src="https://5664.liveplay.myqcloud.com/live/5664_harchar1.m3u8?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=6403f7bb">
|
|
55
|
-
</video> -->
|
|
46
|
+
|
|
56
47
|
<div class="button-container">
|
|
57
|
-
<!-- <button onclick="playFlv()">flv</button> -->
|
|
58
|
-
<!-- <button onclick="playHls()">hls</button> -->
|
|
59
|
-
<!-- <button onclick="playFail()">模拟快直播-2005事件,降级播放hls</button> -->
|
|
60
|
-
<!-- <button onclick="fullscreen()">webkit fullscreen</button> -->
|
|
61
|
-
<!-- <button onclick="fullscreen('#player-native')">fullscreen</button> -->
|
|
62
48
|
</div>
|
|
63
|
-
<!-- <video class="tcplayer" id="player1" preload="auto" width="640" height="360" playsinline webkit-playsinline>
|
|
64
|
-
</video> -->
|
|
65
|
-
<!-- <video class="tcplayer" id="player2" preload="auto" width="640" height="360" playsinline webkit-playsinline>
|
|
66
|
-
</video> -->
|
|
67
49
|
<script>
|
|
68
50
|
if (TCPlayer.browser.IS_ANDROID || TCPlayer.browser.IS_IOS) {
|
|
69
51
|
const vConsole = new VConsole({ maxLogNumber: 1000 });
|
|
70
52
|
}
|
|
71
53
|
|
|
72
54
|
var player = TCPlayer('player-container-id',{
|
|
73
|
-
// 封面图
|
|
74
|
-
// poster:'https://1256993030.vod2.myqcloud.com/20f8b585vodgzp1256993030/0/player/5285890781393938051.png',
|
|
75
55
|
sources: [{
|
|
56
|
+
src: 'webrtc://global-lebtest-play.myqcloud.com/live/lebtest?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=69f1eb8c',
|
|
57
|
+
}, {
|
|
76
58
|
// 快直播地址
|
|
77
59
|
src: 'webrtc://5664.liveplay.myqcloud.com/live/5664_harchar1?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=6403f7bb'
|
|
78
60
|
},{
|
|
79
61
|
// HLS直播地址
|
|
80
62
|
src: 'https://5664.liveplay.myqcloud.com/live/5664_harchar1.m3u8?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=6403f7bb'
|
|
81
63
|
}],
|
|
82
|
-
|
|
83
|
-
controlBar: {
|
|
84
|
-
// 是否显示进度条
|
|
85
|
-
// progressControl:false
|
|
86
|
-
},
|
|
87
|
-
//
|
|
88
|
-
// nativeControlsForTouch:true,
|
|
64
|
+
|
|
89
65
|
webrtcConfig: {
|
|
90
|
-
|
|
66
|
+
receiveSEI: true,
|
|
91
67
|
},
|
|
92
|
-
hlsConfig: {
|
|
93
|
-
// 参考 hls.js config 说明 https://github.com/video-dev/hls.js/blob/f3c6b2712e63ee6ed32957e4035254856d24605e/docs/API.md#fine-tuning
|
|
94
|
-
}
|
|
95
68
|
});
|
|
96
69
|
|
|
97
70
|
|
|
@@ -108,58 +81,10 @@ src="https://5664.liveplay.myqcloud.com/live/5664_harchar1.m3u8?txSecret=f22a813
|
|
|
108
81
|
console.log('webrtcfallback', event);
|
|
109
82
|
});
|
|
110
83
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
'loadstart',
|
|
114
|
-
'suspend',
|
|
115
|
-
'abort',
|
|
116
|
-
'error',
|
|
117
|
-
'emptied',
|
|
118
|
-
'stalled',
|
|
119
|
-
'loadedmetadata',
|
|
120
|
-
'loadeddata',
|
|
121
|
-
'canplay',
|
|
122
|
-
'canplaythrough',
|
|
123
|
-
'playing',
|
|
124
|
-
'waiting',
|
|
125
|
-
'seeking',
|
|
126
|
-
'seeked',
|
|
127
|
-
'ended',
|
|
128
|
-
'durationchange',
|
|
129
|
-
'timeupdate',
|
|
130
|
-
'progress',
|
|
131
|
-
'play',
|
|
132
|
-
'pause',
|
|
133
|
-
'ratechange',
|
|
134
|
-
'resize',
|
|
135
|
-
'volumechange'
|
|
136
|
-
];
|
|
137
|
-
events.forEach(function(val, i){
|
|
138
|
-
player.on(val, function (event) {
|
|
139
|
-
if(val !='timeupdate'){
|
|
140
|
-
console.log('player event', val);
|
|
141
|
-
}
|
|
142
|
-
if(val === 'waiting'){
|
|
143
|
-
console.log('waiting事件,可以标记为卡顿开始');
|
|
144
|
-
}
|
|
145
|
-
if(val === 'playing'){
|
|
146
|
-
console.log('开始播放或恢复播放,可以标记为卡顿结束');
|
|
147
|
-
}
|
|
148
|
-
});
|
|
84
|
+
player.on('webrtcsei', function(event) {
|
|
85
|
+
console.log('webrtcsei', event.data);
|
|
149
86
|
});
|
|
150
87
|
|
|
151
|
-
function playFail() {
|
|
152
|
-
if (player.src().indexOf('webrtc://')===0) {
|
|
153
|
-
player.tech(true).webrtcProvider && player.tech(true).webrtcProvider.onPlayEvent(-2005);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
function fullscreen(elementID) {
|
|
157
|
-
if (elementID){
|
|
158
|
-
document.querySelector(elementID).webkitEnterFullScreen();
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
document.querySelector('video').webkitEnterFullScreen();
|
|
162
|
-
}
|
|
163
88
|
</script>
|
|
164
89
|
</body>
|
|
165
90
|
</html>
|