@shijiu/jsview-vue 0.9.631 → 0.9.766

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 (140) hide show
  1. package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
  2. package/dom/bin/jsview-dom.min.js +1 -1
  3. package/dom/bin/jsview-engine-js-browser.min.js +1 -0
  4. package/dom/bin/jsview-forge-define.min.js +1 -1
  5. package/dom/jsv-engine-js-browser.js +6 -0
  6. package/dom/target_core_revision.js +4 -4
  7. package/loader/loader.js +4 -0
  8. package/package.json +1 -1
  9. package/patches/node_modules/@vue/cli-service/lib/config/base.js +1 -1
  10. package/samples/AnimPicture/App.vue +5 -5
  11. package/samples/Basic/components/div/DivLayout.vue +1 -1
  12. package/samples/Basic/components/img/ImageGroup.vue +2 -2
  13. package/samples/Basic/components/img/ImgLayout.vue +79 -15
  14. package/samples/Basic/components/text/TextDirection.vue +104 -0
  15. package/samples/Basic/components/text/TextEmoji.vue +1 -1
  16. package/samples/Basic/components/text/TextGroup1.vue +1 -1
  17. package/samples/Basic/components/text/TextGroup2.vue +11 -1
  18. package/samples/Basic/components/text/TextOverflow.vue +8 -3
  19. package/samples/BasicFocusControl/components/BaseBlock.vue +2 -2
  20. package/samples/Collision/App.vue +11 -11
  21. package/samples/DemoHomepage/App.vue +43 -8
  22. package/samples/DemoHomepage/router.js +18 -10
  23. package/samples/DemoHomepage/views/Homepage.vue +83 -96
  24. package/samples/FilterDemo/App.vue +1 -1
  25. package/samples/FlipCard/App.vue +2 -2
  26. package/samples/FlipCard/FlipCard.vue +3 -3
  27. package/samples/GridDemo/App.vue +3 -3
  28. package/samples/GridDemo/ButtonBlock.vue +2 -2
  29. package/samples/GridDemo/FocusItem.vue +2 -2
  30. package/samples/GridDemo/Item.vue +1 -1
  31. package/samples/HashHistory/App.vue +10 -3
  32. package/samples/HashHistory/components/Item.vue +1 -1
  33. package/samples/ImpactStop/App.vue +15 -11
  34. package/samples/Input/InputPanel.vue +1 -1
  35. package/samples/LongImage/Button.vue +1 -1
  36. package/samples/LongImage/ButtonItem.vue +1 -1
  37. package/samples/LongImage/LongImageScroll.vue +2 -2
  38. package/samples/LongText/App.vue +1 -1
  39. package/samples/LongText/Button.vue +1 -1
  40. package/samples/LongText/ButtonItem.vue +1 -1
  41. package/samples/LongText/LongTextScroll.vue +3 -3
  42. package/samples/Marquee/App.vue +176 -40
  43. package/samples/Marquee/longText.js +14 -0
  44. package/samples/MetroWidgetDemos/Advanced/App.vue +5 -6
  45. package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +4 -4
  46. package/samples/MetroWidgetDemos/Advanced/Buttons.vue +5 -5
  47. package/samples/MetroWidgetDemos/Advanced/Mixed.vue +4 -4
  48. package/samples/MetroWidgetDemos/Advanced/widgets/Item.vue +82 -0
  49. package/samples/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +88 -0
  50. package/samples/MetroWidgetDemos/Advanced/{Widgets.vue → widgets/Widgets.vue} +56 -11
  51. package/samples/MetroWidgetDemos/Advanced/widgets/focus1.png +0 -0
  52. package/samples/MetroWidgetDemos/Item.vue +4 -2
  53. package/samples/MetroWidgetDemos/PerformanceTest/App.vue +4 -4
  54. package/samples/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +1 -1
  55. package/samples/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +3 -3
  56. package/samples/MetroWidgetDemos/PingPong/AppPage.vue +2 -2
  57. package/samples/MetroWidgetDemos/PingPong/TabItem.vue +1 -1
  58. package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +3 -3
  59. package/samples/MetroWidgetDemos/Simple/AbsoluteTemplate.vue +2 -2
  60. package/samples/MetroWidgetDemos/Simple/App.vue +2 -2
  61. package/samples/MetroWidgetDemos/Simple/RelativeTemplate.vue +6 -6
  62. package/samples/MetroWidgetDemos/WidgetItem.vue +2 -3
  63. package/samples/MetroWidgetDemos/data.js +2 -1
  64. package/samples/NinePatchDemo/App.vue +2 -2
  65. package/samples/NinePatchDemo/Item.vue +2 -2
  66. package/samples/Preload/App.vue +1 -1
  67. package/samples/Preload/Item.vue +1 -1
  68. package/samples/QrcodeDemo/App.vue +1 -1
  69. package/samples/ScaleDownNeon/App.vue +107 -0
  70. package/samples/SoundPool/App.vue +3 -3
  71. package/samples/SpriteImage/App.vue +5 -0
  72. package/samples/TextBox/App.vue +9 -82
  73. package/samples/TextBox/RenderCenter.vue +40 -16
  74. package/samples/TextBox/RenderLeft.vue +48 -19
  75. package/samples/TextBox/RenderOneLine.vue +30 -49
  76. package/samples/TextBox/RenderRight.vue +40 -16
  77. package/samples/TextShadowDemo/App.vue +11 -17
  78. package/samples/TextureAnimation/App2.vue +1 -1
  79. package/samples/TextureSize/App.vue +3 -3
  80. package/samples/ThrowMoveDemo/LRParabolicDemo.vue +33 -47
  81. package/samples/TouchSample/MetroWidgetHorizontal.vue +1 -1
  82. package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
  83. package/samples/TransitPage/App.vue +1 -1
  84. package/samples/VideoDemo/App.vue +8 -8
  85. package/samples/VideoDemo/components/Button.vue +1 -1
  86. package/samples/VideoDemo/components/Controllor.vue +1 -1
  87. package/samples/VisibleSensorDemo/App.vue +3 -3
  88. package/scripts/jsview-run-android.js +5 -4
  89. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +4 -4
  90. package/utils/JsViewEngineWidget/MetroWidget/Const.js +11 -0
  91. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +245 -111
  92. package/utils/JsViewEngineWidget/TemplateParser.js +227 -178
  93. package/utils/JsViewEngineWidget/WidgetCommon.js +14 -6
  94. package/utils/JsViewEngineWidget/index.js +3 -2
  95. package/utils/JsViewPlugin/BrowserPluginLoader.js +4 -2
  96. package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +302 -0
  97. package/utils/JsViewPlugin/JsvAudio/CheckType.js +68 -0
  98. package/utils/JsViewPlugin/JsvAudio/Events.js +17 -0
  99. package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +176 -0
  100. package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +40 -0
  101. package/utils/JsViewPlugin/JsvAudio/JsvAudioBrowser.vue +46 -0
  102. package/utils/JsViewPlugin/JsvAudio/PluginLoader.js +140 -0
  103. package/utils/JsViewPlugin/JsvAudio/index.js +26 -0
  104. package/utils/JsViewPlugin/JsvAudio/version.js +24 -0
  105. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +61 -12
  106. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +8 -1
  107. package/utils/JsViewPlugin/JsvPlayer/index.js +14 -0
  108. package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
  109. package/utils/JsViewVueTools/JsvHashHistory.js +34 -8
  110. package/utils/JsViewVueTools/JsvImpactTracer.js +2 -2
  111. package/utils/JsViewVueTools/JsvRuntimeBridge.js +46 -8
  112. package/utils/JsViewVueTools/JsvStyleClass.js +9 -0
  113. package/utils/JsViewVueTools/JsvTextTools.js +18 -0
  114. package/utils/JsViewVueTools/TypeCheckAndSet.js +3 -3
  115. package/utils/JsViewVueTools/index.js +2 -1
  116. package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserTextureAnim.vue +5 -7
  117. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +20 -22
  118. package/utils/JsViewVueWidget/JsvApic/JsvApic.vue +4 -4
  119. package/utils/JsViewVueWidget/JsvGrid.vue +1 -9
  120. package/utils/JsViewVueWidget/JsvInput/Cursor.vue +1 -1
  121. package/utils/JsViewVueWidget/JsvMarquee.vue +188 -205
  122. package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +1 -1
  123. package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +35 -27
  124. package/utils/JsViewVueWidget/JsvNinePatch.vue +63 -54
  125. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +10 -5
  126. package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +2 -2
  127. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +21 -5
  128. package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +23 -3
  129. package/utils/JsViewVueWidget/JsvTextBox.vue +27 -84
  130. package/utils/JsViewVueWidget/JsvTouchContainer.vue +5 -6
  131. package/utils/JsViewVueWidget/JsvTransparentDiv.vue +1 -1
  132. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +5 -5
  133. package/utils/JsViewVueWidget/index.js +8 -8
  134. package/utils/JsViewEngineWidget/MetroPage.js +0 -2128
  135. package/utils/JsViewEngineWidget/SimpleWidget/ContentView.vue +0 -51
  136. package/utils/JsViewEngineWidget/SimpleWidget/Dispatcher.js +0 -19
  137. package/utils/JsViewEngineWidget/SimpleWidget/DivWrapper.vue +0 -53
  138. package/utils/JsViewEngineWidget/SimpleWidget/ItemView.vue +0 -142
  139. package/utils/JsViewEngineWidget/SimpleWidget/RootView.vue +0 -140
  140. package/utils/JsViewEngineWidget/SimpleWidget/SimpleWidget.vue +0 -1629
