@shijiu/jsview-vue 0.9.602 → 0.9.684
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/bin/jsview-engine-js-browser.min.js +1 -0
- package/dom/target_core_revision.js +4 -4
- package/package.json +1 -1
- package/samples/Basic/components/text/TextOverflow.vue +10 -5
- package/samples/Collision/App.vue +452 -0
- package/samples/DemoHomepage/components/BodyFrame.vue +2 -0
- package/samples/DemoHomepage/router.js +25 -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/Marquee/App.vue +176 -40
- package/samples/Marquee/longText.js +14 -0
- package/samples/MetroWidgetDemos/Advanced/App.vue +5 -6
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +1 -1
- package/samples/MetroWidgetDemos/Advanced/Buttons.vue +5 -5
- package/samples/MetroWidgetDemos/Advanced/Mixed.vue +4 -4
- package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +83 -0
- package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +89 -0
- package/samples/MetroWidgetDemos/Advanced/{Widgets.vue → widgets/Widgets.vue} +56 -11
- package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
- package/samples/MetroWidgetDemos/Item.vue +20 -2
- 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/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/App.vue +2 -2
- package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +4 -4
- package/samples/MetroWidgetDemos/data.js +2 -1
- package/samples/Preload/App.vue +16 -11
- package/samples/ScaleDownNeon/App.vue +107 -0
- package/samples/TextBox/App.vue +7 -81
- package/samples/TextBox/RenderCenter.vue +40 -16
- package/samples/TextBox/RenderLeft.vue +48 -19
- package/samples/TextBox/RenderOneLine.vue +30 -49
- package/samples/TextBox/RenderRight.vue +40 -16
- package/samples/TextShadowDemo/App.vue +11 -17
- 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/TextureSize/App.vue +3 -3
- package/samples/VisibleSensorDemo/App.vue +92 -25
- package/utils/JsViewEngineWidget/MetroWidget/Const.js +11 -0
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +188 -80
- package/utils/JsViewEngineWidget/TemplateParser.js +89 -32
- package/utils/JsViewEngineWidget/WidgetCommon.js +3 -4
- package/utils/JsViewEngineWidget/index.js +3 -2
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +95 -12
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +25 -3
- package/utils/JsViewPlugin/JsvPlayer/index.js +22 -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/JsvMarquee.vue +178 -205
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +35 -27
- package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -2
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +37 -41
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +282 -285
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +18 -2
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +22 -2
- package/utils/JsViewVueWidget/JsvTextBox.vue +35 -72
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +123 -46
- package/utils/JsViewVueWidget/JsvTextureAnim/index.js +9 -5
- package/utils/JsViewVueWidget/JsvTouchContainer.vue +3 -4
- package/utils/JsViewVueWidget/JsvVideo.vue +9 -12
- package/utils/JsViewVueWidget/index.js +2 -2
- package/utils/JsViewVueWidget/utils/index.js +8 -0
- package/utils/JsViewVueWidget/utils/text.js +19 -0
- package/utils/JsViewEngineWidget/MetroPage.js +0 -2128
- package/utils/JsViewEngineWidget/SimpleWidget/ContentView.vue +0 -51
- package/utils/JsViewEngineWidget/SimpleWidget/Dispatcher.js +0 -19
- package/utils/JsViewEngineWidget/SimpleWidget/DivWrapper.vue +0 -53
- package/utils/JsViewEngineWidget/SimpleWidget/ItemView.vue +0 -142
- package/utils/JsViewEngineWidget/SimpleWidget/RootView.vue +0 -140
- package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +0 -1629
|
@@ -34,12 +34,12 @@ const measureObjectCheckMap = {
|
|
|
34
34
|
width: (obj) => {
|
|
35
35
|
if (isNaN(obj.width)) {
|
|
36
36
|
if (isNaN(obj.block?.w)) {
|
|
37
|
+
throw new Error(TAG + "width is not defined");
|
|
38
|
+
} else {
|
|
37
39
|
console.warn(TAG, "key 'block' is deprecated ");
|
|
38
40
|
return integerCheck(obj.blocks.w, () => {
|
|
39
41
|
console.warn(TAG, "width is not integer", obj);
|
|
40
42
|
});
|
|
41
|
-
} else {
|
|
42
|
-
throw new Error(TAG + "width is not definied");
|
|
43
43
|
}
|
|
44
44
|
} else {
|
|
45
45
|
return integerCheck(obj.width, () => {
|
|
@@ -50,12 +50,12 @@ const measureObjectCheckMap = {
|
|
|
50
50
|
height: (obj) => {
|
|
51
51
|
if (isNaN(obj.height)) {
|
|
52
52
|
if (isNaN(obj.block?.h)) {
|
|
53
|
+
throw new Error(TAG + "height is not defined");
|
|
54
|
+
} else {
|
|
53
55
|
console.warn(TAG, "key 'block' is deprecated ");
|
|
54
56
|
return integerCheck(obj.blocks.h, () => {
|
|
55
57
|
console.warn(TAG, "height is not integer", obj);
|
|
56
58
|
});
|
|
57
|
-
} else {
|
|
58
|
-
throw new Error(TAG + "height is not definied");
|
|
59
59
|
}
|
|
60
60
|
} else {
|
|
61
61
|
return integerCheck(obj.height, () => {
|
|
@@ -72,6 +72,26 @@ function measureObjectChecker(obj) {
|
|
|
72
72
|
|
|
73
73
|
function getTemplateItem(measure_obj, data_info) {
|
|
74
74
|
measureObjectChecker(measure_obj);
|
|
75
|
+
|
|
76
|
+
let focusZIndex = -1,
|
|
77
|
+
normalZIndex = -1;
|
|
78
|
+
if (
|
|
79
|
+
typeof measure_obj["zIndex"] != "undefined" &&
|
|
80
|
+
measure_obj["zIndex"] != null
|
|
81
|
+
) {
|
|
82
|
+
if (typeof measure_obj["zIndex"] == "object") {
|
|
83
|
+
if (typeof measure_obj["zIndex"]["focus"] == "number") {
|
|
84
|
+
focusZIndex = measure_obj["zIndex"]["focus"];
|
|
85
|
+
}
|
|
86
|
+
if (typeof measure_obj["zIndex"]["normal"] == "number") {
|
|
87
|
+
normalZIndex = measure_obj["zIndex"]["normal"];
|
|
88
|
+
}
|
|
89
|
+
} else if (typeof measure_obj["zIndex"] == "number") {
|
|
90
|
+
focusZIndex = measure_obj["zIndex"];
|
|
91
|
+
normalZIndex = measure_obj["zIndex"];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
75
95
|
return {
|
|
76
96
|
id: -1,
|
|
77
97
|
index: -1,
|
|
@@ -106,6 +126,8 @@ function getTemplateItem(measure_obj, data_info) {
|
|
|
106
126
|
typeof measure_obj.permanent !== "undefined"
|
|
107
127
|
? measure_obj.permanent
|
|
108
128
|
: false,
|
|
129
|
+
focusZIndex,
|
|
130
|
+
normalZIndex,
|
|
109
131
|
};
|
|
110
132
|
}
|
|
111
133
|
|
|
@@ -867,7 +889,10 @@ class TemplateParser {
|
|
|
867
889
|
item_key_pos = gap_info.startPos;
|
|
868
890
|
item_second_pos = top_fence.AheadOffset;
|
|
869
891
|
} else {
|
|
870
|
-
|
|
892
|
+
throw new Error(
|
|
893
|
+
`${TAG} item size ${item_width}x${item_height} is greater than widget line max ${this._Template.Orient.widthMax}`
|
|
894
|
+
);
|
|
895
|
+
// console.error(TAG, "ERROR: coding error, header full gap fence lost");
|
|
871
896
|
}
|
|
872
897
|
|
|
873
898
|
if (this._Template.Orient.type === VERTICAL) {
|
|
@@ -1846,7 +1871,14 @@ class TemplateParser {
|
|
|
1846
1871
|
}
|
|
1847
1872
|
|
|
1848
1873
|
class TemplateItemAdder {
|
|
1849
|
-
constructor(
|
|
1874
|
+
constructor(
|
|
1875
|
+
template_parser,
|
|
1876
|
+
data,
|
|
1877
|
+
measure_func,
|
|
1878
|
+
page_range,
|
|
1879
|
+
side_effect,
|
|
1880
|
+
id
|
|
1881
|
+
) {
|
|
1850
1882
|
this._TemplateParser = template_parser;
|
|
1851
1883
|
this._Data = data;
|
|
1852
1884
|
this._PageRange = page_range;
|
|
@@ -1859,6 +1891,7 @@ class TemplateItemAdder {
|
|
|
1859
1891
|
this._TemplateParser._Template.Orient.type === HORIZONTAL
|
|
1860
1892
|
? "xPos"
|
|
1861
1893
|
: "yPos";
|
|
1894
|
+
this._ID = id;
|
|
1862
1895
|
}
|
|
1863
1896
|
|
|
1864
1897
|
tryAddItem(cur_item = null, page_num = 1) {
|
|
@@ -1869,15 +1902,23 @@ class TemplateItemAdder {
|
|
|
1869
1902
|
cur_item[this._Key] >= (this._CurPage - 1) * this._PageRange)
|
|
1870
1903
|
) {
|
|
1871
1904
|
while (this._CurIndex < this._Data.length) {
|
|
1872
|
-
|
|
1873
|
-
this.
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
this._CurPage
|
|
1880
|
-
|
|
1905
|
+
try {
|
|
1906
|
+
let item = this._TemplateParser.ParseTemplateItem(
|
|
1907
|
+
this._MeasureFunc(this._Data[this._CurIndex]),
|
|
1908
|
+
this._Data[this._CurIndex]
|
|
1909
|
+
);
|
|
1910
|
+
this._SideEffect?.(item);
|
|
1911
|
+
this._CurIndex++;
|
|
1912
|
+
if (item[this._Key] >= (this._CurPage + page_num) * this._PageRange) {
|
|
1913
|
+
this._CurPage += page_num;
|
|
1914
|
+
break;
|
|
1915
|
+
}
|
|
1916
|
+
} catch (e) {
|
|
1917
|
+
console.error(
|
|
1918
|
+
`MetroWidget: ${this._ID} parse template item ${this._CurIndex} failed. data: `,
|
|
1919
|
+
this._Data
|
|
1920
|
+
);
|
|
1921
|
+
throw e;
|
|
1881
1922
|
}
|
|
1882
1923
|
}
|
|
1883
1924
|
this._TemplateParser.CalculateNeighborWhenAddStop();
|
|
@@ -1899,14 +1940,22 @@ class TemplateItemAdder {
|
|
|
1899
1940
|
let added = false;
|
|
1900
1941
|
while (this._CurIndex <= _index) {
|
|
1901
1942
|
added = true;
|
|
1902
|
-
|
|
1903
|
-
this.
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
this._CurPage
|
|
1943
|
+
try {
|
|
1944
|
+
let item = this._TemplateParser.ParseTemplateItem(
|
|
1945
|
+
this._MeasureFunc(this._Data[this._CurIndex]),
|
|
1946
|
+
this._Data[this._CurIndex]
|
|
1947
|
+
);
|
|
1948
|
+
this._SideEffect?.(item);
|
|
1949
|
+
this._CurIndex++;
|
|
1950
|
+
if (item[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
1951
|
+
this._CurPage++;
|
|
1952
|
+
}
|
|
1953
|
+
} catch (e) {
|
|
1954
|
+
console.error(
|
|
1955
|
+
`MetroWidget: ${this._ID} parse template item ${this._CurIndex} failed. data:`,
|
|
1956
|
+
this._Data
|
|
1957
|
+
);
|
|
1958
|
+
throw e;
|
|
1910
1959
|
}
|
|
1911
1960
|
}
|
|
1912
1961
|
if (added) {
|
|
@@ -1924,16 +1973,24 @@ class TemplateItemAdder {
|
|
|
1924
1973
|
let cur_id = last_id;
|
|
1925
1974
|
while (cur_id < _id && this._CurIndex < this._Data.length) {
|
|
1926
1975
|
added = true;
|
|
1927
|
-
|
|
1928
|
-
this.
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
this._CurPage
|
|
1976
|
+
try {
|
|
1977
|
+
const item = this._TemplateParser.ParseTemplateItem(
|
|
1978
|
+
this._MeasureFunc(this._Data[this._CurIndex]),
|
|
1979
|
+
this._Data[this._CurIndex]
|
|
1980
|
+
);
|
|
1981
|
+
cur_id = item.id;
|
|
1982
|
+
this._SideEffect?.(item);
|
|
1983
|
+
if (item[this._Key] >= (this._CurPage + 1) * this._PageRange) {
|
|
1984
|
+
this._CurPage++;
|
|
1985
|
+
}
|
|
1986
|
+
this._CurIndex++;
|
|
1987
|
+
} catch (e) {
|
|
1988
|
+
console.error(
|
|
1989
|
+
`MetroWidget: ${this._ID} parse template item ${this._CurIndex} failed. data:`,
|
|
1990
|
+
this._Data
|
|
1991
|
+
);
|
|
1992
|
+
throw e;
|
|
1935
1993
|
}
|
|
1936
|
-
this._CurIndex++;
|
|
1937
1994
|
}
|
|
1938
1995
|
if (added) {
|
|
1939
1996
|
this._TemplateParser.CalculateNeighborWhenAddStop();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2020-12-30 14:08:38
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-
|
|
5
|
+
* @LastEditTime: 2022-11-09 09:33:15
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
class BaseDispatcher {
|
|
@@ -75,12 +75,11 @@ function getPositionRelativeToView(divElement, targetElement) {
|
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
77
|
let element = divElement;
|
|
78
|
-
const elementLayoutParams = element.jsvMaskView.GetLayoutParams();
|
|
79
78
|
let position = {
|
|
80
79
|
left: 0,
|
|
81
80
|
top: 0,
|
|
82
|
-
width:
|
|
83
|
-
height:
|
|
81
|
+
width: element.style.width,
|
|
82
|
+
height: element.style.height,
|
|
84
83
|
};
|
|
85
84
|
while (element && element !== targetElement) {
|
|
86
85
|
position.left += element.style.left ? element.style.left : 0;
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* @Author: ChenChanghua
|
|
3
3
|
* @Date: 2021-06-16 10:07:20
|
|
4
4
|
* @LastEditors: ChenChanghua
|
|
5
|
-
* @LastEditTime: 2022-07
|
|
5
|
+
* @LastEditTime: 2022-11-07 14:50:02
|
|
6
6
|
* @Description: file content
|
|
7
7
|
*/
|
|
8
8
|
export * from "./WidgetCommon";
|
|
9
|
-
export * from "./
|
|
9
|
+
export * from "./MetroWidget/Dispatcher";
|
|
10
10
|
|
|
11
11
|
export { default as SimpleWidget } from "./MetroWidget/MetroWidget.vue";
|
|
12
12
|
export { default as MetroWidget } from "./MetroWidget/MetroWidget.vue";
|
|
13
|
+
export { METRO_WIDGET } from "./MetroWidget/Const.js";
|
|
13
14
|
|
|
14
15
|
export { default as JsvFocusBlock } from "./JsvFocusBlock.vue";
|
|
15
16
|
export { jsvCreateFocusManager, useFocusHub } from "./JsvFocusManager";
|
|
@@ -190,7 +190,7 @@ function findMediaObjectByKey(key){
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
class JsvBaseMedia {
|
|
193
|
-
constructor(type, hole_id, player_type, key, background, design_map_width, decode_type) {
|
|
193
|
+
constructor(type, window_mode, hole_id, player_type, key, background, design_map_width, decode_type) {
|
|
194
194
|
logTrace("Create JsvBaseMedia, type="+type+", hole_id="+hole_id+", player_type="+player_type+", key="+key+", background="+background+", design_map_width="+design_map_width+", decode_type="+decode_type);
|
|
195
195
|
|
|
196
196
|
this.state = {
|
|
@@ -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 = {
|
|
@@ -219,6 +220,7 @@ class JsvBaseMedia {
|
|
|
219
220
|
this.type = type;
|
|
220
221
|
this.playerCreate = false;
|
|
221
222
|
this.key = key;
|
|
223
|
+
this.windowMode = window_mode;
|
|
222
224
|
this.background = background;
|
|
223
225
|
this.holeId = hole_id;
|
|
224
226
|
this.holeIdModify = hole_id;
|
|
@@ -265,7 +267,7 @@ class JsvBaseMedia {
|
|
|
265
267
|
|
|
266
268
|
let share_view = true;
|
|
267
269
|
|
|
268
|
-
let result = window.jsvPlayerBridge.CreatePlayer(this.key, this.holeId, this.background, this.designMapWidth, share_view, this.playerType, this.decodeType, "top.CreatePlayerResult");
|
|
270
|
+
let result = window.jsvPlayerBridge.CreatePlayer(this.key, this.windowMode, this.holeId, this.background, this.designMapWidth, share_view, this.playerType, this.decodeType, "top.CreatePlayerResult");
|
|
269
271
|
if(result > 0){
|
|
270
272
|
this.initPlayer();
|
|
271
273
|
}
|
|
@@ -341,6 +343,10 @@ class JsvBaseMedia {
|
|
|
341
343
|
if(this.state["aspectRatio"] !== "origin"){
|
|
342
344
|
this.setState("aspectRatio", this.state["aspectRatio"], "string");
|
|
343
345
|
}
|
|
346
|
+
|
|
347
|
+
if(this.state["chromaKey"]){
|
|
348
|
+
this.setState("chromaKey", this.state["chromaKey"], "string");
|
|
349
|
+
}
|
|
344
350
|
}
|
|
345
351
|
|
|
346
352
|
onVisibilityChangeCallBack(){
|
|
@@ -841,7 +847,7 @@ class JsvBaseMedia {
|
|
|
841
847
|
* 属性,string类型,播放地址,不支持读取。
|
|
842
848
|
*/
|
|
843
849
|
set src(value) {
|
|
844
|
-
this.setSrc(value, null, 1)
|
|
850
|
+
this.setSrc(value, null, null, 1)
|
|
845
851
|
}
|
|
846
852
|
|
|
847
853
|
/**
|
|
@@ -890,17 +896,26 @@ class JsvBaseMedia {
|
|
|
890
896
|
/**
|
|
891
897
|
* 设置播放地址。
|
|
892
898
|
* @param {string} url 播放地址。
|
|
899
|
+
* @param {String} windowMode 播放器窗口模式。
|
|
900
|
+
* null:使用this.windowMode作为窗口模式。
|
|
901
|
+
* full:观影模式,全屏方式,不建议修改w/h/l/t,视频清晰度/流畅度最佳;
|
|
902
|
+
* resizable:可变窗口模式,可以随意修改w/h/l/t,支持动画效果,视频清晰度/流畅度表现可能不如full模式;
|
|
903
|
+
* pip:画中画模式,只在支持多路硬解的情况下使用,用户画中画的小窗播放,对清晰度/流畅度要求较差,可能会有反交错问题。
|
|
893
904
|
* @param {string} head 网络请求的head信息,可以为NULL。
|
|
894
|
-
* @param {int} type 类型,1表示点播,2表示直播,3
|
|
905
|
+
* @param {int} type 类型,1表示点播,2表示直播,3表示时移,4表示回看,默认1。
|
|
895
906
|
* @param {double} timeShift 时移时间,只有在type=3时才有效,表示从当前时间时移多长时间,单位秒。
|
|
896
907
|
* @param {int} 分辨率类型 0:unknown或其它;1:标清;2:高清;3:超清(720P);4:蓝光(1080P);5:2K;6:4K;7:8K。
|
|
908
|
+
* @param {int} 用户频道号,只在直播回看状态下需要设置
|
|
897
909
|
*/
|
|
898
|
-
setSrc(url, head, type, timeShift, resolution){
|
|
910
|
+
setSrc(url, windowMode, head, type, timeShift, resolution, mixNo){
|
|
899
911
|
let src = {};
|
|
900
912
|
src.url = url;
|
|
901
913
|
if(head){
|
|
902
914
|
src.head = head;
|
|
903
915
|
}
|
|
916
|
+
if(windowMode){
|
|
917
|
+
src.windowMode = windowMode;
|
|
918
|
+
}
|
|
904
919
|
if(type){
|
|
905
920
|
src.type = type;
|
|
906
921
|
}else{
|
|
@@ -914,6 +929,10 @@ class JsvBaseMedia {
|
|
|
914
929
|
src.resolution = resolution;
|
|
915
930
|
}
|
|
916
931
|
|
|
932
|
+
if(mixNo && typeof mixNo == "number"){
|
|
933
|
+
src.channelID = mixNo;
|
|
934
|
+
}
|
|
935
|
+
|
|
917
936
|
this.currentEventStatus = EVENT_STATUS_NONE;
|
|
918
937
|
this.setState("src", JSON.stringify(src), "string");
|
|
919
938
|
this.eventReport = true;
|
|
@@ -1154,12 +1173,46 @@ class JsvBaseMedia {
|
|
|
1154
1173
|
* @param {double} time,值为从当前时间计算向前移动了多长时间,单位秒。
|
|
1155
1174
|
*/
|
|
1156
1175
|
setTimeShift(time){
|
|
1157
|
-
logTrace("setTimeShift, key="+this.key+", time"+time);
|
|
1176
|
+
logTrace("setTimeShift, key="+this.key+", time="+time);
|
|
1158
1177
|
if(this.playerCreate && this.appVisible){
|
|
1159
1178
|
window.jsvPlayerBridge.setTimeShift(this.key, time);
|
|
1160
1179
|
}
|
|
1161
1180
|
}
|
|
1162
1181
|
|
|
1182
|
+
/**
|
|
1183
|
+
* 设置色度抠像参数,只支持扣绿。
|
|
1184
|
+
* 参考格式:{color: 0x30FF30, colorDistance: 0.15, edgeDistance: 0.4, greenOffset: 0.05}
|
|
1185
|
+
* @param {JSON object} chromaKey,抠像参数,JSON Object包含的参数如下:
|
|
1186
|
+
* color,色值,int类型,为抠图色值范围的中心点,格式为0xRRGGBB。
|
|
1187
|
+
* colorDistance,float类型,色域范围,范围0-1.0。
|
|
1188
|
+
* edgeDistance,float类型,alpha透明度距离,范围colorDistance-1.0,从colorDistance到edgeDistance的alpha值从1.0-0线性递减。
|
|
1189
|
+
* greenOffset,float类型,红蓝差值,范围0-1.0。
|
|
1190
|
+
*/
|
|
1191
|
+
setChromaKey(chromaKey){
|
|
1192
|
+
logTrace("setChromaKey, key="+this.key+", chroma key="+JSON.stringify(chromaKey));
|
|
1193
|
+
this.setState("chromaKey", JSON.stringify(chromaKey), "string");
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
setDebugMode(mode){
|
|
1197
|
+
logTrace("setDebugMode, key="+this.key+", mode="+mode);
|
|
1198
|
+
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1199
|
+
return window.jsvPlayerBridge.setDebugMode(this.key, mode);
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
/**
|
|
1204
|
+
* 获取是否支持倍速设置,在onCanPlay事件发送以后,通过此接口查询。
|
|
1205
|
+
* @returns {boolean} true:支持播放倍速设置;false:不支持播放倍速设置。
|
|
1206
|
+
* */
|
|
1207
|
+
supportPlaybackRateSet(){
|
|
1208
|
+
logTrace("supportPlaybackRateSet, key="+this.key);
|
|
1209
|
+
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1210
|
+
return window.jsvPlayerBridge.supportRateSet(this.key);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
return false;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1163
1216
|
/**
|
|
1164
1217
|
* 私有接口,外部不需要调用此接口。
|
|
1165
1218
|
*/
|
|
@@ -1215,21 +1268,21 @@ class JsvBaseMedia {
|
|
|
1215
1268
|
}
|
|
1216
1269
|
|
|
1217
1270
|
class JsvMedia extends JsvBaseMedia {
|
|
1218
|
-
constructor(type, hole_id, player_type, key, background, design_map_width, decode_type) {
|
|
1219
|
-
super(type, hole_id, player_type, key, background, design_map_width, decode_type);
|
|
1271
|
+
constructor(type, window_mode, hole_id, player_type, key, background, design_map_width, decode_type) {
|
|
1272
|
+
super(type, window_mode, hole_id, player_type, key, background, design_map_width, decode_type);
|
|
1220
1273
|
//super.buildPlatformInstance(type);
|
|
1221
1274
|
}
|
|
1222
1275
|
}
|
|
1223
1276
|
|
|
1224
1277
|
class JsvMediaAudio extends JsvMedia {
|
|
1225
1278
|
constructor() {
|
|
1226
|
-
super("audio", null, null, null, null, null, 0);
|
|
1279
|
+
super("audio", "resizable", null, null, null, null, null, 0);
|
|
1227
1280
|
}
|
|
1228
1281
|
}
|
|
1229
1282
|
|
|
1230
1283
|
class JsvMediaVideo extends JsvMedia {
|
|
1231
|
-
constructor(hole_id, player_type, key, background, design_map_width, decode_type) {
|
|
1232
|
-
super("video", hole_id, player_type, key, background, design_map_width, decode_type);
|
|
1284
|
+
constructor(hole_id, window_mode, player_type, key, background, design_map_width, decode_type) {
|
|
1285
|
+
super("video", window_mode, hole_id, player_type, key, background, design_map_width, decode_type);
|
|
1233
1286
|
|
|
1234
1287
|
this.state.aspectRatio = 'origin'; // 'origin', 'full', '16:9', '4:3',
|
|
1235
1288
|
}
|
|
@@ -1286,7 +1339,7 @@ function getJsvPlayerCapabilitySet(){
|
|
|
1286
1339
|
* 支持三个属性:1、total:总的播放器个数;2、hardware:硬解播放器个数;3、软解播放器个数,如果硬解播放器个数不满足需求,会根据cpu能力确定是否提供软解播放器。
|
|
1287
1340
|
* */
|
|
1288
1341
|
function setJsvPlayerNumber(videoType, num){
|
|
1289
|
-
logTrace("setPlayerNumber,
|
|
1342
|
+
logTrace("setPlayerNumber, videoType="+videoType+", num="+num);
|
|
1290
1343
|
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1291
1344
|
return window.jsvPlayerBridge.setPlayerNumber(videoType, num);
|
|
1292
1345
|
}else{
|
|
@@ -1294,10 +1347,37 @@ function setJsvPlayerNumber(videoType, num){
|
|
|
1294
1347
|
}
|
|
1295
1348
|
}
|
|
1296
1349
|
|
|
1350
|
+
function setJsvPlayerDebugMode(mode){
|
|
1351
|
+
logTrace("setJsvPlayerDebugMode, mode="+mode);
|
|
1352
|
+
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1353
|
+
window.jsvPlayerBridge.setDebugMode(null, mode);
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
function getJsvPlayerRunningNum(){
|
|
1358
|
+
logTrace("getJsvPlayerRunningNum");
|
|
1359
|
+
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1360
|
+
return window.jsvPlayerBridge.getRunningPlayerNum();
|
|
1361
|
+
}
|
|
1362
|
+
return -1;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
function setOperator(operator){
|
|
1366
|
+
logTrace("setOperator");
|
|
1367
|
+
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1368
|
+
return window.jsvPlayerBridge.setOperator(operator);
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
function globalLoadSetOperator(operator){
|
|
1373
|
+
setOperator(operator)
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1297
1376
|
export {
|
|
1298
1377
|
JsvMediaVideo,
|
|
1299
1378
|
JsvMediaAudio,
|
|
1300
1379
|
globalLoadJsvPlayerPlugin,
|
|
1380
|
+
globalLoadSetOperator,
|
|
1301
1381
|
findMediaObjectByKey,
|
|
1302
1382
|
getJsvPlayerCapabilitySet,
|
|
1303
1383
|
setJsvPlayerNumber,
|
|
@@ -1307,4 +1387,7 @@ export {
|
|
|
1307
1387
|
logWarning,
|
|
1308
1388
|
logDebug,
|
|
1309
1389
|
logTrace,
|
|
1390
|
+
setJsvPlayerDebugMode,
|
|
1391
|
+
getJsvPlayerRunningNum,
|
|
1392
|
+
setOperator,
|
|
1310
1393
|
}
|
|
@@ -18,6 +18,13 @@ export default {
|
|
|
18
18
|
* 属性,String类型,播放器实例索引,同样的key使用同一个播放器实例。
|
|
19
19
|
*/
|
|
20
20
|
playerKey: { type: String, default: null},
|
|
21
|
+
/**
|
|
22
|
+
* 属性,String类型,播放器窗口模式,默认resizable模式。
|
|
23
|
+
* full:观影模式,全屏方式,不建议修改w/h/l/t,视频清晰度/流畅度最佳;
|
|
24
|
+
* resizable:可变窗口模式,可以随意修改w/h/l/t,支持动画效果,视频清晰度/流畅度表现可能不如full模式;
|
|
25
|
+
* pip:画中画模式,只在支持多路硬解的情况下使用,用户画中画的小窗播放,对清晰度/流畅度要求较差,可能会有反交错问题。
|
|
26
|
+
*/
|
|
27
|
+
windowMode: {type: String, default: "resizable"},
|
|
21
28
|
/**
|
|
22
29
|
* 属性,int类型,底层使用的播放器类型。1:系统播放器;2:jsv播放器。默认2。
|
|
23
30
|
*/
|
|
@@ -49,11 +56,21 @@ export default {
|
|
|
49
56
|
/**
|
|
50
57
|
* 属性,Boolean类型,是否保留最后一帧,true保留,false不保留。
|
|
51
58
|
*/
|
|
52
|
-
keepLastFrame: {type: Boolean, default:
|
|
59
|
+
keepLastFrame: {type: Boolean, default: true},
|
|
53
60
|
/**
|
|
54
61
|
* 属性,String类型,视频显示比例,origin原始比例显示,full全屏显示,x:y按照指定比例显示。
|
|
55
62
|
*/
|
|
56
63
|
videoAspectRatio: {type: String, default: "origin"},
|
|
64
|
+
/**
|
|
65
|
+
* 属性,JSON Object类型,色度抠像参数,包含color,colorDistance,edgeDistance,greenOffset四个参数,
|
|
66
|
+
* 参考格式:{color: 0x30FF30, colorDistance: 0.15, edgeDistance: 0.4, greenOffset: 0.05}
|
|
67
|
+
* color,色值,int类型,为抠图色值范围的中心点,格式为0xRRGGBB。
|
|
68
|
+
* colorDistance,float类型,色域范围,范围0-1.0。
|
|
69
|
+
* edgeDistance,float类型,alpha透明度距离,范围colorDistance-1.0,从colorDistance到edgeDistance的alpha值从1.0-0线性递减。
|
|
70
|
+
* greenOffset,float类型,红蓝差值,范围0-1.0。
|
|
71
|
+
* 目前只支持扣绿。
|
|
72
|
+
*/
|
|
73
|
+
chromaKey: {type: Object, default: null},
|
|
57
74
|
/**
|
|
58
75
|
* 回调函数,播放结束时通过此回调接口通知。
|
|
59
76
|
*/
|
|
@@ -226,7 +243,7 @@ export default {
|
|
|
226
243
|
let first_create = true;
|
|
227
244
|
|
|
228
245
|
if(!this.video){
|
|
229
|
-
this.video = new JsvMediaVideo(this.holeId, player_type, key, background, designMap.width, this.decodeType);
|
|
246
|
+
this.video = new JsvMediaVideo(this.holeId, this.windowMode, player_type, key, background, designMap.width, this.decodeType);
|
|
230
247
|
}else{
|
|
231
248
|
this.video.setRef();
|
|
232
249
|
first_create = false;
|
|
@@ -255,13 +272,17 @@ export default {
|
|
|
255
272
|
this.video.loop = this.loop;
|
|
256
273
|
}
|
|
257
274
|
|
|
258
|
-
if(this.keepLastFrame){
|
|
275
|
+
if(!this.keepLastFrame){
|
|
259
276
|
this.video.keepLastFrame = this.keepLastFrame;
|
|
260
277
|
}
|
|
261
278
|
|
|
262
279
|
if(this.videoAspectRatio !== "origin"){
|
|
263
280
|
this.video.videoAspectRatio = this.videoAspectRatio;
|
|
264
281
|
}
|
|
282
|
+
|
|
283
|
+
if(this.chromaKey && this.chromaKey !== ""){
|
|
284
|
+
this.video.setChromaKey(this.chromaKey)
|
|
285
|
+
}
|
|
265
286
|
//}else{
|
|
266
287
|
if(!first_create){
|
|
267
288
|
this.video.setHoleID(this.holeId);
|
|
@@ -279,6 +300,7 @@ export default {
|
|
|
279
300
|
unmounted(){
|
|
280
301
|
if(this.video != null){
|
|
281
302
|
this.video.releasePlayer();
|
|
303
|
+
|
|
282
304
|
this.onRef?.(null)
|
|
283
305
|
}
|
|
284
306
|
},
|
|
@@ -2,10 +2,17 @@
|
|
|
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"
|
|
6
|
+
import { getJsvPlayerRunningNum as getRunningPlayerNum } from "./JsvMedia.js"
|
|
7
|
+
import { globalLoadSetOperator as setOperator } from"./JsvMedia.js"
|
|
5
8
|
let _JsvPlayer = JsvPlayer;
|
|
6
9
|
|
|
7
10
|
let globalLoadJsvPlayerPlugin = initPlugin;
|
|
8
11
|
let getJsvPlayerCapabilitySet = getCapabilitySet;
|
|
12
|
+
let setJsvPlayerDebugMode = setDebugMode;
|
|
13
|
+
let getJsvPlayerRunningNum = getRunningPlayerNum;
|
|
14
|
+
let globalLoadSetOperator = setOperator;
|
|
15
|
+
|
|
9
16
|
if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
|
|
10
17
|
// 浏览器版本
|
|
11
18
|
_JsvPlayer = window.JsvWidgetWrapperGroup.BrowserJsvPlayer;
|
|
@@ -19,6 +26,18 @@ if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
|
|
|
19
26
|
getJsvPlayerCapabilitySet = () => {
|
|
20
27
|
return null;
|
|
21
28
|
}
|
|
29
|
+
|
|
30
|
+
setJsvPlayerDebugMode = () => {
|
|
31
|
+
console.log("Set debug mode");
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
getJsvPlayerRunningNum = () => {
|
|
35
|
+
return -1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
globalLoadSetOperator = (operator)=>{
|
|
39
|
+
|
|
40
|
+
}
|
|
22
41
|
}
|
|
23
42
|
|
|
24
43
|
let component = _JsvPlayer.default;
|
|
@@ -27,5 +46,7 @@ export default component;
|
|
|
27
46
|
export {
|
|
28
47
|
globalLoadJsvPlayerPlugin, // 全局初始化播放器插件处理
|
|
29
48
|
getJsvPlayerCapabilitySet, //获取设备能力集
|
|
30
|
-
|
|
49
|
+
setJsvPlayerDebugMode, //设置调试模式,可以查看帧率等信息
|
|
50
|
+
getJsvPlayerRunningNum, //获取正在运行的播放器个数
|
|
51
|
+
globalLoadSetOperator,// 设置运营商
|
|
31
52
|
}
|
|
@@ -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
|
-
versionCodeMin:
|
|
7
|
-
versionCodeMax:
|
|
5
|
+
version:"1.8.5", //插件需要的版本号
|
|
6
|
+
versionCodeMin:185,
|
|
7
|
+
versionCodeMax:185,
|
|
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:"7419da6cf1d0fd294540044e90d1a0e7"
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
// 不要用export default,update-env脚本不能解析
|