trtc-cloud-js-sdk 1.0.13 → 2.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/.eslintrc.js +88 -0
- package/.prettierrc +5 -0
- package/CHANGELOG.md +58 -0
- package/build/jsdoc/clean-doc.js +12 -0
- package/build/jsdoc/fix-doc.js +141 -0
- package/build/jsdoc/jsdoc.json +42 -0
- package/build/package-bundle.js +29 -0
- package/build/rollup.config.dev.js +88 -0
- package/build/rollup.config.prod.js +93 -0
- package/build/rollup.js +359 -0
- package/build/template/npm-package/package.json +24 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/base.css +213 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/index.html +80 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/prettify.css +1 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/prettify.js +1 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/sort-arrow-sprite.png +0 -0
- package/coverage/Chrome 103.0.5060 (Mac OS X 10.15.7)/sorter.js +158 -0
- package/examples/apiExample/.env +2 -0
- package/examples/apiExample/README.md +70 -0
- package/examples/apiExample/package-lock.json +30915 -0
- package/examples/apiExample/package.json +51 -0
- package/examples/apiExample/public/audio.js +195 -0
- package/examples/apiExample/public/audio.js.map +7 -0
- package/examples/apiExample/public/av_processing.js +1 -0
- package/examples/apiExample/public/basic/av_processing.wasm +0 -0
- package/examples/apiExample/public/basic/worker.js +10434 -0
- package/examples/apiExample/public/favicon.ico +0 -0
- package/examples/apiExample/public/index.html +47 -0
- package/examples/apiExample/public/logo192.png +0 -0
- package/examples/apiExample/public/logo512.png +0 -0
- package/examples/apiExample/public/manifest.json +25 -0
- package/examples/apiExample/public/robots.txt +3 -0
- package/examples/apiExample/src/App.css +37 -0
- package/examples/apiExample/src/App.js +25 -0
- package/examples/apiExample/src/api/http.js +127 -0
- package/examples/apiExample/src/api/nav.js +44 -0
- package/examples/apiExample/src/components/BasicInfoComponent.css +16 -0
- package/examples/apiExample/src/components/BasicInfoComponent.js +27 -0
- package/examples/apiExample/src/config/gen-test-user-sig.js +64 -0
- package/examples/apiExample/src/config/lib-generate-test-usersig.min.js +7052 -0
- package/examples/apiExample/src/config/nav.js +136 -0
- package/examples/apiExample/src/home.js +16 -0
- package/examples/apiExample/src/index.css +21 -0
- package/examples/apiExample/src/index.js +12 -0
- package/examples/apiExample/src/logo.svg +1 -0
- package/examples/apiExample/src/page/basic/screen-share/index.css +52 -0
- package/examples/apiExample/src/page/basic/screen-share/index.js +223 -0
- package/examples/apiExample/src/page/basic/setDevice/index.js +262 -0
- package/examples/apiExample/src/page/basic/setDevice/index.scss +93 -0
- package/examples/apiExample/src/page/basic/video-call/index.js +521 -0
- package/examples/apiExample/src/page/basic/video-call/index.scss +93 -0
- package/examples/apiExample/src/page/basic/video-call-init/index.js +382 -0
- package/examples/apiExample/src/page/basic/video-call-init/index.scss +93 -0
- package/examples/apiExample/src/page/basic/video-live/index.css +37 -0
- package/examples/apiExample/src/page/basic/video-live/index.js +188 -0
- package/examples/apiExample/src/page/layout.js +22 -0
- package/examples/apiExample/src/page/layout.scss +76 -0
- package/examples/apiExample/src/utils/utils.js +35 -0
- package/examples/jsExample/assets/css/bootstrap-material-design.css +12169 -0
- package/examples/jsExample/assets/css/bootstrap-material-design.min.css +8 -0
- package/examples/jsExample/assets/css/common.css +48 -0
- package/examples/jsExample/assets/icon/iconfont.js +1 -0
- package/examples/jsExample/assets/js/bootstrap-material-design.js +6939 -0
- package/examples/jsExample/assets/js/bootstrap-material-design.js.map +1 -0
- package/examples/jsExample/assets/js/bootstrap-material-design.min.js +1 -0
- package/examples/jsExample/assets/js/graph.js +695 -0
- package/examples/jsExample/assets/js/jquery-3.2.1.min.js +4 -0
- package/examples/jsExample/assets/js/jquery-3.2.1.slim.min.js +4 -0
- package/examples/jsExample/assets/js/lib-generate-test-usersig.min.js +2 -0
- package/examples/jsExample/assets/js/popper.js +2442 -0
- package/examples/jsExample/index.html +57 -0
- package/examples/jsExample/rtc/css/common.css +82 -0
- package/examples/jsExample/rtc/index.html +107 -0
- package/examples/jsExample/rtc/js/index.js +142 -0
- package/examples/vueDemo/LICENSE +21 -0
- package/examples/vueDemo/README.md +144 -0
- package/examples/vueDemo/README_EN.md +136 -0
- package/examples/vueDemo/av_processing.wasm +0 -0
- package/examples/vueDemo/index.html +23 -0
- package/examples/vueDemo/package-lock.json +1375 -0
- package/examples/vueDemo/package.json +36 -0
- package/examples/vueDemo/src/App.vue +12 -0
- package/examples/vueDemo/src/api/index.js +59 -0
- package/examples/vueDemo/src/assets/css/color-dark.css +28 -0
- package/examples/vueDemo/src/assets/css/icon.css +4 -0
- package/examples/vueDemo/src/assets/css/main.css +177 -0
- package/examples/vueDemo/src/assets/img/img.jpg +0 -0
- package/examples/vueDemo/src/assets/img/login-bg.jpg +0 -0
- package/examples/vueDemo/src/components/Header.vue +172 -0
- package/examples/vueDemo/src/components/Sidebar.vue +117 -0
- package/examples/vueDemo/src/components/Tags.vue +174 -0
- package/examples/vueDemo/src/components/tendency.vue +206 -0
- package/examples/vueDemo/src/components/trtc/main-menu.vue +50 -0
- package/examples/vueDemo/src/components/trtc/nav-bar.vue +53 -0
- package/examples/vueDemo/src/components/trtc/show-screen-capture.vue +118 -0
- package/examples/vueDemo/src/components/trtc/trtc-state-check.vue +117 -0
- package/examples/vueDemo/src/config/gen-test-user-sig.js +67 -0
- package/examples/vueDemo/src/config/lib-generate-test-usersig.min.js +7052 -0
- package/examples/vueDemo/src/main.js +11 -0
- package/examples/vueDemo/src/plugins/element.js +17 -0
- package/examples/vueDemo/src/router/index.js +73 -0
- package/examples/vueDemo/src/store/sidebar.js +17 -0
- package/examples/vueDemo/src/store/tags.js +48 -0
- package/examples/vueDemo/src/utils/i18n.js +24 -0
- package/examples/vueDemo/src/utils/request.js +34 -0
- package/examples/vueDemo/src/utils/utils.js +35 -0
- package/examples/vueDemo/src/views/Home.vue +46 -0
- package/examples/vueDemo/src/views/I18n.vue +40 -0
- package/examples/vueDemo/src/views/Icon.vue +229 -0
- package/examples/vueDemo/src/views/basic/trtc.vue +194 -0
- package/examples/vueDemo/src/views/feature/index.vue +259 -0
- package/examples/vueDemo/src/views/github/index.vue +243 -0
- package/examples/vueDemo/src/views/improve/live-index.vue +256 -0
- package/examples/vueDemo/src/views/improve/live-room-anchor.vue +689 -0
- package/examples/vueDemo/src/views/improve/live-room-audience.vue +383 -0
- package/examples/vueDemo/src/views/sdkAppId/index.vue +284 -0
- package/examples/vueDemo/vite.config.js +18 -0
- package/examples/vueDemo/worker.js +22 -0
- package/karma.conf.js +99 -0
- package/package.json +57 -7
- package/scripts/publish.js +86 -0
- package/src/Camera.ts +80 -0
- package/src/Mic.ts +145 -0
- package/src/common/IError.ts +6 -0
- package/src/common/ITRTCCloud.ts +68 -0
- package/src/common/constants.ts +116 -0
- package/src/common/trtc-code.ts +43 -0
- package/src/common/trtc-define.ts +1007 -0
- package/src/common/trtc-event.ts +29 -0
- package/src/index.ts +1672 -0
- package/src/utils/environment.js +297 -0
- package/src/utils/raf.js +131 -0
- package/src/utils/time.js +22 -0
- package/src/utils/utils.ts +71 -0
- package/src/utils/uuid.js +12 -0
- package/test/unit/env.test.js +25 -0
- package/test/unit/get-user-media.test.js +40 -0
- package/test/unit/ice-parser.test.js +23 -0
- package/test/unit/sdp.test.js +45 -0
- package/test/unit/signal.test.js +78 -0
- package/tsconfig.json +32 -0
- package/trtc-cloud-js-sdk.js +0 -1
- /package/{README.md → build/template/npm-package/README.md} +0 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tags" v-if="tags.show">
|
|
3
|
+
<ul>
|
|
4
|
+
<li class="tags-li" v-for="(item,index) in tags.list" :class="{'active': isActive(item.path)}" :key="index">
|
|
5
|
+
<router-link :to="item.path" class="tags-li-title">{{item.title}}</router-link>
|
|
6
|
+
<span class="tags-li-icon" @click="closeTags(index)">
|
|
7
|
+
<i class="el-icon-close"></i>
|
|
8
|
+
</span>
|
|
9
|
+
</li>
|
|
10
|
+
</ul>
|
|
11
|
+
<div class="tags-close-box">
|
|
12
|
+
<el-dropdown @command="handleTags">
|
|
13
|
+
<el-button size="mini" type="primary">
|
|
14
|
+
标签选项
|
|
15
|
+
<i class="el-icon-arrow-down el-icon--right"></i>
|
|
16
|
+
</el-button>
|
|
17
|
+
<template #dropdown>
|
|
18
|
+
<el-dropdown-menu size="small">
|
|
19
|
+
<el-dropdown-item command="other">关闭其他</el-dropdown-item>
|
|
20
|
+
<el-dropdown-item command="all">关闭所有</el-dropdown-item>
|
|
21
|
+
</el-dropdown-menu>
|
|
22
|
+
</template>
|
|
23
|
+
</el-dropdown>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import { useTagsStore } from '../store/tags'
|
|
30
|
+
import { onBeforeRouteUpdate, useRoute, useRouter } from "vue-router";
|
|
31
|
+
export default {
|
|
32
|
+
setup() {
|
|
33
|
+
const route = useRoute();
|
|
34
|
+
const router = useRouter();
|
|
35
|
+
const isActive = (path) => {
|
|
36
|
+
return path === route.fullPath;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const tags = useTagsStore();
|
|
40
|
+
// 关闭单个标签
|
|
41
|
+
const closeTags = (index) => {
|
|
42
|
+
const delItem = tags.list[index];
|
|
43
|
+
tags.delTagsItem(index);
|
|
44
|
+
const item = tags.list[index] ? tags.list[index] : tags.list[index - 1];
|
|
45
|
+
if (item) {
|
|
46
|
+
delItem.path === route.fullPath && router.push(item.path);
|
|
47
|
+
} else {
|
|
48
|
+
router.push("/");
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// 设置标签
|
|
53
|
+
const setTags = (route) => {
|
|
54
|
+
const isExist = tags.list.some((item) => {
|
|
55
|
+
return item.path === route.fullPath;
|
|
56
|
+
});
|
|
57
|
+
if (!isExist) {
|
|
58
|
+
if (tags.list.length >= 8) tags.delTagsItem(0);
|
|
59
|
+
tags.setTagsItem({
|
|
60
|
+
name: route.name,
|
|
61
|
+
title: route.meta.title,
|
|
62
|
+
path: route.fullPath,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
setTags(route);
|
|
67
|
+
onBeforeRouteUpdate((to) => {
|
|
68
|
+
setTags(to);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// 关闭全部标签
|
|
72
|
+
const closeAll = () => {
|
|
73
|
+
tags.clearTags();
|
|
74
|
+
router.push("/");
|
|
75
|
+
};
|
|
76
|
+
// 关闭其他标签
|
|
77
|
+
const closeOther = () => {
|
|
78
|
+
const curItem = tags.list.filter((item) => {
|
|
79
|
+
return item.path === route.fullPath;
|
|
80
|
+
});
|
|
81
|
+
tags.closeTagsOther(curItem);
|
|
82
|
+
};
|
|
83
|
+
const handleTags = (command) => {
|
|
84
|
+
command === "other" ? closeOther() : closeAll();
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// 关闭当前页面的标签页
|
|
88
|
+
// tags.closeCurrentTag({
|
|
89
|
+
// $router: router,
|
|
90
|
+
// $route: route
|
|
91
|
+
// });
|
|
92
|
+
|
|
93
|
+
return {
|
|
94
|
+
isActive,
|
|
95
|
+
tags,
|
|
96
|
+
closeTags,
|
|
97
|
+
handleTags,
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<style>
|
|
105
|
+
.tags {
|
|
106
|
+
position: relative;
|
|
107
|
+
height: 30px;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
background: #fff;
|
|
110
|
+
padding-right: 120px;
|
|
111
|
+
box-shadow: 0 5px 10px #ddd;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.tags ul {
|
|
115
|
+
box-sizing: border-box;
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.tags-li {
|
|
121
|
+
float: left;
|
|
122
|
+
margin: 3px 5px 2px 3px;
|
|
123
|
+
border-radius: 3px;
|
|
124
|
+
font-size: 12px;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
height: 23px;
|
|
128
|
+
line-height: 23px;
|
|
129
|
+
border: 1px solid #e9eaec;
|
|
130
|
+
background: #fff;
|
|
131
|
+
padding: 0 5px 0 12px;
|
|
132
|
+
vertical-align: middle;
|
|
133
|
+
color: #666;
|
|
134
|
+
-webkit-transition: all 0.3s ease-in;
|
|
135
|
+
-moz-transition: all 0.3s ease-in;
|
|
136
|
+
transition: all 0.3s ease-in;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.tags-li:not(.active):hover {
|
|
140
|
+
background: #f8f8f8;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.tags-li.active {
|
|
144
|
+
color: #fff;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.tags-li-title {
|
|
148
|
+
float: left;
|
|
149
|
+
max-width: 80px;
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
white-space: nowrap;
|
|
152
|
+
text-overflow: ellipsis;
|
|
153
|
+
margin-right: 5px;
|
|
154
|
+
color: #666;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.tags-li.active .tags-li-title {
|
|
158
|
+
color: #fff;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.tags-close-box {
|
|
162
|
+
position: absolute;
|
|
163
|
+
right: 0;
|
|
164
|
+
top: 0;
|
|
165
|
+
box-sizing: border-box;
|
|
166
|
+
padding-top: 1px;
|
|
167
|
+
text-align: center;
|
|
168
|
+
width: 110px;
|
|
169
|
+
height: 30px;
|
|
170
|
+
background: #fff;
|
|
171
|
+
box-shadow: -3px 0 15px 3px rgba(0, 0, 0, 0.1);
|
|
172
|
+
z-index: 10;
|
|
173
|
+
}
|
|
174
|
+
</style>
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="line1">
|
|
3
|
+
<div :id="domId" class="" style="width: 90%;height:450px;"></div>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import * as echarts from 'echarts/lib/echarts';
|
|
9
|
+
// 引入柱状图
|
|
10
|
+
import 'echarts/lib/chart/bar';
|
|
11
|
+
import 'echarts/lib/chart/line';
|
|
12
|
+
import 'echarts/lib/component/title';
|
|
13
|
+
import 'echarts/lib/component/legend';
|
|
14
|
+
import 'echarts/lib/component/toolbox';
|
|
15
|
+
import 'echarts/lib/component/markPoint';
|
|
16
|
+
import 'echarts/lib/component/tooltip';
|
|
17
|
+
import 'echarts/lib/component/grid';
|
|
18
|
+
export default {
|
|
19
|
+
mounted() {
|
|
20
|
+
this.myChart = echarts.init(document.getElementById(this.domId));
|
|
21
|
+
this.initData();
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
sevenDate: {
|
|
25
|
+
type: Array,
|
|
26
|
+
default: [],
|
|
27
|
+
},
|
|
28
|
+
sevenDay: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: [],
|
|
31
|
+
},
|
|
32
|
+
title: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: '标题',
|
|
35
|
+
},
|
|
36
|
+
legend: {
|
|
37
|
+
type: Array,
|
|
38
|
+
default: [],
|
|
39
|
+
},
|
|
40
|
+
loading: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
domId: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: 'line1'
|
|
47
|
+
},
|
|
48
|
+
graphType: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'line',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
methods: {
|
|
54
|
+
initData() {
|
|
55
|
+
const colors = ['#5793f3', '#675bba', '#d14a61'];
|
|
56
|
+
const option = {
|
|
57
|
+
color: colors,
|
|
58
|
+
title: {
|
|
59
|
+
text: this.title,
|
|
60
|
+
subtext: ''
|
|
61
|
+
},
|
|
62
|
+
tooltip: {
|
|
63
|
+
trigger: 'axis'
|
|
64
|
+
},
|
|
65
|
+
legend: {
|
|
66
|
+
// orient: 'vertical',
|
|
67
|
+
x: 'center',
|
|
68
|
+
y: 'bottom',
|
|
69
|
+
padding: [50, 50, 0, 0],
|
|
70
|
+
data: this.legend,
|
|
71
|
+
},
|
|
72
|
+
toolbox: {
|
|
73
|
+
show: this.graphType !== 'bar' ? true : false,
|
|
74
|
+
feature: {
|
|
75
|
+
dataZoom: {
|
|
76
|
+
yAxisIndex: 'none'
|
|
77
|
+
},
|
|
78
|
+
dataView: { readOnly: false },
|
|
79
|
+
magicType: { type: ['bar', 'line'] },
|
|
80
|
+
restore: {},
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
xAxis: {
|
|
84
|
+
type: 'category',
|
|
85
|
+
boundaryGap: false,
|
|
86
|
+
data: this.sevenDay
|
|
87
|
+
},
|
|
88
|
+
yAxis: [
|
|
89
|
+
{
|
|
90
|
+
type: 'value',
|
|
91
|
+
// name: '用户',
|
|
92
|
+
min: 0,
|
|
93
|
+
// max: 200,
|
|
94
|
+
position: 'left',
|
|
95
|
+
axisLine: {
|
|
96
|
+
lineStyle: {
|
|
97
|
+
color: '#999'
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
axisLabel: {
|
|
101
|
+
formatter: '{value}'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: 'value',
|
|
106
|
+
// name: '订单',
|
|
107
|
+
min: 0,
|
|
108
|
+
// max: 200,
|
|
109
|
+
position: 'right',
|
|
110
|
+
axisLine: {
|
|
111
|
+
lineStyle: {
|
|
112
|
+
color: '#999'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
axisLabel: {
|
|
116
|
+
formatter: '{value}'
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
series: this.sevenDate.slice(0, 6).map((arr, index) => {
|
|
121
|
+
return {
|
|
122
|
+
name: this.legend[index],
|
|
123
|
+
type: this.graphType,
|
|
124
|
+
data: arr,
|
|
125
|
+
smooth: true, // true 为平滑曲线; false 为直线
|
|
126
|
+
yAxisIndex: 1,
|
|
127
|
+
markPoint: {
|
|
128
|
+
data: this.sevenDate.length > 1 ? [] : [
|
|
129
|
+
{ type: 'max', name: '最大值' },
|
|
130
|
+
{ type: 'min', name: '最小值' }
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}),
|
|
135
|
+
// series: [
|
|
136
|
+
// {
|
|
137
|
+
// name: '新注册用户',
|
|
138
|
+
// type: 'line',
|
|
139
|
+
// data: this.sevenDate[0],
|
|
140
|
+
// yAxisIndex: 1,
|
|
141
|
+
// markPoint: {
|
|
142
|
+
// data: [
|
|
143
|
+
// { type: 'max', name: '最大值' },
|
|
144
|
+
// { type: 'min', name: '最小值' }
|
|
145
|
+
// ]
|
|
146
|
+
// },
|
|
147
|
+
// },
|
|
148
|
+
// {
|
|
149
|
+
// name: '新增订单',
|
|
150
|
+
// type: 'line',
|
|
151
|
+
// data: this.sevenDate[1],
|
|
152
|
+
// yAxisIndex: 1,
|
|
153
|
+
// markPoint: {
|
|
154
|
+
// data: [
|
|
155
|
+
// { type: 'max', name: '最大值' },
|
|
156
|
+
// { type: 'min', name: '最小值' }
|
|
157
|
+
// ]
|
|
158
|
+
// },
|
|
159
|
+
// },
|
|
160
|
+
// {
|
|
161
|
+
// name: '新增管理员',
|
|
162
|
+
// type: 'line',
|
|
163
|
+
// data: this.sevenDate[2],
|
|
164
|
+
// yAxisIndex: 1,
|
|
165
|
+
// markPoint: {
|
|
166
|
+
// data: [
|
|
167
|
+
// { type: 'max', name: '最大值' },
|
|
168
|
+
// { type: 'min', name: '最小值' }
|
|
169
|
+
// ]
|
|
170
|
+
// },
|
|
171
|
+
// }
|
|
172
|
+
// ]
|
|
173
|
+
};
|
|
174
|
+
this.myChart.clear();
|
|
175
|
+
this.myChart.setOption(option);
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
watch: {
|
|
179
|
+
sevenDate: function () {
|
|
180
|
+
this.initData()
|
|
181
|
+
},
|
|
182
|
+
sevenDay: function () {
|
|
183
|
+
this.initData()
|
|
184
|
+
},
|
|
185
|
+
loading: function (isShowLoading) {
|
|
186
|
+
if (isShowLoading) {
|
|
187
|
+
this.myChart.showLoading({
|
|
188
|
+
title: '加载中',
|
|
189
|
+
mask: true,
|
|
190
|
+
});
|
|
191
|
+
} else {
|
|
192
|
+
this.myChart.hideLoading();
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
</script>
|
|
198
|
+
|
|
199
|
+
<style lang="less">
|
|
200
|
+
// @import '../style/mixin';
|
|
201
|
+
|
|
202
|
+
.line1 {
|
|
203
|
+
display: flex;
|
|
204
|
+
justify-content: center;
|
|
205
|
+
}
|
|
206
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template name="main-menu">
|
|
2
|
+
|
|
3
|
+
<div class="main-menu">
|
|
4
|
+
<ul>
|
|
5
|
+
<li> <router-link to="/trtc-index" > RTC </router-link> </li>
|
|
6
|
+
<li> <router-link to="/live-index/anchor" > LIVE </router-link> </li>
|
|
7
|
+
</ul>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: "main-menu",
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style scoped>
|
|
18
|
+
.main-menu{
|
|
19
|
+
font-size: 2em;
|
|
20
|
+
}
|
|
21
|
+
.main-menu>ul {
|
|
22
|
+
display: block;
|
|
23
|
+
list-style: none;
|
|
24
|
+
margin: 30vh auto 5vh auto;
|
|
25
|
+
width: 50%;
|
|
26
|
+
padding: 0;
|
|
27
|
+
}
|
|
28
|
+
.main-menu>ul>li {
|
|
29
|
+
margin: 2px 5px;
|
|
30
|
+
height: 2em;
|
|
31
|
+
line-height: 2em;
|
|
32
|
+
text-align: center;
|
|
33
|
+
}
|
|
34
|
+
.main-menu>ul>li>a {
|
|
35
|
+
color: #fff;
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
display: block;
|
|
38
|
+
border-radius: 5px;
|
|
39
|
+
height: 2em;
|
|
40
|
+
line-height: 2em;
|
|
41
|
+
margin: 1em;
|
|
42
|
+
background-color: #007bff;
|
|
43
|
+
}
|
|
44
|
+
.main-menu>ul>li>a:hover {
|
|
45
|
+
background-color: #0069d9;
|
|
46
|
+
}
|
|
47
|
+
</style>
|
|
48
|
+
<style>
|
|
49
|
+
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="back-href-container">
|
|
3
|
+
<div class="back-button">
|
|
4
|
+
<router-link :to="href" v-if="href">
|
|
5
|
+
<b-icon-chevron-left color="white"></b-icon-chevron-left>
|
|
6
|
+
</router-link>
|
|
7
|
+
</div>
|
|
8
|
+
<h3 class="title" v-if="title">{{title}}</h3>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
props: {
|
|
18
|
+
href: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: false
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
</script>
|
|
30
|
+
<style scoped>
|
|
31
|
+
.back-href-container {
|
|
32
|
+
height: 5vh;
|
|
33
|
+
line-height: 5vh;
|
|
34
|
+
background-color: rgba(0,0,0, 0.5);
|
|
35
|
+
}
|
|
36
|
+
.back-button {
|
|
37
|
+
display: inline-block;
|
|
38
|
+
width: 5vw;
|
|
39
|
+
text-align: center;
|
|
40
|
+
font-size: 3vh;
|
|
41
|
+
}
|
|
42
|
+
.title {
|
|
43
|
+
display: inline-block;
|
|
44
|
+
margin: 0px;
|
|
45
|
+
padding: 0px;
|
|
46
|
+
top: 1vh;
|
|
47
|
+
left: 0;
|
|
48
|
+
text-align: center;
|
|
49
|
+
color: #fff;
|
|
50
|
+
width: 90vw;
|
|
51
|
+
font-size: 2vh;
|
|
52
|
+
}
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="screens-list">
|
|
3
|
+
<div class="loading-animation" v-if="list.length===0">
|
|
4
|
+
<b-icon icon="arrow-clockwise" animation="spin" font-scale="2" ></b-icon>
|
|
5
|
+
</div>
|
|
6
|
+
<div v-for="item in list" :key="item.sourceId" :label="item.sourceName" class="screen-info"
|
|
7
|
+
v-bind:data-id="item.sourceId"
|
|
8
|
+
v-bind:data-name="item.sourceName"
|
|
9
|
+
v-bind:data-type="item.type"
|
|
10
|
+
@click="onChoose">
|
|
11
|
+
<canvas :id="['screen_'+item.sourceId]" @onload="onCanvasLoaded"></canvas>
|
|
12
|
+
<p>
|
|
13
|
+
<b-button variant="link"> {{item.sourceName.length > 20 ? item.sourceName.slice(0,20)+'...' : item.sourceName }} </b-button>
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import Log from '../common/log';
|
|
21
|
+
let logger = new Log('ShowScreenCapture');
|
|
22
|
+
export default {
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
props: {
|
|
30
|
+
list: {
|
|
31
|
+
type: Array,
|
|
32
|
+
required: true
|
|
33
|
+
},
|
|
34
|
+
onClick : {
|
|
35
|
+
type: Function,
|
|
36
|
+
required: true
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
methods: {
|
|
41
|
+
|
|
42
|
+
onChoose (event) {
|
|
43
|
+
try {
|
|
44
|
+
this.onClick(event);
|
|
45
|
+
} catch(err) {
|
|
46
|
+
logger.log('onChoose error:', err);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
onCanvasLoaded(event) {
|
|
51
|
+
logger.log('onCanvasLoaded:', event);
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
renderScreensList() {
|
|
55
|
+
if (this.list.length === 0) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
let {list} = this;
|
|
59
|
+
let srcInfos = null;
|
|
60
|
+
let elId = '';
|
|
61
|
+
let cnvs = null;
|
|
62
|
+
let imgData = null;
|
|
63
|
+
|
|
64
|
+
for (let i = 0; i < list.length; i++) {
|
|
65
|
+
srcInfos = list[i];
|
|
66
|
+
if (srcInfos.thumbBGRA.length===0) continue;
|
|
67
|
+
elId = `screen_${srcInfos.sourceId}`;
|
|
68
|
+
cnvs = document.getElementById(elId);
|
|
69
|
+
cnvs.width = srcInfos.thumbBGRA.width;
|
|
70
|
+
cnvs.height = srcInfos.thumbBGRA.height;
|
|
71
|
+
imgData = new ImageData(new Uint8ClampedArray(srcInfos.thumbBGRA.buffer), srcInfos.thumbBGRA.width, srcInfos.thumbBGRA.height );
|
|
72
|
+
cnvs.getContext("2d").putImageData(imgData, 0, 0);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
mounted() {
|
|
78
|
+
setTimeout(()=>{
|
|
79
|
+
this.renderScreensList.bind(this)();
|
|
80
|
+
}, 0);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style scoped>
|
|
88
|
+
#screens-list {
|
|
89
|
+
text-align: center;
|
|
90
|
+
align-content: center;
|
|
91
|
+
height:70vh;
|
|
92
|
+
overflow:auto;
|
|
93
|
+
}
|
|
94
|
+
.loading-animation {
|
|
95
|
+
width:100vw;
|
|
96
|
+
height: auto;
|
|
97
|
+
text-align: center;
|
|
98
|
+
}
|
|
99
|
+
.screen-info {
|
|
100
|
+
display: inline-block;
|
|
101
|
+
text-align: center;
|
|
102
|
+
margin: 10px;
|
|
103
|
+
background-color: #fafafa;
|
|
104
|
+
}
|
|
105
|
+
.screen-info>p{
|
|
106
|
+
margin: 0;
|
|
107
|
+
}
|
|
108
|
+
.screen-info>canvas{
|
|
109
|
+
margin: 0;
|
|
110
|
+
}
|
|
111
|
+
.screen-info:hover {
|
|
112
|
+
background-color: #f2f2f2;
|
|
113
|
+
box-shadow: #333 0 0 10px;
|
|
114
|
+
}
|
|
115
|
+
.screen-info {
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
}
|
|
118
|
+
</style>
|