tcplayer.js 5.2.0 → 5.3.1-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.
Files changed (81) hide show
  1. package/dist/font/VideoJS.svg +6 -0
  2. package/dist/font/VideoJS.ttf +0 -0
  3. package/dist/font/VideoJS.woff +0 -0
  4. package/dist/lang/zh-CN.js +4 -0
  5. package/dist/libs/TXLivePlayer-1.3.5.min.js +1 -1
  6. package/dist/tcplayer.min.css +1 -1
  7. package/dist/tcplayer.v5.3.1.min.js +21 -0
  8. package/package.json +3 -3
  9. package/dist/console/vod-player-v3.html +0 -125
  10. package/dist/console/vod-player.html +0 -124
  11. package/dist/examples/vod/7447398155146701990.jpg +0 -0
  12. package/dist/examples/vod/7447398155146701990.vtt +0 -301
  13. package/dist/examples/vod/tcplayer-av1.html +0 -123
  14. package/dist/examples/vod/tcplayer-skip.html +0 -105
  15. package/dist/examples/vod/tcplayer-vod-all.html +0 -275
  16. package/dist/examples/vod/tcplayer-vod-audio-tracks.html +0 -66
  17. package/dist/examples/vod/tcplayer-vod-base-flash.html +0 -64
  18. package/dist/examples/vod/tcplayer-vod-base-native-control.html +0 -68
  19. package/dist/examples/vod/tcplayer-vod-base-v4-dash.html +0 -84
  20. package/dist/examples/vod/tcplayer-vod-base-v4-quality-api.html +0 -90
  21. package/dist/examples/vod/tcplayer-vod-base-v4.html +0 -78
  22. package/dist/examples/vod/tcplayer-vod-base.html +0 -76
  23. package/dist/examples/vod/tcplayer-vod-change-file-statistic.html +0 -79
  24. package/dist/examples/vod/tcplayer-vod-change-file.html +0 -76
  25. package/dist/examples/vod/tcplayer-vod-continue-play-by-fileid.html +0 -70
  26. package/dist/examples/vod/tcplayer-vod-continue-play-by-url.html +0 -72
  27. package/dist/examples/vod/tcplayer-vod-costom-host.html +0 -66
  28. package/dist/examples/vod/tcplayer-vod-custom-enter-full-viewport.html +0 -88
  29. package/dist/examples/vod/tcplayer-vod-custom-playcgi.html +0 -60
  30. package/dist/examples/vod/tcplayer-vod-custom-ui.html +0 -98
  31. package/dist/examples/vod/tcplayer-vod-definition.html +0 -71
  32. package/dist/examples/vod/tcplayer-vod-drm-fairplay.html +0 -165
  33. package/dist/examples/vod/tcplayer-vod-drm-token-auto.html +0 -101
  34. package/dist/examples/vod/tcplayer-vod-drm-token.html +0 -156
  35. package/dist/examples/vod/tcplayer-vod-drm-widevine.html +0 -165
  36. package/dist/examples/vod/tcplayer-vod-drm.html +0 -164
  37. package/dist/examples/vod/tcplayer-vod-dynamic-watermark.html +0 -85
  38. package/dist/examples/vod/tcplayer-vod-enter-full-viewport.html +0 -87
  39. package/dist/examples/vod/tcplayer-vod-event.html +0 -96
  40. package/dist/examples/vod/tcplayer-vod-ghost-watermark.html +0 -52
  41. package/dist/examples/vod/tcplayer-vod-hls-decrypt-key-tool.html +0 -215
  42. package/dist/examples/vod/tcplayer-vod-hls-decrypt-key.html +0 -76
  43. package/dist/examples/vod/tcplayer-vod-hls-encrypt-private.html +0 -97
  44. package/dist/examples/vod/tcplayer-vod-hls-encrypt.html +0 -61
  45. package/dist/examples/vod/tcplayer-vod-hls-masterplaylist.html +0 -65
  46. package/dist/examples/vod/tcplayer-vod-hls-token.html +0 -67
  47. package/dist/examples/vod/tcplayer-vod-image-patch.html +0 -66
  48. package/dist/examples/vod/tcplayer-vod-key.html +0 -87
  49. package/dist/examples/vod/tcplayer-vod-level-switch-tips.html +0 -85
  50. package/dist/examples/vod/tcplayer-vod-logo.html +0 -72
  51. package/dist/examples/vod/tcplayer-vod-mirror.html +0 -66
  52. package/dist/examples/vod/tcplayer-vod-mutil.html +0 -68
  53. package/dist/examples/vod/tcplayer-vod-no-control.html +0 -62
  54. package/dist/examples/vod/tcplayer-vod-no-progress.html +0 -64
  55. package/dist/examples/vod/tcplayer-vod-pdt-seek.html +0 -74
  56. package/dist/examples/vod/tcplayer-vod-playlist.html +0 -76
  57. package/dist/examples/vod/tcplayer-vod-preload.html +0 -74
  58. package/dist/examples/vod/tcplayer-vod-progress-marker.html +0 -64
  59. package/dist/examples/vod/tcplayer-vod-refer.html +0 -84
  60. package/dist/examples/vod/tcplayer-vod-size-adaptive.html +0 -70
  61. package/dist/examples/vod/tcplayer-vod-size-full-viewport.html +0 -68
  62. package/dist/examples/vod/tcplayer-vod-size.html +0 -70
  63. package/dist/examples/vod/tcplayer-vod-trial.html +0 -150
  64. package/dist/examples/vod/tcplayer-vod-vr.html +0 -133
  65. package/dist/examples/vod/tcplayer-vod-vtt-thumbnail-src.html +0 -71
  66. package/dist/examples/vod/tcplayer-vod-vtt-thumbnail.html +0 -65
  67. package/dist/examples/vod/tcplayer-vod-x5-playsinline.html +0 -65
  68. package/dist/examples/vod/tcplayer-vod-x5.html +0 -66
  69. package/dist/examples/vod/typlayer-vod-dynamic-init.html +0 -129
  70. package/dist/examples/vod/veplayer.html +0 -38
  71. package/dist/examples/webrtc/tcplayer-src-dynamic.html +0 -92
  72. package/dist/examples/webrtc/tcplayer-src-meeting.html +0 -206
  73. package/dist/examples/webrtc/tcplayer-src-webrtc-abr-new.html +0 -163
  74. package/dist/examples/webrtc/tcplayer-src-webrtc-abr.html +0 -235
  75. package/dist/examples/webrtc/tcplayer-src-webrtc-autoplay.html +0 -124
  76. package/dist/examples/webrtc/tcplayer-src-webrtc-change-src.html +0 -189
  77. package/dist/examples/webrtc/tcplayer-src-webrtc-mutilRes.html +0 -142
  78. package/dist/examples/webrtc/tcplayer-src-webrtc.html +0 -95
  79. package/dist/font/VideoJS.eot +0 -0
  80. package/dist/tcplayer.css +0 -2684
  81. package/dist/tcplayer.v5.2.0.min.js +0 -21
