tcplayer.js 4.8.0-beta.1 → 4.8.0-beta.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tcplayer.js",
3
3
  "description": "腾讯云 Web 播放器",
4
- "version": "4.8.0-beta.1",
4
+ "version": "4.8.0-beta.2",
5
5
  "main": "./dist/tcplayer.v4.8.0.min.js",
6
6
  "style": "./dist/tcplayer.min.css",
7
7
  "copyright": "Copyright Brightcove, Inc. <https://www.brightcove.com/>",
@@ -1,107 +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
- <link href="https://web.sdk.qcloud.com/player/tcplayer/release/v4.6.0/tcplayer.min.css" rel="stylesheet"/>
9
- <!-- <script src="https://imgcache.qq.com/open/qcloud/video/tcplayer/libs/vconsole.min.3.3.0.js"></script> -->
10
- <!--播放器脚本文件-->
11
- <script src="http://10.21.39.48:8080/dist/tcplayer.v4.8.0.js"></script>
12
-
13
- <style>
14
- html,body{
15
- margin: 0;
16
- padding: 0;
17
- }
18
- .tcplayer {
19
- margin: 0 auto;
20
- }
21
- @media screen and (max-width: 640px) {
22
- #player-container-id {
23
- width: 100%;
24
- height: 270px;
25
- }
26
- }
27
- /* 设置logo在高分屏的显示样式 */
28
- @media only screen and (min-device-pixel-ratio: 2), only screen and (-webkit-min-device-pixel-ratio: 2) {
29
- .tcp-logo-img {
30
- width: 50%;
31
- }
32
- }
33
- </style>
34
- </head>
35
- <body>
36
- <!-- 设置播放器容器 -->
37
- <video id="player-container-id" preload="auto" width="640" height="360" playsinline webkit-playsinline>
38
- </video>
39
- <!--
40
- 注意事项:
41
- * 播放器容器必须为 video 标签
42
- * player-container-id 为播放器容器的ID,可自行设置
43
- * 播放器区域的尺寸请按需设置,建议通过 css 进行设置,通过css可实现容器自适应等效果
44
- * playsinline webkit-playsinline 这几个属性是为了在标准移动端浏览器不劫持视频播放的情况下实现行内播放,此处仅作示例,请按需使用
45
- * 设置 x5-playsinline 属性会使用 X5 UI 的播放器
46
- -->
47
- <script>
48
- // var vConsole = new VConsole();
49
- var player = TCPlayer('player-container-id', { // player-container-id 为播放器容器ID,必须与html中一致
50
- autoplay: true,
51
-
52
- // 播放卡住
53
- // appID: '1500015539',
54
- // fileID: '3270835010799147274',
55
- // psign: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MTUwMDAxNTUzOSwiY29udGVudEluZm8iOnsiYXVkaW9WaWRlb1R5cGUiOiJPcmlnaW5hbCIsImltYWdlU3ByaXRlRGVmaW5pdGlvbiI6MTAsInJhd0FkYXB0aXZlRGVmaW5pdGlvbiI6MTB9LCJjdXJyZW50VGltZVN0YW1wIjoxNjg5NzUwMTYwLCJleHBpcmVUaW1lU3RhbXAiOjE2ODk4MzY1NjAsImZpbGVJZCI6IjMyNzA4MzUwMTA3OTkxNDcyNzQiLCJ1cmxBY2Nlc3NJbmZvIjp7InQiOiI2NGI4ZGMxMCJ9fQ.cjNK5v1Hlhy10UTvDcnZwTCeSTOliNIsx4nizlCNRtg',
56
-
57
- fileID: '243791576943072647',
58
- appID: '1306264703',
59
- psign: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6MTMwNjI2NDcwMywiZmlsZUlkIjoiMjQzNzkxNTc2OTQzMDcyNjQ3IiwiY3VycmVudFRpbWVTdGFtcCI6MTY3MDQ2OTk3MSwiY29udGVudEluZm8iOnsiYXVkaW9WaWRlb1R5cGUiOiJQcm90ZWN0ZWRBZGFwdGl2ZSIsImRybUFkYXB0aXZlSW5mbyI6eyJwcml2YXRlRW5jcnlwdGlvbkRlZmluaXRpb24iOjEyfX0sInVybEFjY2Vzc0luZm8iOnsiZG9tYWluIjoiMTMwNjI2NDcwMy52b2QyLm15cWNsb3VkLmNvbSIsInNjaGVtZSI6IkhUVFBTIn19.FOcmChHfrGY9tYCDn20MSQi-IqvQ9U_U6qLNgx9MhLg',
60
-
61
- hlsConfig: {
62
- skip: true,
63
- },
64
-
65
- //其他参数请在开发文档中查看
66
- plugins: {
67
- ContinuePlay: {
68
- // auto: true // 是否在播放时自动续播
69
- },
70
- ProgressMarker: true,
71
- ContextMenu: {
72
- statistic: true,
73
- levelSwitch: {
74
- open: true, // 打开切换提示
75
- // switchingText: '开始', // 开始切换时文案
76
- // switchedText: '成功', // 切换成功时文案
77
- // switchErrorText: '失败', // 切换失败时文案
78
- }
79
- }
80
- }
81
- });
82
-
83
- const IS_ENABLED_MSE = (function () {
84
- var mediaSource = window.MediaSource = window.MediaSource || window.WebKitMediaSource;
85
- var sourceBuffer = window.SourceBuffer = window.SourceBuffer || window.WebKitSourceBuffer;
86
- var isTypeSupported = mediaSource && typeof mediaSource.isTypeSupported === 'function' && mediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
87
- // if SourceBuffer is exposed ensure its API is valid
88
- // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible
89
- var sourceBufferValidAPI = !sourceBuffer || sourceBuffer.prototype && typeof sourceBuffer.prototype.appendBuffer === 'function' && typeof sourceBuffer.prototype.remove === 'function';
90
- // ios13 部分开放了MSE 但支持不完整,hlsjs flvjs播放仍有问题
91
- // if (IS_IOS){
92
- // return undefined;
93
- // }
94
- return isTypeSupported && sourceBufferValidAPI;
95
- })();
96
-
97
- // alert('是否支持MSE:' + IS_ENABLED_MSE);
98
- // alert(navigator.userAgent);
99
-
100
-
101
-
102
- // player.src('webrtc://global-lebtest-play.myqcloud.com/live/lebtest?txSecret=f22a813b284137ed10d3259a7b5c224b&txTime=69f1eb8c');
103
- // player.src('https://global-lebtest-play.myqcloud.com/live/lebtest.flv');
104
-
105
- </script>
106
- </body>
107
- </html>