@shijiu/jsview-vue 0.9.602 → 0.9.631
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/dom/bin/jsview-browser-debug-dom.min.js +1 -1
- package/dom/bin/jsview-dom.min.js +1 -1
- package/dom/target_core_revision.js +4 -4
- package/package.json +1 -1
- package/samples/Basic/components/text/TextOverflow.vue +2 -2
- package/samples/Collision/App.vue +452 -0
- package/samples/DemoHomepage/components/BodyFrame.vue +2 -0
- package/samples/DemoHomepage/router.js +20 -0
- package/samples/DemoHomepage/views/Homepage.vue +3 -10
- package/samples/ImpactStop/App.vue +435 -0
- package/samples/Input/App.vue +8 -17
- package/samples/Input/InputPanel.vue +18 -11
- package/samples/MetroWidgetDemos/PingPong/App.vue +3 -3
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +17 -2
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +3 -10
- package/samples/MetroWidgetDemos/PingPong/{Item.vue → TabItem.vue} +2 -10
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +2 -2
- package/samples/Preload/App.vue +16 -11
- package/samples/TextureAnimation/App2.vue +111 -0
- package/samples/TextureAnimation/assets/blackWhiteGrid.png +0 -0
- package/samples/TextureAnimation/assets/light.png +0 -0
- package/samples/TextureAnimation/assets/light2.png +0 -0
- package/samples/TextureAnimation/assets/mask.png +0 -0
- package/samples/VisibleSensorDemo/App.vue +92 -25
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +36 -2
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +17 -2
- package/utils/JsViewPlugin/JsvPlayer/index.js +8 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +4 -4
- package/utils/JsViewVueTools/JsvImpactTracer.js +113 -0
- package/utils/JsViewVueTools/index.js +2 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserPreload.vue +11 -1
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +203 -14
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +2 -2
- package/utils/JsViewVueWidget/JsvInput/Cursor.vue +4 -2
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +13 -12
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +37 -41
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +282 -285
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +123 -46
- package/utils/JsViewVueWidget/JsvTextureAnim/index.js +9 -5
- package/utils/JsViewVueWidget/JsvVideo.vue +9 -12
- package/utils/JsViewVueWidget/index.js +2 -2
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2022-07-12 10:30:33
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-09-01 17:05:07
|
|
6
6
|
* @Description: file content
|
|
7
7
|
-->
|
|
8
8
|
<script>
|
|
9
9
|
import AppPage from "./AppPage.vue";
|
|
10
10
|
import { getKeyFramesGroup } from "jsview";
|
|
11
|
-
import { reactive } from "vue";
|
|
11
|
+
import { reactive, ref } from "vue";
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
components: {
|
package/samples/Preload/App.vue
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
JsvPreload,
|
|
6
6
|
buildPreloadInfo,
|
|
7
7
|
buildDownloadInfo,
|
|
8
|
+
useFocusHub,
|
|
8
9
|
} from "jsview";
|
|
9
10
|
import awesome from "./images/awesomeface.png";
|
|
10
11
|
import cat from "./images/cat.jpg";
|
|
@@ -14,11 +15,11 @@ import { ref } from "vue";
|
|
|
14
15
|
import { useRouter } from "vue-router";
|
|
15
16
|
|
|
16
17
|
const name = "/preload";
|
|
18
|
+
const focusHub = useFocusHub();
|
|
17
19
|
const text = ref("");
|
|
18
|
-
let
|
|
19
|
-
let
|
|
20
|
+
let preloadInfo = [];
|
|
21
|
+
let downloadInfo = [];
|
|
20
22
|
const router = useRouter();
|
|
21
|
-
let focusNode = ref(null);
|
|
22
23
|
|
|
23
24
|
const _onPreloading = (percent) => {
|
|
24
25
|
console.log("preloading ", percent);
|
|
@@ -28,9 +29,9 @@ const _onPreloadDone = (imageInfo) => {
|
|
|
28
29
|
console.log("PRELOAD DONE!", imageInfo);
|
|
29
30
|
};
|
|
30
31
|
|
|
31
|
-
const _onDownloadDone = () => {
|
|
32
|
-
console.log("DOWNLOAD DONE!");
|
|
33
|
-
|
|
32
|
+
const _onDownloadDone = (urls, extra) => {
|
|
33
|
+
console.log("DOWNLOAD DONE!", urls, extra);
|
|
34
|
+
text.value = `图片下载完成\n${awesome}\n${cat}`;
|
|
34
35
|
};
|
|
35
36
|
|
|
36
37
|
const _measures = () => {
|
|
@@ -43,13 +44,13 @@ const _measures = () => {
|
|
|
43
44
|
|
|
44
45
|
const _onKeyDown = (ev) => {
|
|
45
46
|
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
46
|
-
router
|
|
47
|
+
router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
47
48
|
}
|
|
48
49
|
return true;
|
|
49
50
|
};
|
|
50
51
|
|
|
51
52
|
const _onFocus = () => {
|
|
52
|
-
|
|
53
|
+
focusHub.setFocus(name);
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
for (const item of data) {
|
|
@@ -58,16 +59,20 @@ for (const item of data) {
|
|
|
58
59
|
}
|
|
59
60
|
preloadInfo.push(null); // 测试item为null的加载
|
|
60
61
|
downloadInfo = [
|
|
61
|
-
buildDownloadInfo(awesome),
|
|
62
|
-
buildDownloadInfo(cat),
|
|
62
|
+
buildDownloadInfo(awesome, null, true),
|
|
63
|
+
buildDownloadInfo(cat, null, true),
|
|
63
64
|
buildDownloadInfo(null), // 测试URL为null的加载
|
|
64
65
|
];
|
|
65
66
|
</script>
|
|
66
67
|
|
|
67
68
|
<template>
|
|
68
69
|
<jsv-focus-block
|
|
69
|
-
ref="focusNode"
|
|
70
70
|
autoFocus
|
|
71
|
+
:style="{
|
|
72
|
+
width: 1920,
|
|
73
|
+
height: 1080,
|
|
74
|
+
backgroundColor: '#FFFFFF',
|
|
75
|
+
}"
|
|
71
76
|
:onAction="{
|
|
72
77
|
onKeyDown: _onKeyDown,
|
|
73
78
|
onFocus: _onFocus,
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, reactive } from "vue";
|
|
3
|
+
import { useRouter } from "vue-router";
|
|
4
|
+
import {
|
|
5
|
+
jJsvRuntimeBridge,
|
|
6
|
+
getKeyFramesGroup,
|
|
7
|
+
JsvTextureAnim,
|
|
8
|
+
TexAlignAnchor,
|
|
9
|
+
DECORATE_NINEPATCH_ALPHA_MIX,
|
|
10
|
+
DECORATE_BORDER_RADIUS,
|
|
11
|
+
} from "jsview";
|
|
12
|
+
import img from "./assets/light.png";
|
|
13
|
+
import img2 from "./assets/light2.png";
|
|
14
|
+
import mask from "./assets/mask.png";
|
|
15
|
+
|
|
16
|
+
const getRandom = (start, end) => {
|
|
17
|
+
return Math.round(Math.random() * (end - start) + start);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const router = useRouter();
|
|
21
|
+
const width = ref(300);
|
|
22
|
+
const height = ref(200);
|
|
23
|
+
const left = ref(50);
|
|
24
|
+
const top = ref(80);
|
|
25
|
+
const rotateAnimation =
|
|
26
|
+
"{from {transform: rotate3d(0,0,1,0);} to {transform: rotate3d(0,0,1,360deg);}}";
|
|
27
|
+
|
|
28
|
+
const ninePatchDecorator = {
|
|
29
|
+
type: DECORATE_NINEPATCH_ALPHA_MIX,
|
|
30
|
+
url: `url(${mask})`,
|
|
31
|
+
imageWidth: 86,
|
|
32
|
+
centerWidth: 2,
|
|
33
|
+
borderOutset: 0,
|
|
34
|
+
animTime: 0.5,
|
|
35
|
+
};
|
|
36
|
+
//注意texture的尺寸需要兼顾最大的view
|
|
37
|
+
const texCoord = {
|
|
38
|
+
width: 600,
|
|
39
|
+
height: 600,
|
|
40
|
+
};
|
|
41
|
+
const onKeyDown = (ev) => {
|
|
42
|
+
// 8:Backspace, 27:Escape, 10000:盒子返回键
|
|
43
|
+
if (ev.keyCode == 8 || ev.keyCode == 27 || ev.keyCode == 10000) {
|
|
44
|
+
router?.go(-1); // 有router时,是从DemoHomepage进入,回退
|
|
45
|
+
} else if (ev.keyCode == 13) {
|
|
46
|
+
left.value = getRandom(50, 400);
|
|
47
|
+
top.value = getRandom(80, 200);
|
|
48
|
+
width.value = getRandom(100, 300);
|
|
49
|
+
height.value = getRandom(100, 300);
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
<template>
|
|
55
|
+
<jsv-focus-block
|
|
56
|
+
autoFocus
|
|
57
|
+
:onKeyDown="onKeyDown"
|
|
58
|
+
:style="{
|
|
59
|
+
width: 1280,
|
|
60
|
+
height: 720,
|
|
61
|
+
backgroundImage:
|
|
62
|
+
'https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/BackgroundLongmao.jpg',
|
|
63
|
+
}"
|
|
64
|
+
>
|
|
65
|
+
<div
|
|
66
|
+
:style="{
|
|
67
|
+
textAlign: 'center',
|
|
68
|
+
fontSize: '30px',
|
|
69
|
+
lineHeight: '50px',
|
|
70
|
+
color: '#ffffff',
|
|
71
|
+
left: 140,
|
|
72
|
+
top: 20,
|
|
73
|
+
width: 1000,
|
|
74
|
+
height: 50,
|
|
75
|
+
backgroundColor: 'rgba(27,38,151,0.8)',
|
|
76
|
+
}"
|
|
77
|
+
>
|
|
78
|
+
.9型的旋转焦点框,OK键进行随机位置+尺寸变换
|
|
79
|
+
</div>
|
|
80
|
+
<div>
|
|
81
|
+
<jsv-texture-anim
|
|
82
|
+
:src="img"
|
|
83
|
+
:left="left"
|
|
84
|
+
:top="top"
|
|
85
|
+
:width="width"
|
|
86
|
+
:height="height"
|
|
87
|
+
:texCoord="texCoord"
|
|
88
|
+
:animation="rotateAnimation"
|
|
89
|
+
:duration="2000"
|
|
90
|
+
:repeat="-1"
|
|
91
|
+
:autoStart="true"
|
|
92
|
+
:decorate="ninePatchDecorator"
|
|
93
|
+
></jsv-texture-anim>
|
|
94
|
+
</div>
|
|
95
|
+
<div>
|
|
96
|
+
<jsv-texture-anim
|
|
97
|
+
:src="img2"
|
|
98
|
+
:left="left + 500"
|
|
99
|
+
:top="top"
|
|
100
|
+
:width="width"
|
|
101
|
+
:height="height"
|
|
102
|
+
:texCoord="texCoord"
|
|
103
|
+
:animation="rotateAnimation"
|
|
104
|
+
:duration="2000"
|
|
105
|
+
:repeat="-1"
|
|
106
|
+
:autoStart="true"
|
|
107
|
+
:decorate="ninePatchDecorator"
|
|
108
|
+
></jsv-texture-anim>
|
|
109
|
+
</div>
|
|
110
|
+
</jsv-focus-block>
|
|
111
|
+
</template>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { reactive, onMounted, ref } from "vue";
|
|
2
|
+
import { watch, reactive, onMounted, ref } from "vue";
|
|
3
3
|
import { useRouter } from "vue-router";
|
|
4
4
|
import { jJsvRuntimeBridge, JsvVisibleSensor } from "jsview";
|
|
5
5
|
|
|
6
6
|
const BOX_WIDTH = 150;
|
|
7
7
|
const BOX_HEIGHT = 150;
|
|
8
|
-
const BOX_COLOR = "
|
|
8
|
+
const BOX_COLOR = "rgba(0,255,255,0.6)";
|
|
9
|
+
const VISIBLE_RANGE = 0.25;
|
|
9
10
|
|
|
10
11
|
const router = useRouter();
|
|
11
12
|
|
|
12
|
-
let shown = reactive({
|
|
13
|
-
vertical: 0.25,
|
|
14
|
-
horizon: 1.0,
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
let left_change = reactive({ left: 0 });
|
|
18
|
-
let top_change = reactive({ top: 0 });
|
|
19
|
-
|
|
20
13
|
const containerRef = ref(null);
|
|
21
14
|
let case_config = ref(null);
|
|
22
15
|
let status_text = reactive({
|
|
@@ -26,12 +19,24 @@ let status_text = reactive({
|
|
|
26
19
|
newV: "false",
|
|
27
20
|
});
|
|
28
21
|
|
|
29
|
-
|
|
22
|
+
let test_case_type = ref(0);
|
|
23
|
+
|
|
24
|
+
window.LudlTestCase = test_case_type;
|
|
25
|
+
|
|
26
|
+
case_config.value = getTestCase(test_case_type.value);
|
|
27
|
+
|
|
28
|
+
watch(test_case_type, () => {
|
|
29
|
+
case_config.value = getTestCase(test_case_type.value);
|
|
30
|
+
});
|
|
30
31
|
|
|
31
32
|
onMounted(() => {
|
|
32
33
|
jJsvRuntimeBridge.notifyPageLoaded();
|
|
33
34
|
});
|
|
34
35
|
|
|
36
|
+
// const onAnimDone = () => {
|
|
37
|
+
// test_case_type.value = (test_case_type.value + 1) % 2;
|
|
38
|
+
// };
|
|
39
|
+
|
|
35
40
|
// 内部接口
|
|
36
41
|
const onBeVisible = (old_h, new_h, old_v, new_v) => {
|
|
37
42
|
status_text.oldH = old_h ? "true" : "false";
|
|
@@ -46,6 +51,9 @@ const onKeyDown = (ev) => {
|
|
|
46
51
|
router?.go(-1); // 有router时,回退
|
|
47
52
|
return true;
|
|
48
53
|
}
|
|
54
|
+
if (ev.keyCode == 13) {
|
|
55
|
+
test_case_type.value = (test_case_type.value + 1) % 2;
|
|
56
|
+
}
|
|
49
57
|
return false;
|
|
50
58
|
};
|
|
51
59
|
|
|
@@ -60,17 +68,17 @@ function getTestCase(test_index) {
|
|
|
60
68
|
switch (test_index) {
|
|
61
69
|
case 0: {
|
|
62
70
|
// 上到下
|
|
63
|
-
test_config.animation = "visibleSensor_upDown
|
|
71
|
+
test_config.animation = "visibleSensor_upDown 8s infinite linear";
|
|
64
72
|
test_config.text = "从上到下";
|
|
65
73
|
test_config.horizon = 1.0;
|
|
66
|
-
test_config.vertical =
|
|
74
|
+
test_config.vertical = VISIBLE_RANGE;
|
|
67
75
|
break;
|
|
68
76
|
}
|
|
69
77
|
case 1: {
|
|
70
78
|
// 左到右
|
|
71
|
-
test_config.animation = "visibleSensor_leftRight
|
|
79
|
+
test_config.animation = "visibleSensor_leftRight 8s infinite linear";
|
|
72
80
|
test_config.text = "从左到右";
|
|
73
|
-
test_config.horizon =
|
|
81
|
+
test_config.horizon = VISIBLE_RANGE;
|
|
74
82
|
test_config.vertical = 1.0;
|
|
75
83
|
break;
|
|
76
84
|
}
|
|
@@ -87,7 +95,7 @@ function getTestCase(test_index) {
|
|
|
87
95
|
:style="{
|
|
88
96
|
left: 10,
|
|
89
97
|
top: 10,
|
|
90
|
-
height:
|
|
98
|
+
height: 120,
|
|
91
99
|
width: 900,
|
|
92
100
|
fontColor: '#000000',
|
|
93
101
|
fontSize: 15,
|
|
@@ -95,7 +103,8 @@ function getTestCase(test_index) {
|
|
|
95
103
|
}"
|
|
96
104
|
>
|
|
97
105
|
{{
|
|
98
|
-
|
|
106
|
+
`按OK键切换方向
|
|
107
|
+
new horizon: ${status_text.newH}
|
|
99
108
|
new vertical: ${status_text.newV}
|
|
100
109
|
-------
|
|
101
110
|
old horizon: ${status_text.oldH}
|
|
@@ -106,12 +115,34 @@ old vertical: ${status_text.oldV}`
|
|
|
106
115
|
ref="containerRef"
|
|
107
116
|
:style="{
|
|
108
117
|
left: 240,
|
|
109
|
-
top:
|
|
110
|
-
width:
|
|
111
|
-
height:
|
|
118
|
+
top: 180,
|
|
119
|
+
width: 300,
|
|
120
|
+
height: 300,
|
|
112
121
|
backgroundColor: '#00F0F0',
|
|
113
122
|
}"
|
|
114
123
|
>
|
|
124
|
+
<div
|
|
125
|
+
:style="{
|
|
126
|
+
left: 50,
|
|
127
|
+
top: 50,
|
|
128
|
+
width: 200,
|
|
129
|
+
height: 200,
|
|
130
|
+
backgroundColor: '#00AAAA',
|
|
131
|
+
zIndex: test_case_type == 0 ? -22 : 0,
|
|
132
|
+
}"
|
|
133
|
+
/>
|
|
134
|
+
|
|
135
|
+
<div
|
|
136
|
+
:style="{
|
|
137
|
+
left: 80,
|
|
138
|
+
top: 30,
|
|
139
|
+
width: 140,
|
|
140
|
+
height: 240,
|
|
141
|
+
backgroundColor: '#0000AA',
|
|
142
|
+
zIndex: test_case_type == 0 ? -33 : 0,
|
|
143
|
+
}"
|
|
144
|
+
/>
|
|
145
|
+
|
|
115
146
|
<div
|
|
116
147
|
:style="{
|
|
117
148
|
left: 0,
|
|
@@ -128,6 +159,40 @@ old vertical: ${status_text.oldV}`
|
|
|
128
159
|
:container="containerRef"
|
|
129
160
|
:callback="onBeVisible"
|
|
130
161
|
>
|
|
162
|
+
<div v-if="test_case_type == 0">
|
|
163
|
+
<div
|
|
164
|
+
:style="{
|
|
165
|
+
width: BOX_WIDTH,
|
|
166
|
+
height: BOX_HEIGHT * VISIBLE_RANGE,
|
|
167
|
+
backgroundColor: '#FF0000',
|
|
168
|
+
}"
|
|
169
|
+
/>
|
|
170
|
+
<div
|
|
171
|
+
:style="{
|
|
172
|
+
top: BOX_HEIGHT * (1 - VISIBLE_RANGE),
|
|
173
|
+
width: BOX_WIDTH,
|
|
174
|
+
height: BOX_HEIGHT * VISIBLE_RANGE,
|
|
175
|
+
backgroundColor: '#FF0000',
|
|
176
|
+
}"
|
|
177
|
+
/>
|
|
178
|
+
</div>
|
|
179
|
+
<div v-else>
|
|
180
|
+
<div
|
|
181
|
+
:style="{
|
|
182
|
+
width: BOX_WIDTH * VISIBLE_RANGE,
|
|
183
|
+
height: BOX_HEIGHT,
|
|
184
|
+
backgroundColor: '#FF0000',
|
|
185
|
+
}"
|
|
186
|
+
/>
|
|
187
|
+
<div
|
|
188
|
+
:style="{
|
|
189
|
+
left: BOX_WIDTH * (1 - VISIBLE_RANGE),
|
|
190
|
+
width: BOX_WIDTH * VISIBLE_RANGE,
|
|
191
|
+
height: BOX_HEIGHT,
|
|
192
|
+
backgroundColor: '#FF0000',
|
|
193
|
+
}"
|
|
194
|
+
/>
|
|
195
|
+
</div>
|
|
131
196
|
<div
|
|
132
197
|
:style="{
|
|
133
198
|
width: BOX_WIDTH,
|
|
@@ -137,7 +202,9 @@ old vertical: ${status_text.oldV}`
|
|
|
137
202
|
lineHeight: 30,
|
|
138
203
|
}"
|
|
139
204
|
>
|
|
140
|
-
{{
|
|
205
|
+
{{
|
|
206
|
+
`${case_config.text}\nH:${status_text.newH}\nV:${status_text.newV}`
|
|
207
|
+
}}
|
|
141
208
|
</div>
|
|
142
209
|
</JsvVisibleSensor>
|
|
143
210
|
</div>
|
|
@@ -149,19 +216,19 @@ old vertical: ${status_text.oldV}`
|
|
|
149
216
|
<style scoped>
|
|
150
217
|
@keyframes visibleSensor_upDown {
|
|
151
218
|
from {
|
|
152
|
-
transform: translate3d(
|
|
219
|
+
transform: translate3d(75px, -180px, 0);
|
|
153
220
|
}
|
|
154
221
|
to {
|
|
155
|
-
transform: translate3d(
|
|
222
|
+
transform: translate3d(75px, 330px, 0);
|
|
156
223
|
}
|
|
157
224
|
}
|
|
158
225
|
|
|
159
226
|
@keyframes visibleSensor_leftRight {
|
|
160
227
|
from {
|
|
161
|
-
transform: translate3d(-
|
|
228
|
+
transform: translate3d(-180px, 75px, 0);
|
|
162
229
|
}
|
|
163
230
|
to {
|
|
164
|
-
transform: translate3d(
|
|
231
|
+
transform: translate3d(330px, 75px, 0);
|
|
165
232
|
}
|
|
166
233
|
}
|
|
167
234
|
</style>
|
|
@@ -206,6 +206,7 @@ class JsvBaseMedia {
|
|
|
206
206
|
timeUpdateLess: false,
|
|
207
207
|
rate: 1.0,
|
|
208
208
|
volume: 1.0,
|
|
209
|
+
chromaKey: null,
|
|
209
210
|
};
|
|
210
211
|
|
|
211
212
|
this.local = {
|
|
@@ -341,6 +342,10 @@ class JsvBaseMedia {
|
|
|
341
342
|
if(this.state["aspectRatio"] !== "origin"){
|
|
342
343
|
this.setState("aspectRatio", this.state["aspectRatio"], "string");
|
|
343
344
|
}
|
|
345
|
+
|
|
346
|
+
if(this.state["chromaKey"]){
|
|
347
|
+
this.setState("chromaKey", this.state["chromaKey"], "string");
|
|
348
|
+
}
|
|
344
349
|
}
|
|
345
350
|
|
|
346
351
|
onVisibilityChangeCallBack(){
|
|
@@ -1154,12 +1159,33 @@ class JsvBaseMedia {
|
|
|
1154
1159
|
* @param {double} time,值为从当前时间计算向前移动了多长时间,单位秒。
|
|
1155
1160
|
*/
|
|
1156
1161
|
setTimeShift(time){
|
|
1157
|
-
logTrace("setTimeShift, key="+this.key+", time"+time);
|
|
1162
|
+
logTrace("setTimeShift, key="+this.key+", time="+time);
|
|
1158
1163
|
if(this.playerCreate && this.appVisible){
|
|
1159
1164
|
window.jsvPlayerBridge.setTimeShift(this.key, time);
|
|
1160
1165
|
}
|
|
1161
1166
|
}
|
|
1162
1167
|
|
|
1168
|
+
/**
|
|
1169
|
+
* 设置色度抠像参数,只支持扣绿。
|
|
1170
|
+
* 参考格式:{color: 0x30FF30, colorDistance: 0.15, edgeDistance: 0.4, greenOffset: 0.05}
|
|
1171
|
+
* @param {JSON object} chromaKey,抠像参数,JSON Object包含的参数如下:
|
|
1172
|
+
* color,色值,int类型,为抠图色值范围的中心点,格式为0xRRGGBB。
|
|
1173
|
+
* colorDistance,float类型,色域范围,范围0-1.0。
|
|
1174
|
+
* edgeDistance,float类型,alpha透明度距离,范围colorDistance-1.0,从colorDistance到edgeDistance的alpha值从1.0-0线性递减。
|
|
1175
|
+
* greenOffset,float类型,红蓝差值,范围0-1.0。
|
|
1176
|
+
*/
|
|
1177
|
+
setChromaKey(chromaKey){
|
|
1178
|
+
logTrace("setChromaKey, key="+this.key+", chroma key="+JSON.stringify(chromaKey));
|
|
1179
|
+
this.setState("chromaKey", JSON.stringify(chromaKey), "string");
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
setDebugMode(mode){
|
|
1183
|
+
logTrace("setDebugMode, key="+this.key+", mode="+mode);
|
|
1184
|
+
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1185
|
+
return window.jsvPlayerBridge.setDebugMode(this.key, mode);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1163
1189
|
/**
|
|
1164
1190
|
* 私有接口,外部不需要调用此接口。
|
|
1165
1191
|
*/
|
|
@@ -1286,7 +1312,7 @@ function getJsvPlayerCapabilitySet(){
|
|
|
1286
1312
|
* 支持三个属性:1、total:总的播放器个数;2、hardware:硬解播放器个数;3、软解播放器个数,如果硬解播放器个数不满足需求,会根据cpu能力确定是否提供软解播放器。
|
|
1287
1313
|
* */
|
|
1288
1314
|
function setJsvPlayerNumber(videoType, num){
|
|
1289
|
-
logTrace("setPlayerNumber,
|
|
1315
|
+
logTrace("setPlayerNumber, videoType="+videoType+", num="+num);
|
|
1290
1316
|
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1291
1317
|
return window.jsvPlayerBridge.setPlayerNumber(videoType, num);
|
|
1292
1318
|
}else{
|
|
@@ -1294,6 +1320,13 @@ function setJsvPlayerNumber(videoType, num){
|
|
|
1294
1320
|
}
|
|
1295
1321
|
}
|
|
1296
1322
|
|
|
1323
|
+
function setJsvPlayerDebugMode(mode){
|
|
1324
|
+
logTrace("setDebugMode, mode="+mode);
|
|
1325
|
+
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1326
|
+
return window.jsvPlayerBridge.setDebugMode(null, mode);
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1297
1330
|
export {
|
|
1298
1331
|
JsvMediaVideo,
|
|
1299
1332
|
JsvMediaAudio,
|
|
@@ -1307,4 +1340,5 @@ export {
|
|
|
1307
1340
|
logWarning,
|
|
1308
1341
|
logDebug,
|
|
1309
1342
|
logTrace,
|
|
1343
|
+
setJsvPlayerDebugMode,
|
|
1310
1344
|
}
|
|
@@ -49,11 +49,21 @@ export default {
|
|
|
49
49
|
/**
|
|
50
50
|
* 属性,Boolean类型,是否保留最后一帧,true保留,false不保留。
|
|
51
51
|
*/
|
|
52
|
-
keepLastFrame: {type: Boolean, default:
|
|
52
|
+
keepLastFrame: {type: Boolean, default: true},
|
|
53
53
|
/**
|
|
54
54
|
* 属性,String类型,视频显示比例,origin原始比例显示,full全屏显示,x:y按照指定比例显示。
|
|
55
55
|
*/
|
|
56
56
|
videoAspectRatio: {type: String, default: "origin"},
|
|
57
|
+
/**
|
|
58
|
+
* 属性,JSON Object类型,色度抠像参数,包含color,colorDistance,edgeDistance,greenOffset四个参数,
|
|
59
|
+
* 参考格式:{color: 0x30FF30, colorDistance: 0.15, edgeDistance: 0.4, greenOffset: 0.05}
|
|
60
|
+
* color,色值,int类型,为抠图色值范围的中心点,格式为0xRRGGBB。
|
|
61
|
+
* colorDistance,float类型,色域范围,范围0-1.0。
|
|
62
|
+
* edgeDistance,float类型,alpha透明度距离,范围colorDistance-1.0,从colorDistance到edgeDistance的alpha值从1.0-0线性递减。
|
|
63
|
+
* greenOffset,float类型,红蓝差值,范围0-1.0。
|
|
64
|
+
* 目前只支持扣绿。
|
|
65
|
+
*/
|
|
66
|
+
chromaKey: {type: Object, default: null},
|
|
57
67
|
/**
|
|
58
68
|
* 回调函数,播放结束时通过此回调接口通知。
|
|
59
69
|
*/
|
|
@@ -255,13 +265,17 @@ export default {
|
|
|
255
265
|
this.video.loop = this.loop;
|
|
256
266
|
}
|
|
257
267
|
|
|
258
|
-
if(this.keepLastFrame){
|
|
268
|
+
if(!this.keepLastFrame){
|
|
259
269
|
this.video.keepLastFrame = this.keepLastFrame;
|
|
260
270
|
}
|
|
261
271
|
|
|
262
272
|
if(this.videoAspectRatio !== "origin"){
|
|
263
273
|
this.video.videoAspectRatio = this.videoAspectRatio;
|
|
264
274
|
}
|
|
275
|
+
|
|
276
|
+
if(this.chromaKey && this.chromaKey !== ""){
|
|
277
|
+
this.video.setChromaKey(this.chromaKey)
|
|
278
|
+
}
|
|
265
279
|
//}else{
|
|
266
280
|
if(!first_create){
|
|
267
281
|
this.video.setHoleID(this.holeId);
|
|
@@ -279,6 +293,7 @@ export default {
|
|
|
279
293
|
unmounted(){
|
|
280
294
|
if(this.video != null){
|
|
281
295
|
this.video.releasePlayer();
|
|
296
|
+
|
|
282
297
|
this.onRef?.(null)
|
|
283
298
|
}
|
|
284
299
|
},
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
import * as JsvPlayer from "./JsvPlayer.vue";
|
|
3
3
|
import { globalLoadJsvPlayerPlugin as initPlugin } from "./JsvMedia.js"
|
|
4
4
|
import { getJsvPlayerCapabilitySet as getCapabilitySet } from "./JsvMedia.js"
|
|
5
|
+
import { setJsvPlayerDebugMode as setDebugMode } from "./JsvMedia.js"
|
|
5
6
|
let _JsvPlayer = JsvPlayer;
|
|
6
7
|
|
|
7
8
|
let globalLoadJsvPlayerPlugin = initPlugin;
|
|
8
9
|
let getJsvPlayerCapabilitySet = getCapabilitySet;
|
|
10
|
+
let setJsvPlayerDebugMode = setDebugMode;
|
|
11
|
+
|
|
9
12
|
if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
|
|
10
13
|
// 浏览器版本
|
|
11
14
|
_JsvPlayer = window.JsvWidgetWrapperGroup.BrowserJsvPlayer;
|
|
@@ -19,6 +22,10 @@ if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
|
|
|
19
22
|
getJsvPlayerCapabilitySet = () => {
|
|
20
23
|
return null;
|
|
21
24
|
}
|
|
25
|
+
|
|
26
|
+
setJsvPlayerDebugMode = () => {
|
|
27
|
+
console.log("Set debug mode");
|
|
28
|
+
}
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
let component = _JsvPlayer.default;
|
|
@@ -27,5 +34,5 @@ export default component;
|
|
|
27
34
|
export {
|
|
28
35
|
globalLoadJsvPlayerPlugin, // 全局初始化播放器插件处理
|
|
29
36
|
getJsvPlayerCapabilitySet, //获取设备能力集
|
|
30
|
-
|
|
37
|
+
setJsvPlayerDebugMode, //设置调试模式,可以查看帧率等信息
|
|
31
38
|
}
|
|
@@ -2,16 +2,16 @@ let PluginInfo={
|
|
|
2
2
|
// downloadUrl:"http://192.168.0.63:8080/plugin/JsvPlayer-164.zip", //插件下载地址
|
|
3
3
|
packageName:"com.qcode.jsvplayer",
|
|
4
4
|
name:"播放器插件",
|
|
5
|
-
version:"1.6.
|
|
6
|
-
versionCodeMin:
|
|
7
|
-
versionCodeMax:
|
|
5
|
+
version:"1.6.7", //插件需要的版本号
|
|
6
|
+
versionCodeMin:167,
|
|
7
|
+
versionCodeMax:167,
|
|
8
8
|
bridgeName:"jsvPlayerBridge", //插件bridge注册到jsview的名称
|
|
9
9
|
className:"com.qcode.jsvplayer.JsvPlayer", //插件初始化类名称
|
|
10
10
|
initMethod:"createInstance", //插件初始化方法
|
|
11
11
|
listener:"top.JsvPlayerPluginLoadResult", //插件加载结果回调
|
|
12
12
|
listener2: "top.JsvPlayerPluginStatus",
|
|
13
13
|
// debug:true,
|
|
14
|
-
md5:"
|
|
14
|
+
md5:"19b065b6d4d2acdbaf6093c4864fea22"
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
// 不要用export default,update-env脚本不能解析
|