@@ -1,150 +0,0 @@
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>
@@ -1,133 +0,0 @@
1
-
2
- <!DOCTYPE html>
3
- <html lang="en">
4
-
5
- <head>
6
- <meta charset="UTF-8">
7
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
8
- <meta name="viewport"
9
- content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
10
- <title>腾讯云视频点播示例</title>
11
-
12
-
13
- <link href="https://tcplayer.vcube.tencent.com/tcplayer/release/v4.8.0/tcplayer.min.css" rel="stylesheet" />
14
- <script src="https://tcplayer.vcube.tencent.com/tcplayer-plugins/tcplayer.v4.8.0.min.js"></script>
15
-
16
- <script src="https://webrtc-demo.myqcloud.com/pull-sdk/js/vconsole.min.js"></script>
17
-
18
- <style>
19
- html,
20
- body {
21
- margin: 0;
22
- padding: 0;
23
- }
24
-
25
- .tcplayer {
26
- margin: 0 auto;
27
- }
28
-
29
- @media screen and (max-width: 640px) {
30
- #player-container-id {
31
- width: 100%;
32
- height: 270px;
33
- }
34
- }
35
-
36
- /* 设置logo在高分屏的显示样式 */
37
- @media only screen and (min-device-pixel-ratio: 2),
38
- only screen and (-webkit-min-device-pixel-ratio: 2) {
39
- .tcp-logo-img {
40
- width: 50%;
41
- }
42
- }
43
- </style>
44
- </head>
45
-
46
- <body style="overflow-y: hidden">
47
- <!-- 设置播放器容器 -->
48
- <video id="player-container-id" preload="auto" width="640" height="360" playsinline webkit-playsinline crossorigin="anonymous">
49
- </video>
50
-
51
- <button id="enterVR">enterVR</button>
52
- <button id="exitVR">exitVR</button>
53
- <button id="enableSensor">enableSensor</button>
54
- <button id="gyroscopeVR">gyroscope:VR</button>
55
- <button id="gyroscopeNone">gyroscope:none</button>
56
- <button id="lookAt">lookAt</button>
57
-
58
-
59
-
60
- <!--
61
- 注意事项:
62
- * 播放器容器必须为 video 标签
63
- * player-container-id 为播放器容器的ID,可自行设置
64
- * 播放器区域的尺寸请按需设置,建议通过 css 进行设置,通过css可实现容器自适应等效果
65
- * playsinline webkit-playsinline 这几个属性是为了在标准移动端浏览器不劫持视频播放的情况下实现行内播放,此处仅作示例,请按需使用
66
- * 设置 x5-playsinline 属性会使用 X5 UI 的播放器
67
- -->
68
-
69
- <script>
70
- var vConsole = new VConsole();
71
- var player = TCPlayer('player-container-id', { // player-container-id 为播放器容器ID,必须与html中一致
72
- reportable: false,
73
-
74
- // 12. vr
75
- // appID: '1500005692',
76
- // fileID: '243791580518143986',
77
- // psign: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MTUwMDAwNTY5MiwiZmlsZUlkIjoiMjQzNzkxNTgwNTE4MTQzOTg2IiwiY3VycmVudFRpbWVTdGFtcCI6MTY4MjMzNzM0NywiY29udGVudEluZm8iOnsiYXVkaW9WaWRlb1R5cGUiOiJQcm90ZWN0ZWRBZGFwdGl2ZSIsImRybUFkYXB0aXZlSW5mbyI6eyJwcml2YXRlRW5jcnlwdGlvbkRlZmluaXRpb24iOjEyfX0sInVybEFjY2Vzc0luZm8iOnsiZG9tYWluIjoiMTUwMDAwNTY5Mi52b2QyLm15cWNsb3VkLmNvbSIsInNjaGVtZSI6IkhUVFBTIn19.g6lUJDbNfLmq8vAiC5dn1GlLTw5HT7dUDxSOCDsKALs',
78
-
79
- plugins: {
80
- VR: {
81
- // isEnableController: true,
82
- // isEnableZoom: true,
83
- // yaw: 0,
84
- // pitch: 0,
85
- // fov: 65,
86
- // yawRange: [-180, 180],
87
- // pitchRange: [-90, 90],
88
- // fovRange: [30, 110],
89
- },
90
- }
91
- });
92
-
93
- player.ready(function() {
94
-
95
- });
96
-
97
- player.on('error', (err) => {
98
- console.log('err', err);
99
- });
100
-
101
- // mp4 vr
102
- // player.src('https://1305308197.vod2.myqcloud.com/a3557591vodger1305308197/f7270750243791579800235226/f0.mp4');
103
- player.src('https://test2-kelive-vod.ke.com/6c9782ddvodcq1500000489/42eae20e1397757897057520142/playlist.f9.mp4')
104
-
105
- document.getElementById('enterVR').addEventListener('click', function () {
106
- player.plugins['VR'].enterVR();
107
- });
108
-
109
- document.getElementById('exitVR').addEventListener('click', function () {
110
- player.plugins['VR'].exitVR();
111
- });
112
-
113
- document.getElementById('enableSensor').addEventListener('click', function () {
114
- player.plugins['VR'].enableSensor();
115
- });
116
-
117
- document.getElementById('gyroscopeVR').addEventListener('click', function () {
118
- player.plugins['VR'].setGyroMode('VR');
119
- });
120
-
121
- document.getElementById('gyroscopeNone').addEventListener('click', function () {
122
- player.plugins['VR'].setGyroMode('none');
123
- });
124
-
125
- document.getElementById('lookAt').addEventListener('click', function() {
126
- player.plugins['VR'].lookAt({yaw: 30}, 1000);
127
- });
128
-
129
-
130
- </script>
131
- </body>
132
-
133
- </html>
@@ -1,71 +0,0 @@
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" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
7
- <title>腾讯云视频点播示例</title>
8
- <!-- 引入播放器 css 文件 -->
9
- <link href="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.min.css" rel="stylesheet">
10
- <!-- 如需在IE8、9浏览器中初始化播放器,浏览器需支持Flash并在页面中引入 -->
11
- <!--[if lt IE 9]>
12
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/ie8/videojs-ie8.js"></script>
13
- <![endif]-->
14
- <!-- 如果需要在 Chrome Firefox 等现代浏览器中通过H5播放hls,需要引入 hls.js -->
15
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/libs/hls.min.0.12.4.js"></script>
16
- <!-- 引入播放器 js 文件 -->
17
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.v4.min.js"></script>
18
- <!-- 示例 CSS 样式可自行删除 -->
19
- <style>
20
- html,body{
21
- margin: 0;
22
- padding: 0;
23
- }
24
- .tcplayer {
25
- margin: 0 auto;
26
- }
27
- @media screen and (max-width: 640px) {
28
- #player-container-id {
29
- width: 100%;
30
- height: 270px;
31
- }
32
- }
33
- /* 设置logo在高分屏的显示样式 */
34
- @media only screen and (min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 2) {
35
- .tcp-logo-img {
36
- width: 50%;
37
- }
38
- }
39
- </style>
40
- </head>
41
- <body>
42
- <!-- 设置播放器容器 -->
43
- <video id="player-container-id" preload="auto" width="640" height="360" playsinline webkit-playsinline>
44
- </video>
45
- <!--
46
- 注意事项:
47
- * 播放器容器必须为 video 标签
48
- * player-container-id 为播放器容器的ID,可自行设置
49
- * 播放器区域的尺寸请按需设置,建议通过 css 进行设置,通过css可实现容器自适应等效果
50
- * playsinline webkit-playsinline 这几个属性是为了在标准移动端浏览器不劫持视频播放的情况下实现行内播放,此处仅作示例,请按需使用
51
- * 设置 x5-playsinline 属性会使用 X5 UI 的播放器
52
- -->
53
- <script>
54
- var player = TCPlayer('player-container-id', { // player-container-id 为播放器容器ID,必须与html中一致
55
- fileID: '7447398157015849771', // 请传入需要播放的视频filID 必须
56
- appID: '1256993030' // 请传入点播账号的appID 必须
57
- , plugins:{
58
- VttThumbnail:{
59
- // 'imgUrl': '//imgcache.qq.com/open/qcloud/video/tcplayer/examples/vod/7447398155146701990.jpg', // 传入预览图地址 非必须
60
- 'vttUrl': '//1256993030.vod2.myqcloud.com/d520582dvodtransgzp1256993030/7732bd367447398157015849771/imageSprite/1559273486.vtt' // 传入vtt文件地址
61
- }
62
- }
63
- //其他参数请在开发文档中查看
64
- });
65
- /*
66
- 注意事项:
67
- * 如何生成预览图与vtt文件,查看相关文档https://cloud.tencent.com/document/product/266/8101
68
- */
69
- </script>
70
- </body>
71
- </html>
@@ -1,65 +0,0 @@
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" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
7
- <title>腾讯云视频点播示例</title>
8
- <!-- 引入播放器 css 文件 -->
9
- <link href="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.min.css" rel="stylesheet">
10
- <!-- 如需在IE8、9浏览器中初始化播放器,浏览器需支持Flash并在页面中引入 -->
11
- <!--[if lt IE 9]>
12
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/ie8/videojs-ie8.js"></script>
13
- <![endif]-->
14
- <!-- 如果需要在 Chrome Firefox 等现代浏览器中通过H5播放hls,需要引入 hls.js -->
15
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/libs/hls.min.0.12.4.js"></script>
16
- <!-- 引入播放器 js 文件 -->
17
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.v4.min.js"></script>
18
- <!-- 示例 CSS 样式可自行删除 -->
19
- <style>
20
- html,body{
21
- margin: 0;
22
- padding: 0;
23
- }
24
- .tcplayer {
25
- margin: 0 auto;
26
- }
27
- @media screen and (max-width: 640px) {
28
- #player-container-id {
29
- width: 100%;
30
- height: 270px;
31
- }
32
- }
33
- /* 设置logo在高分屏的显示样式 */
34
- @media only screen and (min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 2) {
35
- .tcp-logo-img {
36
- width: 50%;
37
- }
38
- }
39
- </style>
40
- </head>
41
- <body>
42
- <!-- 设置播放器容器 -->
43
- <video id="player-container-id" preload="auto" width="640" height="360" playsinline webkit-playsinline>
44
- </video>
45
- <!--
46
- 注意事项:
47
- * 播放器容器必须为 video 标签
48
- * player-container-id 为播放器容器的ID,可自行设置
49
- * 播放器区域的尺寸请按需设置,建议通过 css 进行设置,通过css可实现容器自适应等效果
50
- * playsinline webkit-playsinline 这几个属性是为了在标准移动端浏览器不劫持视频播放的情况下实现行内播放,此处仅作示例,请按需使用
51
- * 设置 x5-playsinline 属性会使用 X5 UI 的播放器
52
- -->
53
- <script>
54
- var player = TCPlayer('player-container-id', { // player-container-id 为播放器容器ID,必须与html中一致
55
- fileID: '5285890781386012275', // 请传入需要播放的视频filID 必须
56
- appID: '1256993030' // 请传入点播账号的appID 必须
57
- //其他参数请在开发文档中查看
58
- });
59
- /*
60
- 注意事项:
61
- * 如何生成预览图与vtt文件,查看相关文档https://cloud.tencent.com/document/product/266/8101
62
- */
63
- </script>
64
- </body>
65
- </html>
@@ -1,65 +0,0 @@
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" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
7
- <title>腾讯云视频点播示例</title>
8
- <!-- 引入播放器 css 文件 -->
9
- <link href="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.min.css" rel="stylesheet">
10
- <!-- 如需在IE8、9浏览器中初始化播放器,浏览器需支持Flash并在页面中引入 -->
11
- <!--[if lt IE 9]>
12
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/ie8/videojs-ie8.js"></script>
13
- <![endif]-->
14
- <!-- 如果需要在 Chrome Firefox 等现代浏览器中通过H5播放hls,需要引入 hls.js -->
15
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/libs/hls.min.0.12.4.js"></script>
16
- <!-- 引入播放器 js 文件 -->
17
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.v4.min.js"></script>
18
- <!-- 示例 CSS 样式可自行删除 -->
19
- <style>
20
- html,body{
21
- margin: 0;
22
- padding: 0;
23
- }
24
- .tcplayer {
25
- margin: 0 auto;
26
- }
27
- @media screen and (max-width: 640px) {
28
- #player-container-id {
29
- width: 100%;
30
- height: 270px;
31
- }
32
- }
33
- /* 设置logo在高分屏的显示样式 */
34
- @media only screen and (min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 2) {
35
- .tcp-logo-img {
36
- width: 50%;
37
- }
38
- }
39
- </style>
40
- </head>
41
- <body>
42
- <!-- 设置播放器容器 -->
43
- <video id="player-container-id" preload="auto" width="640" height="360" playsinline webkit-playsinline x5-playsinline>
44
- </video>
45
- <!--
46
- 注意事项:
47
- * 播放器容器必须为 video 标签
48
- * player-container-id 为播放器容器的ID,可自行设置
49
- * 播放器区域的尺寸请按需设置,建议通过 css 进行设置,通过css可实现容器自适应等效果
50
- * playsinline webkit-playsinline 这几个属性是为了在标准移动端浏览器不劫持视频播放的情况下实现行内播放,此处仅作示例,请按需使用
51
- * 设置 x5-playsinline 属性会使用 X5 UI 的播放器
52
- -->
53
- <script>
54
- var player = TCPlayer('player-container-id', { // player-container-id 为播放器容器ID,必须与html中一致
55
- fileID: '5285890799710670616', // 请传入需要播放的视频filID 必须
56
- appID: '1400329073' // 请传入点播账号的appID 必须
57
- //其他参数请在开发文档中查看
58
- });
59
- /*
60
- 注意事项:
61
- * 示例代码使用的是新点播播放器,该点播播放器在灰度体验中,将逐步替换旧的点播播放器 qcplayer
62
- */
63
- </script>
64
- </body>
65
- </html>
@@ -1,66 +0,0 @@
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" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
7
- <title>腾讯云视频点播示例</title>
8
- <!-- 引入播放器 css 文件 -->
9
- <link href="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.min.css" rel="stylesheet">
10
- <!-- 如需在IE8、9浏览器中初始化播放器,浏览器需支持Flash并在页面中引入 -->
11
- <!--[if lt IE 9]>
12
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/ie8/videojs-ie8.js"></script>
13
- <![endif]-->
14
- <!-- 如果需要在 Chrome Firefox 等现代浏览器中通过H5播放hls,需要引入 hls.js -->
15
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/libs/hls.min.0.12.4.js"></script>
16
- <!-- 引入播放器 js 文件 -->
17
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.v4.min.js"></script>
18
- <!-- 示例 CSS 样式可自行删除 -->
19
- <style>
20
- html,body{
21
- margin: 0;
22
- padding: 0;
23
- }
24
- .tcplayer {
25
- margin: 0 auto;
26
- }
27
- @media screen and (max-width: 640px) {
28
- #player-container-id {
29
- width: 100%;
30
- height: 270px;
31
- }
32
- }
33
- /* 设置logo在高分屏的显示样式 */
34
- @media only screen and (min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 2) {
35
- .tcp-logo-img {
36
- width: 50%;
37
- }
38
- }
39
- </style>
40
- </head>
41
- <body>
42
- <!-- 设置播放器容器 -->
43
- <video id="player-container-id" preload="auto" width="640" height="360" playsinline webkit-playsinline x5-video-player-type="h5" x5-video-player-fullscreen="true">
44
- </video>
45
- <!-- playsinline webkit-playsinline x5-playsinline -->
46
- <!--
47
- 注意事项:
48
- * 播放器容器必须为 video 标签
49
- * player-container-id 为播放器容器的ID,可自行设置
50
- * 播放器区域的尺寸请按需设置,建议通过 css 进行设置,通过css可实现容器自适应等效果
51
- * playsinline webkit-playsinline 这几个属性是为了在标准移动端浏览器不劫持视频播放的情况下实现行内播放,此处仅作示例,请按需使用
52
- * 设置 x5-playsinline 属性会使用 X5 UI 的播放器
53
- -->
54
- <script>
55
- var player = TCPlayer('player-container-id', { // player-container-id 为播放器容器ID,必须与html中一致
56
- fileID: '7447398157015849771', // 请传入需要播放的视频filID 必须
57
- appID: '1256993030' // 请传入点播账号的appID 必须
58
- //其他参数请在开发文档中查看
59
- });
60
- /*
61
- 注意事项:
62
- * 示例代码使用的是新点播播放器,该点播播放器在灰度体验中,将逐步替换旧的点播播放器 qcplayer
63
- */
64
- </script>
65
- </body>
66
- </html>
@@ -1,129 +0,0 @@
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" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
7
- <title>腾讯云视频点播示例-动态加载、隐藏、销毁播放器</title>
8
- <!-- 引入播放器 css 文件 -->
9
- <link href="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.min.css" rel="stylesheet">
10
- <!-- 如需在IE8、9浏览器中初始化播放器,浏览器需支持Flash并在页面中引入 -->
11
- <!--[if lt IE 9]>
12
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/ie8/videojs-ie8.js"></script>
13
- <![endif]-->
14
- <!-- 如果需要在 Chrome Firefox 等现代浏览器中通过H5播放hls,需要引入 hls.js -->
15
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/libs/hls.min.0.12.4.js"></script>
16
- <!-- 引入播放器 js 文件 -->
17
- <script src="//imgcache.qq.com/open/qcloud/video/tcplayer/tcplayer.v4.min.js"></script>
18
- <!-- 示例 CSS 样式可自行删除 -->
19
- <style>
20
- html,body{
21
- margin: 0;
22
- padding: 0;
23
- }
24
- .tcplayer {
25
- margin: 0 auto;
26
- }
27
- @media screen and (max-width: 640px) {
28
- #player-container-id {
29
- width: 100%;
30
- height: 270px;
31
- }
32
- }
33
- /* 设置logo在高分屏的显示样式 */
34
- @media only screen and (min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 2) {
35
- .tcp-logo-img {
36
- width: 50%;
37
- }
38
- }
39
- .button-container{
40
- text-align: center;
41
- }
42
-
43
- #video-container-id{
44
- display:none;
45
- }
46
- </style>
47
- </head>
48
- <body>
49
- <!-- 设置播放器容器 -->
50
- <div id="video-container"/></div>
51
- <br>
52
- <div class="button-container">
53
- <button onclick="loadVideo()">加载</button>
54
- <button onclick="showVideo()">隐藏/显示</button>
55
- <button onclick="disposeVideo()">销毁</button>
56
- </div>
57
- <!--
58
- 注意事项:
59
- * 播放器容器必须为 video 标签
60
- * player-container-id 为播放器容器的ID,可自行设置
61
- * 播放器区域的尺寸请按需设置,建议通过 css 进行设置,通过css可实现容器自适应等效果
62
- * playsinline webkit-playsinline 这几个属性是为了在标准移动端浏览器不劫持视频播放的情况下实现行内播放,此处仅作示例,请按需使用
63
- * 设置 x5-playsinline 属性会使用 X5 UI 的播放器
64
- -->
65
- <script>
66
- var a,b;
67
- //动态加载播放器
68
- function loadVideo() {
69
- var container = document.getElementById('video-container');
70
- var getvideo = document.getElementById("player-container-id");
71
- if(getvideo==null){
72
- container.innerHTML = '<video id="player-container-id" preload="auto" width="640" height="360" playsinline webkit-playsinline>';
73
- player = TCPlayer('player-container-id', { // player-container-id 为播放器容器ID,必须与html中一致
74
- fileID: '7447398157015849771', // 请传入需要播放的视频filID 必须
75
- appID: '1256993030', // 请传入点播账号的appID 必须
76
- });
77
- // 监听play的次数,根据次数判断用户点击显示/隐藏按钮时是否调用play()或pause
78
- a=0;
79
- player.on('play', function(){
80
- a+=1;
81
- });
82
- // 监听pause次数,用法同上
83
- b=0;
84
- player.on('pause', function(){
85
- b+=1;
86
- });
87
- }else{
88
- alert('播放器已经初始化过了。');
89
- }
90
- };
91
-
92
- //隐藏/显示播放器
93
- function showVideo(){
94
- var container = document.getElementById('video-container');
95
- var getvideo = document.getElementById("player-container-id");
96
- var videoheight = container.clientHeight;
97
- if(getvideo==null){
98
- alert("播放器还没有初始化。");
99
- }else if(videoheight>0){
100
- getvideo.style.display='none';
101
- // 判断隐藏前是否有点击播放以及暂停
102
- if(a>0 && a==b){
103
- a+=1000;
104
- }else{
105
- player.pause();
106
- }
107
- }else if(videoheight<=0){
108
- getvideo.style.display='block';
109
- // 判断显示前是否有点击播放以及是用户主观暂停还是隐藏时调用的暂停
110
- if(a>0 && a>1000 ){
111
- a-=1000;
112
- }else if(a>0 && a==b){
113
- player.play();
114
- }
115
- }
116
- };
117
-
118
- //销毁播放器
119
- function disposeVideo(){
120
- var getvideo = document.getElementById("player-container-id");
121
- if(getvideo==null){
122
- alert("播放器还没有初始化。");
123
- }else{
124
- player.dispose();
125
- }
126
- };
127
- </script>
128
- </body>
129
- </html>