@@ -0,0 +1,140 @@
1
+ /*
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-02-27 20:04:28
4
+ * @Description: file content
5
+ */
6
+ import PluginInfo from './version';
7
+
8
+ class PluginLoader {
9
+ constructor() {
10
+ this.onDoneListener = [];
11
+ this.pluginLoadListener = [];
12
+ this.pluginInfo = this.getPluginInfo();
13
+ /**
14
+ * 0:未加载;
15
+ * 1:开始加载;
16
+ * 2:加载旧插件;
17
+ * 3:加载新插件;
18
+ * 4:加载成功;
19
+ * 5:加载失败。
20
+ */
21
+ this.status = 0;
22
+ }
23
+
24
+ getPluginInfo() {
25
+ let info = PluginInfo;
26
+ /** 获取下载链接 */
27
+ if (typeof window.jJsvRuntimeBridge !== 'undefined' && window.jJsvRuntimeBridge && typeof window.jJsvRuntimeBridge.getPluginBaseUrl !== "undefined") {
28
+ let plugin_base_url = window.jJsvRuntimeBridge.getPluginBaseUrl();
29
+ if (plugin_base_url) {
30
+ info.downloadUrl = (plugin_base_url[plugin_base_url.length - 1] === "/" ? plugin_base_url : (plugin_base_url + "/")) + info.packageName + "/JsvAudio-" + info.versionCodeMax + ".dat?md5=" + info.md5;
31
+ }
32
+ }
33
+ return info;
34
+ }
35
+
36
+ registerOnDoneListener(listener) {
37
+ if (listener) {
38
+ this.onDoneListener.push(listener);
39
+ }
40
+ }
41
+
42
+ /**
43
+ * listener回调处理中参数信息的说明:
44
+ * 插件加载状态回调。
45
+ * 回调函数的参数定义如下:
46
+ * 1:无法正常加载插件。
47
+ * 2:正在加载旧插件,此时插件加载过程很短,可以不用出现用户提示界面。
48
+ * 3:正在加载新插件,此时插件需要经历下载、解压等过程,用时较长,可以考虑给用户相关提示。
49
+ * 4:插件加载完成。
50
+ * 5:已加载不同版本的插件,此版本无法加载。
51
+ *
52
+ * 备注:不管插件加载处于什么状态,都可以正常使用播放器组件,播放器对象在插件未加载完成的情况下,会把相关状态保存,等完成加载后再自动下发。
53
+ */
54
+ loadPlugin(listener) {
55
+ console.log("globalLoadJsvAudioPlugin");
56
+ let plugin_status = 0;
57
+ if (typeof window.jPluginManagerBridge === 'undefined' || !window.jPluginManagerBridge) {
58
+ plugin_status = 1;
59
+ } else if (this.status === 2) {
60
+ plugin_status = 2;
61
+ } else if (this.status === 3) {
62
+ plugin_status = 3;
63
+ } else if (this.status === 4) {
64
+ plugin_status = 4;
65
+ } else if (this.status === 5) {
66
+ plugin_status = 1;
67
+ }
68
+
69
+ if (plugin_status !== 0) {
70
+ if (typeof listener !== "undefined" && listener) {
71
+ setTimeout(() => { listener(plugin_status) }, 0);
72
+ }
73
+ return;
74
+ }
75
+
76
+ if (typeof listener !== "undefined" && listener) {
77
+ this.pluginLoadListener.push(listener);
78
+ }
79
+
80
+ if (this.status > 0) {
81
+ return;
82
+ }
83
+ this.status = 1;
84
+
85
+ window.jPluginManagerBridge.LoadPlugin(JSON.stringify(this.pluginInfo));
86
+ }
87
+
88
+ onStatusChange(status) {
89
+ console.log("JsvAudioPluginStatus: " + status);
90
+ let ret = JSON.parse(status);
91
+
92
+ let plugin_status = 2;
93
+ if (ret && ret.first_load) {
94
+ this.status = 3;
95
+ plugin_status = 3;
96
+ } else {
97
+ this.status = 2;
98
+ }
99
+
100
+ for (let i = 0; i < this.pluginLoadListener.length; i++) {
101
+ this.pluginLoadListener[i](plugin_status);
102
+ }
103
+ }
104
+
105
+ onLoadDone(result) {
106
+ console.log("JsvAudioPluginLoadResult: " + result);
107
+ let ret_obj = JSON.parse(result)
108
+ let plugin_status = 1;
109
+ if (ret_obj && (ret_obj.status === 4 || ret_obj.status === 1)) {
110
+ this.status = 4;
111
+ plugin_status = 4;
112
+ } else if (ret_obj && ret_obj.status === -12) {
113
+ this.status = 5;
114
+ plugin_status = 5;
115
+ } else {
116
+ this.status = 5;
117
+ }
118
+
119
+ if (this.status === 5) {
120
+ console.log("*************************JsvAudio plugin load failed, error code is " + ret_obj.status + "*************************");
121
+ }
122
+
123
+ for (let i = 0; i < this.pluginLoadListener.length; i++) {
124
+ this.pluginLoadListener[i](plugin_status);
125
+ }
126
+
127
+ for (let listener of this.onDoneListener) {
128
+ listener(plugin_status);
129
+ }
130
+ }
131
+
132
+ registerGlobalListener() {
133
+ window.top.JsvAudioPluginStatus = this.onStatusChange.bind(this);
134
+ window.top.JsvAudioPluginLoadResult = this.onLoadDone.bind(this);
135
+ }
136
+ }
137
+
138
+ const sPluginLoader = new PluginLoader();
139
+ sPluginLoader.registerGlobalListener();
140
+ export default sPluginLoader;
@@ -0,0 +1,26 @@
1
+ /*
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-02-28 10:18:42
4
+ * @Description: file content
5
+ */
6
+ import sPluginLoader from "./PluginLoader.js";
7
+ import JsvAudio from "./JsvAudio.vue"
8
+
9
+ let globalLoadJsvAudioPlugin;
10
+ let _JsvAudio;
11
+ if (window.JsvWidgetWrapperGroup?.BrowserJsvAudio) {
12
+ //browser
13
+ globalLoadJsvAudioPlugin = (listener) => {
14
+ setTimeout(listener, 0);
15
+ };
16
+ _JsvAudio = window.JsvWidgetWrapperGroup.BrowserJsvAudio.default;
17
+ } else {
18
+ //jsview
19
+ globalLoadJsvAudioPlugin = sPluginLoader.loadPlugin.bind(sPluginLoader);
20
+ _JsvAudio = JsvAudio;
21
+ }
22
+
23
+ export {
24
+ _JsvAudio as default,
25
+ globalLoadJsvAudioPlugin,
26
+ }
@@ -0,0 +1,24 @@
1
+ /*
2
+ * @Author: ChenChanghua
3
+ * @Date: 2023-02-22 18:22:26
4
+ * @Description: file content
5
+ */
6
+ let PluginInfo={
7
+ // downloadUrl:"http://192.168.0.63:8080/plugin/JsvAudio-164.zip", //插件下载地址
8
+ packageName:"com.qcode.jsvaudio",
9
+ name:"音频插件",
10
+ version:"1.0.1", //插件需要的版本号
11
+ versionCodeMin:1,
12
+ versionCodeMax:1,
13
+ bridgeName:"jsvAudioBridge", //插件bridge注册到jsview的名称
14
+ className:"com.qcode.jsvaudio.JsvAudio", //插件初始化类名称
15
+ initMethod:"createInstance", //插件初始化方法
16
+ listener:"top.JsvAudioPluginLoadResult", //插件加载结果回调
17
+ listener2: "top.JsvAudioPluginStatus",
18
+ // debug:true,
19
+ // md5:"baafc8ea737adcad5443f44cc0112498"
20
+ };
21
+
22
+ // 不要用export default,update-env脚本不能解析
23
+ // 导出字段要含有 pluginVersionInfo 信息,作为npm时版本参考
24
+ module.exports = PluginInfo;
@@ -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 = {
@@ -220,6 +220,7 @@ class JsvBaseMedia {
220
220
  this.type = type;
221
221
  this.playerCreate = false;
222
222
  this.key = key;
223
+ this.windowMode = window_mode;
223
224
  this.background = background;
224
225
  this.holeId = hole_id;
225
226
  this.holeIdModify = hole_id;
@@ -266,7 +267,7 @@ class JsvBaseMedia {
266
267
 
267
268
  let share_view = true;
268
269
 
269
- 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");
270
271
  if(result > 0){
271
272
  this.initPlayer();
272
273
  }
@@ -846,7 +847,7 @@ class JsvBaseMedia {
846
847
  * 属性,string类型,播放地址,不支持读取。
847
848
  */
848
849
  set src(value) {
849
- this.setSrc(value, null, 1)
850
+ this.setSrc(value, null, null, 1)
850
851
  }
851
852
 
852
853
  /**
@@ -895,17 +896,26 @@ class JsvBaseMedia {
895
896
  /**
896
897
  * 设置播放地址。
897
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:画中画模式,只在支持多路硬解的情况下使用,用户画中画的小窗播放,对清晰度/流畅度要求较差,可能会有反交错问题。
898
904
  * @param {string} head 网络请求的head信息,可以为NULL。
899
- * @param {int} type 类型,1表示点播,2表示直播,3表示时移,默认1。
905
+ * @param {int} type 类型,1表示点播,2表示直播,3表示时移,4表示回看,默认1。
900
906
  * @param {double} timeShift 时移时间,只有在type=3时才有效,表示从当前时间时移多长时间,单位秒。
901
907
  * @param {int} 分辨率类型 0:unknown或其它;1:标清;2:高清;3:超清(720P);4:蓝光(1080P);5:2K;6:4K;7:8K。
908
+ * @param {int} 用户频道号,只在直播回看状态下需要设置
902
909
  */
903
- setSrc(url, head, type, timeShift, resolution){
910
+ setSrc(url, windowMode, head, type, timeShift, resolution, mixNo){
904
911
  let src = {};
905
912
  src.url = url;
906
913
  if(head){
907
914
  src.head = head;
908
915
  }
916
+ if(windowMode){
917
+ src.windowMode = windowMode;
918
+ }
909
919
  if(type){
910
920
  src.type = type;
911
921
  }else{
@@ -919,6 +929,10 @@ class JsvBaseMedia {
919
929
  src.resolution = resolution;
920
930
  }
921
931
 
932
+ if(mixNo && typeof mixNo == "number"){
933
+ src.channelID = mixNo;
934
+ }
935
+
922
936
  this.currentEventStatus = EVENT_STATUS_NONE;
923
937
  this.setState("src", JSON.stringify(src), "string");
924
938
  this.eventReport = true;
@@ -1186,6 +1200,19 @@ class JsvBaseMedia {
1186
1200
  }
1187
1201
  }
1188
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
+
1189
1216
  /**
1190
1217
  * 私有接口,外部不需要调用此接口。
1191
1218
  */
@@ -1241,21 +1268,21 @@ class JsvBaseMedia {
1241
1268
  }
1242
1269
 
1243
1270
  class JsvMedia extends JsvBaseMedia {
1244
- constructor(type, hole_id, player_type, key, background, design_map_width, decode_type) {
1245
- 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);
1246
1273
  //super.buildPlatformInstance(type);
1247
1274
  }
1248
1275
  }
1249
1276
 
1250
1277
  class JsvMediaAudio extends JsvMedia {
1251
1278
  constructor() {
1252
- super("audio", null, null, null, null, null, 0);
1279
+ super("audio", "resizable", null, null, null, null, null, 0);
1253
1280
  }
1254
1281
  }
1255
1282
 
1256
1283
  class JsvMediaVideo extends JsvMedia {
1257
- constructor(hole_id, player_type, key, background, design_map_width, decode_type) {
1258
- 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);
1259
1286
 
1260
1287
  this.state.aspectRatio = 'origin'; // 'origin', 'full', '16:9', '4:3',
1261
1288
  }
@@ -1321,16 +1348,36 @@ function setJsvPlayerNumber(videoType, num){
1321
1348
  }
1322
1349
 
1323
1350
  function setJsvPlayerDebugMode(mode){
1324
- logTrace("setDebugMode, mode="+mode);
1351
+ logTrace("setJsvPlayerDebugMode, mode="+mode);
1325
1352
  if(typeof window.jsvPlayerBridge !== "undefined"){
1326
- return window.jsvPlayerBridge.setDebugMode(null, mode);
1353
+ window.jsvPlayerBridge.setDebugMode(null, mode);
1327
1354
  }
1328
1355
  }
1329
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
+
1330
1376
  export {
1331
1377
  JsvMediaVideo,
1332
1378
  JsvMediaAudio,
1333
1379
  globalLoadJsvPlayerPlugin,
1380
+ globalLoadSetOperator,
1334
1381
  findMediaObjectByKey,
1335
1382
  getJsvPlayerCapabilitySet,
1336
1383
  setJsvPlayerNumber,
@@ -1341,4 +1388,6 @@ export {
1341
1388
  logDebug,
1342
1389
  logTrace,
1343
1390
  setJsvPlayerDebugMode,
1391
+ getJsvPlayerRunningNum,
1392
+ setOperator,
1344
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
  */
@@ -236,7 +243,7 @@ export default {
236
243
  let first_create = true;
237
244
 
238
245
  if(!this.video){
239
- 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);
240
247
  }else{
241
248
  this.video.setRef();
242
249
  first_create = false;
@@ -3,11 +3,15 @@ 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
5
  import { setJsvPlayerDebugMode as setDebugMode } from "./JsvMedia.js"
6
+ import { getJsvPlayerRunningNum as getRunningPlayerNum } from "./JsvMedia.js"
7
+ import { globalLoadSetOperator as setOperator } from"./JsvMedia.js"
6
8
  let _JsvPlayer = JsvPlayer;
7
9
 
8
10
  let globalLoadJsvPlayerPlugin = initPlugin;
9
11
  let getJsvPlayerCapabilitySet = getCapabilitySet;
10
12
  let setJsvPlayerDebugMode = setDebugMode;
13
+ let getJsvPlayerRunningNum = getRunningPlayerNum;
14
+ let globalLoadSetOperator = setOperator;
11
15
 
12
16
  if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
13
17
  // 浏览器版本
@@ -26,6 +30,14 @@ if (window.JsvWidgetWrapperGroup?.BrowserJsvPlayer) {
26
30
  setJsvPlayerDebugMode = () => {
27
31
  console.log("Set debug mode");
28
32
  }
33
+
34
+ getJsvPlayerRunningNum = () => {
35
+ return -1;
36
+ }
37
+
38
+ globalLoadSetOperator = (operator)=>{
39
+ console.log("operator is "+operator);
40
+ }
29
41
  }
30
42
 
31
43
  let component = _JsvPlayer.default;
@@ -35,4 +47,6 @@ export {
35
47
  globalLoadJsvPlayerPlugin, // 全局初始化播放器插件处理
36
48
  getJsvPlayerCapabilitySet, //获取设备能力集
37
49
  setJsvPlayerDebugMode, //设置调试模式,可以查看帧率等信息
50
+ getJsvPlayerRunningNum, //获取正在运行的播放器个数
51
+ globalLoadSetOperator,// 设置运营商
38
52
  }
@@ -1,17 +1,17 @@
1
1
  let PluginInfo={
2
- // downloadUrl:"http://192.168.0.63:8080/plugin/JsvPlayer-164.zip", //插件下载地址
2
+ // downloadUrl:"http://10.61.2.170:8080/plugin/JsvPlayer-194.zip", //插件下载地址
3
3
  packageName:"com.qcode.jsvplayer",
4
4
  name:"播放器插件",
5
- version:"1.6.7", //插件需要的版本号
6
- versionCodeMin:167,
7
- versionCodeMax:167,
5
+ version:"1.9.6", //插件需要的版本号
6
+ versionCodeMin:196,
7
+ versionCodeMax:196,
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:"19b065b6d4d2acdbaf6093c4864fea22"
14
+ md5:"e671a5c28a8fece02115625430c6b56d"
15
15
  };
16
16
 
17
17
  // 不要用export default,update-env脚本不能解析
@@ -1,8 +1,8 @@
1
- import { createMemoryHistory, createWebHashHistory } from "vue-router";
1
+ import { createMemoryHistory, createWebHashHistory } from "vue-router";
2
2
 
3
3
  class JsvHashHistory {
4
4
  constructor(base) {
5
- if(window.jsvIsBrowserDebug) {
5
+ if (window.jsvIsBrowserDebug) {
6
6
  this.#history = createWebHashHistory(base)
7
7
  } else {
8
8
  this.#history = this.#createMockHashHistory(base);
@@ -32,7 +32,7 @@ class JsvHashHistory {
32
32
  replace(to, data) {
33
33
  this.#history.replace(to, data);
34
34
  this.#updateLocation(this.#history.location);
35
- }
35
+ }
36
36
 
37
37
  push(to, data) {
38
38
  this.#history.push(to, data);
@@ -52,20 +52,23 @@ class JsvHashHistory {
52
52
  // 抄 createWebHashHistory 作业
53
53
  base = location.host ? base || location.pathname + location.search : '';
54
54
  if (!base.includes('#'))
55
- base += '#';
55
+ base += '#';
56
56
  if (!base.endsWith('#/') && !base.endsWith('#')) {
57
- console.warn(`A hash base must end with a "#":\n"${base}" should be "${base.replace(/#.*$/, '#')}".`);
57
+ console.warn(`A hash base must end with a "#":\n"${base}" should be "${base.replace(/#.*$/, '#')}".`);
58
58
  }
59
59
 
60
60
  this.baseURL = window.location.origin + base;
61
61
 
62
62
  const history = createMemoryHistory(base)
63
63
  const initHash = this.#getInitHash();
64
- if(initHash) {
64
+ if (initHash) {
65
65
  // 已设置hash,替换到hash页面
66
66
  history.replace({
67
67
  path: initHash.substring(1),// 去除#
68
- query: window.location.search
68
+
69
+ // 测试链接: http://192.168.2.179:8082/js/main.jsv.js?bcd=333&xyz=456#/feature/Basic?aa=1&bb=2
70
+ // App 中获取的 router.currentRoute.query的内容为 {aa:1, bb:2}
71
+ query: this.#splitSearch(window.location.hash)
69
72
  });
70
73
  } else {
71
74
  // 未设置hash定位,追加hash根的显示
@@ -95,7 +98,7 @@ class JsvHashHistory {
95
98
  }
96
99
 
97
100
  #updateLocation(location) {
98
- if(!window.jsvIsBrowserDebug) {
101
+ if (!window.jsvIsBrowserDebug) {
99
102
  const url = new window.JsView.Dom.UrlRef(
100
103
  location ? this.baseURL + location : this.baseURL,
101
104
  true
@@ -104,6 +107,29 @@ class JsvHashHistory {
104
107
  }
105
108
  }
106
109
 
110
+ #splitSearch(hash) {
111
+ if (!hash || hash.length == 0) {
112
+ return {};
113
+ } else {
114
+ let hashSearchIndex = hash.indexOf('?');
115
+ if (hashSearchIndex >= 0) {
116
+ let arr = hash.substr(hashSearchIndex + 1).split('&');
117
+ let target = {};
118
+ for (let i = 0; i < arr.length; i++) {
119
+ let num = arr[i].indexOf("=");
120
+ if (num > 0) {
121
+ let name = arr[i].substring(0, num);
122
+ let value = arr[i].substr(num + 1);
123
+ target[name] = value;
124
+ }
125
+ }
126
+ return target;
127
+ } else {
128
+ return {};
129
+ }
130
+ }
131
+ }
132
+
107
133
  #history;
108
134
  }
109
135
 
@@ -40,7 +40,7 @@ function createImpactCallback(on_contact, on_dis_contact) {
40
40
  * Object 句柄,提供 Recycle() 函数用于停止碰撞检测,需要再componentWillUnmount进行调用(清理)
41
41
  */
42
42
  function createImpactTracer(ele1, ele2, callback, auto_froze) {
43
- return Forge.sImpactSensorManager.StartTrace(ele1.jsvMainView, ele2.jsvMainView, callback, auto_froze);
43
+ return Forge.sImpactSensorManager.StartTrace(ele1.jsvGetProxyView(), ele2.jsvGetProxyView(), callback, auto_froze);
44
44
  }
45
45
 
46
46
  // 创建用于设置碰撞即停管理对象的参数
@@ -49,7 +49,7 @@ function _ConvertToViewsList(elements_array) {
49
49
  const views_array = [];
50
50
  if (elements_array) {
51
51
  for (const ele of elements_array) {
52
- views_array.push(ele.jsvMainView);
52
+ views_array.push(ele.jsvGetProxyView());
53
53
  }
54
54
  }
55
55
  return views_array;
@@ -96,10 +96,10 @@ function getAndroidId(){
96
96
  */
97
97
  function openWindow(url, startup_image, startup_video, startup_duration, add_history){
98
98
  let setting = {};
99
- if(startup_image !== null && startup_image !== "")
99
+ if(typeof startup_image !== undefined && startup_image !== null && startup_image !== "")
100
100
  setting.startupImage = startup_image;
101
101
 
102
- if(startup_video !== null && startup_video !== ""){
102
+ if(typeof startup_video !== undefined && startup_video !== null && startup_video !== ""){
103
103
  setting.startupVideo = startup_video;
104
104
  }
105
105
 
@@ -148,27 +148,50 @@ function getInstalledApps(){
148
148
  */
149
149
  function startNativeApp(package_name, activity, action, uri, flags, param){
150
150
  var obj = {};
151
- if(package_name !== null && package_name !== "")
151
+ if(typeof package_name != undefined && package_name !== null && package_name !== "")
152
152
  obj.packageName = package_name;
153
153
 
154
- if(activity !== null && activity !== "")
154
+ if(typeof activity != undefined && activity !== null && activity !== "")
155
155
  obj.activity = activity;
156
156
 
157
- if(action !== null && action !== "")
157
+ if(typeof action != undefined && action !== null && action !== "")
158
158
  obj.action = action;
159
159
 
160
- if(uri !== null && uri !== "")
160
+ if(typeof uri != undefined && uri !== null && uri !== "")
161
161
  obj.uri = uri;
162
162
 
163
- if(flags !== null && flags.length > 0)
163
+ if(typeof flags != undefined && flags !== null && flags.length > 0)
164
164
  obj.flags = flags;
165
165
 
166
- if(param !== null && param.length > 0)
166
+ if(typeof param != undefined && param !== null && param.length > 0)
167
167
  obj.param = param;
168
168
 
169
169
  direct_call("startNativeApp", JSON.stringify(obj));
170
170
  }
171
171
 
172
+ function sendNativeBroadcast(package_name, broadcast, action, uri, flags, param){
173
+
174
+ var obj = {};
175
+ if(typeof package_name != undefined && package_name !== null && package_name !== "")
176
+ obj.packageName = package_name;
177
+
178
+ if(typeof broadcast != undefined && broadcast !== null && broadcast !== "")
179
+ obj.broadcast = broadcast;
180
+
181
+ if(typeof action != undefined && action !== null && action !== "")
182
+ obj.action = action;
183
+
184
+ if(typeof uri != undefined && uri !== null && uri !== "")
185
+ obj.uri = uri;
186
+
187
+ if(typeof flags != undefined && flags !== null && flags.length > 0)
188
+ obj.flags = flags;
189
+
190
+ if(typeof param != undefined && param !== null && param.length > 0)
191
+ obj.param = param;
192
+ direct_call("sendNativeBroadcast", JSON.stringify(obj));
193
+ }
194
+
172
195
  /**
173
196
  * 获取设备信息
174
197
  * @returns {string} 终端设备信息,JSON数据结构
@@ -178,6 +201,14 @@ function getDeviceInfo() {
178
201
  return direct_call("getDeviceInfo");
179
202
  }
180
203
 
204
+ /**
205
+ * 获取自己的app信息
206
+ * @returns
207
+ */
208
+ function getAppInfo(){
209
+ return direct_call("getAppInfo");
210
+ }
211
+
181
212
  /**
182
213
  * 页面加载成功后调用去除启动图
183
214
  *
@@ -335,6 +366,10 @@ function popupGainFocus() {
335
366
  direct_call("popupGainFocus");
336
367
  }
337
368
 
369
+ function popupDiscardFocus(){
370
+ direct_call("popupGainFocus");
371
+ }
372
+
338
373
  /**
339
374
  * 页面预热接口,预热页面将会将以一个新的FrameLayout(内含JsView)的方式加载一个新的应用
340
375
  * 但这个应用在warmLoadView之前,不会创建texture/surface的实际描画资源,也不会加载图片
@@ -398,7 +433,9 @@ const bridge = {
398
433
  getSystemProperty,
399
434
  getInstalledApps,
400
435
  startNativeApp,
436
+ sendNativeBroadcast,
401
437
  getDeviceInfo,
438
+ getAppInfo,
402
439
  notifyPageLoadDone,
403
440
  notifyPageLoaded,
404
441
  hasFavouriteFunction,
@@ -410,6 +447,7 @@ const bridge = {
410
447
  setPopupInitSize,
411
448
  popupResizePosition,
412
449
  popupGainFocus,
450
+ popupDiscardFocus,
413
451
  warmUpView,
414
452
  warmLoadView,
415
453
  closeWarmedView