tcplayer.js 4.9.0-beta.2 → 4.9.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/CHANGELOG.md +120 -0
- package/dist/examples/vod/dvr-event-sprite.html +212 -0
- package/dist/examples/vod/tcplayer-hls-live-5.0.0.html +83 -154
- package/dist/examples/vod/tcplayer-vod-all.html +107 -25
- package/dist/examples/vod/tcplayer-vod-base.html +19 -26
- 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-trial.html +150 -0
- package/dist/examples/vod/tcplayer-vod-vr.html +138 -0
- package/dist/examples/vod/tcplayer-vod-vtt-thumbnail-src.html +82 -48
- package/dist/examples/vod/{tcplayer-continue-play.html → youling.html} +67 -52
- package/dist/examples/webrtc/tcplayer-src-webrtc.html +23 -91
- 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/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.v4.9.1.min.js +20 -0
- package/package.json +2 -2
- package/dist/examples/vod/axios.html +0 -56
- package/dist/examples/webrtc/tcplayer-test-fallback.html +0 -111
- package/dist/examples/webrtc/tcplayer.v4.8.0.min.js +0 -17
- package/dist/tcplayer.v4.9.0.min.js +0 -18
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tcplayer.js",
|
|
3
3
|
"description": "腾讯云 Web 播放器",
|
|
4
|
-
"version": "4.9.
|
|
5
|
-
"main": "./dist/tcplayer.v4.9.
|
|
4
|
+
"version": "4.9.1",
|
|
5
|
+
"main": "./dist/tcplayer.v4.9.1.min.js",
|
|
6
6
|
"style": "./dist/tcplayer.min.css",
|
|
7
7
|
"copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
|
|
8
8
|
"license": "Apache-2.0",
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
-
|
|
9
|
-
<title>Document</title>
|
|
10
|
-
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
|
11
|
-
|
|
12
|
-
<script src="https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js"></script>
|
|
13
|
-
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
|
14
|
-
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
|
|
20
|
-
var vConsole = new window.VConsole();
|
|
21
|
-
|
|
22
|
-
// axios.get('https://license.vod2.myqcloud.com/license/v2/1314658011_1/v_cube.license').then(res => {
|
|
23
|
-
// document.body.innerHTML = JSON.stringify(res);
|
|
24
|
-
// }).catch(e=>{
|
|
25
|
-
// document.body.innerHTML = JSON.stringify(e);
|
|
26
|
-
// });
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// var xhr = new XMLHttpRequest();
|
|
31
|
-
// xhr.open("GET", "https://license.vod2.myqcloud.com/license/v2/1314658011_1/v_cube.license", true);
|
|
32
|
-
// xhr.onload = function (e) {
|
|
33
|
-
// alert(xhr.readyState);
|
|
34
|
-
// alert(xhr.status);
|
|
35
|
-
// if (xhr.readyState === 4) {
|
|
36
|
-
// if (xhr.status === 200) {
|
|
37
|
-
// console.log('xhr.responseText', xhr.responseText);
|
|
38
|
-
// } else {
|
|
39
|
-
// console.error(xhr.statusText);
|
|
40
|
-
// }
|
|
41
|
-
// }
|
|
42
|
-
// };
|
|
43
|
-
// xhr.onerror = function (e) {
|
|
44
|
-
// console.error(xhr.statusText);
|
|
45
|
-
// };
|
|
46
|
-
// xhr.send(null);
|
|
47
|
-
|
|
48
|
-
fetch('https://license.vod2.myqcloud.com/license/v2/1314658011_1/v_cube.license').then((response) => response.json())
|
|
49
|
-
.then((data) => document.body.innerHTML = JSON.stringify(data));
|
|
50
|
-
|
|
51
|
-
</script>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</body>
|
|
56
|
-
</html>
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
|
|
8
|
-
<title>腾讯云tcplayer快直播测试</title>
|
|
9
|
-
|
|
10
|
-
<link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.5.1/tcplayer.min.css" rel="stylesheet"/>
|
|
11
|
-
<!--如果需要在 Chrome 和 Firefox 等现代浏览器中通过 H5 播放 Webrtc 视频,需要在 tcplayer.vx.x.x.min.js 之前引入 TXLivePlayer-x.x.x.min.js。-->
|
|
12
|
-
<!--有些浏览器环境不支持 Webrtc,播放器会将 Webrtc 流地址自动转换为 HLS 格式地址,因此快直播场景同样需要引入hls.min.x.xx.xm.js。-->
|
|
13
|
-
<!-- 引入vconsole -->
|
|
14
|
-
<script src="https://tcplayer.vcube.tencent.com/webrtc-demo/js/vconsole.min.js"></script>
|
|
15
|
-
<script> var vConsole = new VConsole(); console.log('Hello world');</script>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.8.0/tcplayer.min.css" rel="stylesheet"/>
|
|
19
|
-
<!--播放器脚本文件-->
|
|
20
|
-
<script src="https://web.sdk.qcloud.com/player/tcplayer/release/v4.8.0/tcplayer.v4.8.0.min.js"></script>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<style>
|
|
25
|
-
html,body{
|
|
26
|
-
margin: 0;
|
|
27
|
-
padding: 0;
|
|
28
|
-
}
|
|
29
|
-
.tcplayer {
|
|
30
|
-
margin: 0 auto;
|
|
31
|
-
}
|
|
32
|
-
</style>
|
|
33
|
-
</head>
|
|
34
|
-
<body>
|
|
35
|
-
<!-- 设置播放器容器 -->
|
|
36
|
-
<video id="player-container-id" width="414" height="270" preload="auto" playsinline webkit-playsinline>
|
|
37
|
-
</video>
|
|
38
|
-
<!--
|
|
39
|
-
注意事项:
|
|
40
|
-
* 播放器容器必须为 video 标签
|
|
41
|
-
* player-container-id 为播放器容器的ID,可自行设置
|
|
42
|
-
* 播放器区域的尺寸请按需设置,建议通过 css 进行设置,通过css可实现容器自适应等效果
|
|
43
|
-
-->
|
|
44
|
-
<script>
|
|
45
|
-
|
|
46
|
-
var player = TCPlayer('player-container-id', {
|
|
47
|
-
autoplay: true,
|
|
48
|
-
muted: false,
|
|
49
|
-
webrtcConfig: {
|
|
50
|
-
signalDomain: {
|
|
51
|
-
protocol: 'https', // http or https
|
|
52
|
-
// domain: 'oswebrtc.liveplay.myqcloud.com', // 域名
|
|
53
|
-
domain: 'overseas-webrtc.tliveplay.com',
|
|
54
|
-
query: false, // 是否查询信令域名调度接口
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}); // player-container-id 为播放器容器 ID,必须与 html 中一致
|
|
58
|
-
player.src("webrtc://global-lebtest-play.myqcloud.com/live/lebtest"); // url 播放地址
|
|
59
|
-
// player.src("https://global-lebtest-play.myqcloud.com/live/lebtest.m3u8?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=69f1eb8c"); // url 播放地址
|
|
60
|
-
|
|
61
|
-
player.on('canplay', function(canplay) {
|
|
62
|
-
console.log("canplay")
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
player.on('volumechange', function(volumechange) {
|
|
67
|
-
console.log("volumechange")
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
player.on('blocked', function(blocked) {
|
|
71
|
-
console.log("自动播放被阻止")
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
// player.on('loadedmetadata', function(loadedmetadata) {
|
|
75
|
-
// console.log(loadedmetadata)
|
|
76
|
-
// });
|
|
77
|
-
|
|
78
|
-
player.on('error', function(error) {
|
|
79
|
-
console.log(error)
|
|
80
|
-
// player.src("https://5664.liveplay.myqcloud.com/live/5664_harchar1.flv?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=6403f7bb")
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
player.on('webrtcevent', function(webrtcevent) {
|
|
84
|
-
console.log('webrtcevent',webrtcevent["data"]["code"])
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
// player.on('webrtcevent', function(webrtcevent) {
|
|
88
|
-
// console.log('webrtcevent',webrtcevent)
|
|
89
|
-
// });
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var livePlayer = new TXLivePlayer();
|
|
94
|
-
|
|
95
|
-
TXLivePlayer.checkSupport(function(data) {
|
|
96
|
-
// 是否支持WebRTC
|
|
97
|
-
if (data.support) {
|
|
98
|
-
console.log('WebRTC Support');
|
|
99
|
-
} else {
|
|
100
|
-
console.log('WebRTC Not Support');
|
|
101
|
-
}
|
|
102
|
-
// 是否支持H264
|
|
103
|
-
if (data.h264Support) {
|
|
104
|
-
console.log('H264 Support');
|
|
105
|
-
} else {
|
|
106
|
-
console.log('H264 Not Support');
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
</script>
|
|
110
|
-
</body>
|
|
111
|
-
</html>
|