@shijiu/jsview-vue 2.1.5 → 2.1.23

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 (31) hide show
  1. package/package.json +1 -1
  2. package/utils/JsViewEngineWidget/JsvFocusBlock.vue +22 -1
  3. package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +6 -0
  4. package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +24 -15
  5. package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +3 -3
  6. package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +20 -0
  7. package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +1847 -0
  8. package/utils/JsViewPlugin/JsvPlayer/JsvMediaBrowserInterface.js +101 -0
  9. package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +369 -0
  10. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser-0.9.vue +53 -0
  11. package/utils/JsViewPlugin/JsvPlayer/JsvPlayerBrowser.vue +505 -0
  12. package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +60 -0
  13. package/utils/JsViewPlugin/JsvPlayer/index.js +59 -0
  14. package/utils/JsViewPlugin/JsvPlayer/version.mjs +18 -0
  15. package/utils/JsViewPlugin/index.js +1 -0
  16. package/utils/JsViewVueTools/JsvRuntimeBridge.js +5 -4
  17. package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.js +112 -0
  18. package/utils/JsViewVueWidget/JsvFreeMoveActor/CallbackManager.js +68 -0
  19. package/utils/JsViewVueWidget/JsvFreeMoveActor/CommonTools.js +18 -0
  20. package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +46 -0
  21. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.js +216 -0
  22. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.js +66 -0
  23. package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.js +38 -0
  24. package/utils/JsViewVueWidget/JsvFreeMoveActor/TypeDefine.js +12 -0
  25. package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +3 -0
  26. package/utils/JsViewVueWidget/JsvPosterImage.vue +16 -10
  27. package/utils/JsViewVueWidget/JsvRipple/Constant.js +4 -0
  28. package/utils/JsViewVueWidget/JsvRipple/JsvRipple.vue +134 -0
  29. package/utils/JsViewVueWidget/JsvRipple/index.js +7 -0
  30. package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +55 -68
  31. package/utils/JsViewVueWidget/index.js +2 -0
@@ -0,0 +1,505 @@
1
+ <script>
2
+ import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
3
+ import playerExMethods from "./JsvMediaBrowserInterface.js";
4
+ import { shallowRef } from "vue";
5
+
6
+ let logDebug = console.log;
7
+
8
+ export default {
9
+ props: {
10
+ /**
11
+ * 回调函数,播放器对象通知接口
12
+ * @param {Object} video对象,可以通过此video对象调用video相关属性和方法,具体属性和方法定义见JsvMedia.js文件里相关说明。
13
+ */
14
+ onRef: { type: Function, default: () => {} },
15
+ /**
16
+ * 属性,Boolean类型,true表示自动播放,默认false。
17
+ */
18
+ autoplay: { type: Boolean, default: false },
19
+ /**
20
+ * 属性,String类型,播放器实例索引,同样的key使用同一个播放器实例。
21
+ */
22
+ playerKey: { type: String, default: null },
23
+ /**
24
+ * 属性,String类型,播放器窗口模式,默认resizable模式。
25
+ * full:观影模式,全屏方式,不建议修改w/h/l/t,视频清晰度/流畅度最佳;
26
+ * resizable:可变窗口模式,可以随意修改w/h/l/t,支持动画效果,视频清晰度/流畅度表现可能不如full模式;
27
+ * pip:画中画模式,只在支持多路硬解的情况下使用,用户画中画的小窗播放,对清晰度/流畅度要求较差,可能会有反交错问题。
28
+ */
29
+ windowMode: { type: String, default: "resizable" },
30
+ /**
31
+ * 属性,int类型,底层使用的播放器类型。1:系统播放器;2:jsv播放器。默认2。
32
+ */
33
+ playerType: { type: Number, default: 2 },
34
+ /**
35
+ * 属性,int类型,播放器解码方式。0:根据硬件能力自动匹配;1:硬解码;2:软解码。默认0(根据芯片能力自动匹配)。
36
+ */
37
+ decodeType: { type: Number, default: 0 },
38
+ /**
39
+ * 属性,Boolean类型,层级关系,true表示在界面的下面,false表示在界面上面,默认true。
40
+ */
41
+ background: { type: Boolean, default: true },
42
+ /**
43
+ * 属性,Boolean类型,true表示静音,默认false。
44
+ */
45
+ muted: { type: Boolean, default: false },
46
+ /**
47
+ * 属性,Boolean类型,true表示循环播放,默认false。
48
+ */
49
+ loop: { type: Boolean, default: false },
50
+ /**
51
+ * 属性,String类型,播放地址。
52
+ */
53
+ src: { type: String, default: "" },
54
+ /**
55
+ * 属性,Double类型,起播时间,0-duration。
56
+ */
57
+ currentTime: { type: Number, default: 0 },
58
+ /**
59
+ * 属性,Boolean类型,是否保留最后一帧,true保留,false不保留。
60
+ */
61
+ keepLastFrame: { type: Boolean, default: true },
62
+ /**
63
+ * 属性,String类型,视频显示比例,origin原始比例显示,full全屏显示,x:y按照指定比例显示。
64
+ */
65
+ videoAspectRatio: { type: String, default: "origin" },
66
+ /**
67
+ * 属性,JSON Object类型,色度抠像参数,包含color,colorDistance,edgeDistance,greenOffset四个参数,
68
+ * 参考格式:{color: 0x30FF30, colorDistance: 0.15, edgeDistance: 0.4, greenOffset: 0.05}
69
+ * color,色值,int类型,为抠图色值范围的中心点,格式为0xRRGGBB。
70
+ * colorDistance,float类型,色域范围,范围0-1.0。
71
+ * edgeDistance,float类型,alpha透明度距离,范围colorDistance-1.0,从colorDistance到edgeDistance的alpha值从1.0-0线性递减。
72
+ * greenOffset,float类型,红蓝差值,范围0-1.0。
73
+ * 目前只支持扣绿。
74
+ */
75
+ chromaKey: { type: Object, default: null },
76
+ /**
77
+ * 回调函数,播放结束时通过此回调接口通知。
78
+ */
79
+ onEnded: {
80
+ type: Function,
81
+ default: () => {
82
+ return {};
83
+ },
84
+ },
85
+ /**
86
+ * 回调函数,播放错误时通过此接口通知。
87
+ * @param {int} 错误类型,当前定义了四种错误。1是异常中断;2是网络错误;3是解码错误;4是格式不支持。
88
+ */
89
+ onError: {
90
+ type: Function,
91
+ default: () => {
92
+ return {};
93
+ },
94
+ },
95
+ // onAbort: {type: Function, default: ()=>{return{}}},
96
+ /**
97
+ * 回调函数,当正常播放时,每0.5秒上报一次,回调接口里会带上当前时间,也可以使用video对象的currentTime属性去获取当前时间。
98
+ * @param {Long} 当前播放时间,单位秒。
99
+ */
100
+ onTimeUpdate: {
101
+ type: Function,
102
+ default: () => {
103
+ return {};
104
+ },
105
+ },
106
+ /**
107
+ * 回调函数,开始加载,设置完播放地址后,上报此事件。
108
+ */
109
+ onLoadStart: {
110
+ type: Function,
111
+ default: () => {
112
+ return {};
113
+ },
114
+ },
115
+ /**
116
+ * 回调函数,开始正常播放,同一个播放地址仅触发一次。
117
+ */
118
+ onCanPlayThrough: {
119
+ type: Function,
120
+ default: () => {
121
+ return {};
122
+ },
123
+ },
124
+ /**
125
+ * 回调函数,正常下载,duration不变的情况下只触发一次。
126
+ */
127
+ onProgress: {
128
+ type: Function,
129
+ default: () => {
130
+ return {};
131
+ },
132
+ },
133
+ /**
134
+ * 回调函数,视频准备好后触发。
135
+ */
136
+ onLoadedMetaData: {
137
+ type: Function,
138
+ default: () => {
139
+ return {};
140
+ },
141
+ },
142
+ /**
143
+ * 回调函数,视频准备好后触发,这个时候可以正常seek。
144
+ */
145
+ onLoad: {
146
+ type: Function,
147
+ default: () => {
148
+ return {};
149
+ },
150
+ },
151
+ /**
152
+ * 回调函数,视频准备好后触发,这个时候可以获取duration。
153
+ */
154
+ onDurationChange: {
155
+ type: Function,
156
+ default: () => {
157
+ return {};
158
+ },
159
+ },
160
+ /**
161
+ * 回调函数,视频准备好后,seek(修改currentTime)会出发此事件。
162
+ */
163
+ onSeeking: {
164
+ type: Function,
165
+ default: () => {
166
+ return {};
167
+ },
168
+ },
169
+ /**
170
+ * 回调函数,seek完成后触发此事件。
171
+ */
172
+ onSeeked: {
173
+ type: Function,
174
+ default: () => {
175
+ return {};
176
+ },
177
+ },
178
+ /**
179
+ * 回调函数,缓冲时触发。
180
+ */
181
+ onStalled: {
182
+ type: Function,
183
+ default: () => {
184
+ return {};
185
+ },
186
+ },
187
+ /**
188
+ * 回调函数,正常播放后触发。
189
+ */
190
+ onPlaying: {
191
+ type: Function,
192
+ default: () => {
193
+ return {};
194
+ },
195
+ },
196
+ /**
197
+ * 回调函数,正常显示后触发此事件。
198
+ */
199
+ onCanPlay: {
200
+ type: Function,
201
+ default: () => {
202
+ return {};
203
+ },
204
+ },
205
+ /**
206
+ * 回调函数,音频失去焦点后触发此事件,可能会导致pause(点播)或者离开频道(直播)。
207
+ */
208
+ onAudioFocusLoss: {
209
+ type: Function,
210
+ default: () => {
211
+ return {};
212
+ },
213
+ },
214
+ /**
215
+ * 回调函数,音频获取焦点后触发此事件,可能会触发resume(点播)或者加入频道(直播)。
216
+ */
217
+ onAudioFocusGain: {
218
+ type: Function,
219
+ default: () => {
220
+ return {};
221
+ },
222
+ },
223
+ /**
224
+ * 回调函数,直播进入时移状态时,触发此事件。
225
+ */
226
+ onTimeShift: {
227
+ type: Function,
228
+ default: () => {
229
+ return {};
230
+ },
231
+ },
232
+ /**
233
+ * 回调函数,直播进入时移状态时,成功播放触发此事件。
234
+ */
235
+ onTimeShifted: {
236
+ type: Function,
237
+ default: () => {
238
+ return {};
239
+ },
240
+ },
241
+ /**
242
+ * 回调函数,时移回到直播状态,触发此事件。
243
+ */
244
+ onBackLive: {
245
+ type: Function,
246
+ default: () => {
247
+ return {};
248
+ },
249
+ },
250
+ /**
251
+ * 回调函数,时移回到直播状态时,成功播放触发此事件。
252
+ */
253
+ onBackLived: {
254
+ type: Function,
255
+ default: () => {
256
+ return {};
257
+ },
258
+ },
259
+ /**
260
+ * 属性,Object类型,设置窗口属性,同其他组件的style设置。
261
+ */
262
+ style: {
263
+ type: Object,
264
+ default: () => {
265
+ return {};
266
+ },
267
+ },
268
+ /**
269
+ * 属性,Boolean类型,活跃状态,当多个JsvPlayer组件指向一个video对象时,只能有一个处于活跃状态。
270
+ * 视频显示在活跃JsvPlayer设置的显示区域内,事件通知也只会送给活跃的JsvPlayer组件注册的回调函数。
271
+ */
272
+ active: { type: Boolean, default: true },
273
+ },
274
+ components: {},
275
+ watch: {
276
+ active(newValue) {
277
+ console.log("LudlDebug active newValue: " + newValue);
278
+ if (this.video) {
279
+ if (newValue) {
280
+ this.registerEvent();
281
+ this.video.setHoleID(this.holeId);
282
+ this.holeStyle = {
283
+ left: 0,
284
+ top: 0,
285
+ width: this.style.width,
286
+ height: this.style.height,
287
+ };
288
+ } else {
289
+ this.holeStyle = {
290
+ left: 0,
291
+ top: 0,
292
+ width: 0,
293
+ height: 0,
294
+ };
295
+ }
296
+ }
297
+ },
298
+ style(newValue) {
299
+ logDebug(
300
+ "holeStyle newValue: left=" +
301
+ newValue.left +
302
+ ", top=" +
303
+ newValue.top +
304
+ ", width=" +
305
+ newValue.width +
306
+ ", height=" +
307
+ newValue.height
308
+ );
309
+ if (this.active) {
310
+ this.holeStyle = {
311
+ left: 0,
312
+ top: 0,
313
+ width: newValue.width,
314
+ height: newValue.height,
315
+ };
316
+ }
317
+ },
318
+ keepLastFrame(newValue) {
319
+ logDebug("keepLastFrame newValue: " + newValue);
320
+ if (this.video && this.active) {
321
+ this.video.keepLastFrame = this.keepLastFrame;
322
+ }
323
+ },
324
+ },
325
+
326
+ setup() {
327
+ return {
328
+ video: null,
329
+ holeId: "",
330
+ jsvMainView: shallowRef(null),
331
+ innerViewId: shallowRef(-1),
332
+ };
333
+ },
334
+
335
+ data() {
336
+ return {
337
+ holeStyle: {},
338
+ };
339
+ },
340
+ created() {},
341
+ mounted() {
342
+ logDebug("JsvPlayer:", this.style);
343
+
344
+ let key = "Jsv_" + Math.floor(Math.random() * 10000);
345
+ if (this.playerKey) {
346
+ key = this.playerKey;
347
+ }
348
+ logDebug("player key:" + key);
349
+
350
+ let player_type = 1;
351
+ if (this.playerType) player_type = this.playerType;
352
+
353
+ let background = true;
354
+ if (!this.background) background = this.background;
355
+
356
+ logDebug("JsvPlayer background:" + background);
357
+
358
+ const designMap = window.Forge.DesignMap();
359
+ logDebug("JsvPlayer:", this.holeId);
360
+
361
+ // this.video = findMediaObjectByKey(key);
362
+ // TODO: 后续支持共享MediaId ?
363
+ let first_create = true;
364
+
365
+ if (!this.video) {
366
+ // 创建PC版本的video标签
367
+ this.video = window.originDocument.createElement("video");
368
+ this._extendsApi(this.video);
369
+ } else {
370
+ this.video.setRef();
371
+ first_create = false;
372
+ }
373
+
374
+ if (this.video != null) {
375
+ if (this.active) {
376
+ this.registerEvent();
377
+
378
+ //if(first_create){
379
+ if (this.src && this.src !== "") this.video.src = this.src;
380
+
381
+ if (this.currentTime !== 0) this.video.currentTime = this.currentTime;
382
+
383
+ if (this.autoplay) {
384
+ this.video.autoplay = this.autoplay;
385
+ }
386
+
387
+ if (this.muted) {
388
+ this.video.muted = this.muted;
389
+ }
390
+
391
+ if (this.loop) {
392
+ this.video.loop = this.loop;
393
+ }
394
+
395
+ if (!this.keepLastFrame) {
396
+ this.video.keepLastFrame = this.keepLastFrame;
397
+ }
398
+
399
+ if (this.videoAspectRatio !== "origin") {
400
+ this.video.videoAspectRatio = this.videoAspectRatio;
401
+ }
402
+
403
+ if (this.chromaKey && this.chromaKey !== "") {
404
+ this.video.setChromaKey(this.chromaKey);
405
+ }
406
+ //}else{
407
+ if (!first_create) {
408
+ this.video.setHoleID(this.holeId);
409
+ this.holeStyle = {
410
+ left: 0,
411
+ top: 0,
412
+ width: this.style.width,
413
+ height: this.style.height,
414
+ };
415
+ }
416
+ }
417
+
418
+ // 创建挂载的VideoView
419
+ this.jsvMainView = new Forge.VideoView(this.video, null);
420
+ this.innerViewId = Forge.sViewStore.add(
421
+ new Forge.ViewInfo(this.jsvMainView)
422
+ );
423
+
424
+ this.onRef?.(this.video);
425
+ }
426
+ },
427
+
428
+ unmounted() {
429
+ if (this.video != null) {
430
+ // 清理View管理缓存
431
+ if (this.innerViewId !== -1) {
432
+ Forge.sViewStore.remove(this.innerViewId);
433
+ this.innerViewId = -1;
434
+ this.jsvMainView = null;
435
+ }
436
+ this.onRef?.(null);
437
+ }
438
+ },
439
+
440
+ methods: {
441
+ getHoleId(id) {
442
+ logDebug("getHoleId:", id);
443
+ this.holeId = id;
444
+ },
445
+ registerEvent() {
446
+ if (this.video && this.active) {
447
+ this.video.addEventListener("end", this.onEnded);
448
+ this.video.addEventListener("error", this.onError);
449
+ //this.video.addEventListener("abort", this.onAbort);
450
+ this.video.addEventListener("timeupdate", this.onTimeUpdate);
451
+ this.video.addEventListener("loadstart", () => {
452
+ logDebug("JsvPlayer received loadstart event.");
453
+ this.holeStyle = {
454
+ left: 0,
455
+ top: 0,
456
+ width: this.style.width,
457
+ height: this.style.height,
458
+ };
459
+ this.onLoadStart();
460
+ });
461
+ this.video.addEventListener("canplaythrough", this.onCanPlayThrough);
462
+ this.video.addEventListener("progress", this.onProgress);
463
+ this.video.addEventListener("loadedmetadata", this.onLoadedMetaData);
464
+ this.video.addEventListener("load", this.onLoad);
465
+ this.video.addEventListener("durationchange", this.onDurationChange);
466
+ this.video.addEventListener("seeking", this.onSeeking);
467
+ this.video.addEventListener("seeked", this.onSeeked);
468
+ this.video.addEventListener("stalled", this.onStalled);
469
+ this.video.addEventListener("playing", this.onPlaying);
470
+ this.video.addEventListener("canplay", this.onCanPlay);
471
+ this.video.addEventListener("audiofocusloss", this.onAudioFocusLoss);
472
+ this.video.addEventListener("audiofocusgain", this.onAudioFocusGain);
473
+ this.video.addEventListener("timeshift", this.onTimeShift);
474
+ this.video.addEventListener("timeshifted", this.onTimeShifted);
475
+ this.video.addEventListener("backlive", this.onBackLive);
476
+ this.video.addEventListener("backlived", this.onBackLived);
477
+ }
478
+ },
479
+ _extendsApi(videoRef) {
480
+ // 补充插件扩展出来的接口
481
+ for (let method_name in playerExMethods) {
482
+ videoRef[method_name] = playerExMethods[method_name].bind(videoRef);
483
+ }
484
+ },
485
+ },
486
+ };
487
+
488
+ //export default JsvPlayer;
489
+ </script>
490
+
491
+ <template>
492
+ <div :style="holeStyle" backgroundColor="rgba(0,0,0,1)">
493
+ <div
494
+ :style="{
495
+ left: holeStyle.left,
496
+ top: holeStyle.top,
497
+ width: holeStyle.width,
498
+ height: holeStyle.height,
499
+ }"
500
+ :data-jsv-vw-innerview="innerViewId"
501
+ />
502
+ </div>
503
+ </template>
504
+
505
+ <style scoped></style>
@@ -0,0 +1,60 @@
1
+ //考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
2
+ import { default as JsvPlayer } from "./JsvPlayer.vue";
3
+ import { globalLoadJsvPlayerPlugin as initPlugin } from "./JsvMedia.js"
4
+ import { globalPreLoadJsvPlayerPlugin as preLoadPlugin } from "./JsvMedia.js"
5
+ import { getJsvPlayerCapabilitySet as getCapabilitySet } from "./JsvMedia.js"
6
+ import { setJsvPlayerDebugMode as setDebugMode } from "./JsvMedia.js"
7
+ import { getJsvPlayerRunningNum as getRunningPlayerNum } from "./JsvMedia.js"
8
+ import { globalLoadSetOperator as setOperator } from "./JsvMedia.js"
9
+ import {default as BrowserPlayer} from "./JsvPlayerBrowser-0.9.vue"
10
+ let _JsvPlayer = JsvPlayer;
11
+
12
+ let globalLoadJsvPlayerPlugin = initPlugin;
13
+ let globalPreLoadJsvPlayerPlugin = preLoadPlugin;
14
+ let getJsvPlayerCapabilitySet = getCapabilitySet;
15
+ let setJsvPlayerDebugMode = setDebugMode;
16
+ let getJsvPlayerRunningNum = getRunningPlayerNum;
17
+ let globalLoadSetOperator = setOperator;
18
+
19
+ if (window.jsvIsBrowserDebug) {
20
+ // const BrowserPlayer = await import("./JsvPlayerBrowser.vue");
21
+ // 浏览器版本
22
+ _JsvPlayer = BrowserPlayer;
23
+
24
+ // 为Browser重新定义初始化处理
25
+ globalLoadJsvPlayerPlugin = (listener) => {
26
+ console.log("Loading player plugin");
27
+ setTimeout(()=>{listener()}, 0);
28
+ }
29
+
30
+ globalPreLoadJsvPlayerPlugin = (listener) => {
31
+ console.log("Preloading player plugin");
32
+ setTimeout(()=>{listener()}, 0);
33
+ }
34
+
35
+ getJsvPlayerCapabilitySet = () => {
36
+ return null;
37
+ }
38
+
39
+ setJsvPlayerDebugMode = () => {
40
+ console.log("Set debug mode");
41
+ }
42
+
43
+ getJsvPlayerRunningNum = () => {
44
+ return -1;
45
+ }
46
+
47
+ globalLoadSetOperator = (operator)=>{
48
+ console.log("operator is "+operator);
49
+ }
50
+ }
51
+
52
+ export {
53
+ _JsvPlayer as JsvPlayer,
54
+ globalLoadJsvPlayerPlugin, // 全局初始化播放器插件处理
55
+ globalPreLoadJsvPlayerPlugin, //预加载播放器插件
56
+ getJsvPlayerCapabilitySet, //获取设备能力集
57
+ setJsvPlayerDebugMode, //设置调试模式,可以查看帧率等信息
58
+ getJsvPlayerRunningNum, //获取正在运行的播放器个数
59
+ globalLoadSetOperator,// 设置运营商
60
+ }
@@ -0,0 +1,59 @@
1
+ //考虑到.vue文件除了export default的component外,还有可能export其他对象,因此使用import * as
2
+ import { default as JsvPlayer } from "./JsvPlayer.vue";
3
+ import { globalLoadJsvPlayerPlugin as initPlugin } from "./JsvMedia.js"
4
+ import { globalPreLoadJsvPlayerPlugin as preLoadPlugin } from "./JsvMedia.js"
5
+ import { getJsvPlayerCapabilitySet as getCapabilitySet } from "./JsvMedia.js"
6
+ import { setJsvPlayerDebugMode as setDebugMode } from "./JsvMedia.js"
7
+ import { getJsvPlayerRunningNum as getRunningPlayerNum } from "./JsvMedia.js"
8
+ import { globalLoadSetOperator as setOperator } from "./JsvMedia.js"
9
+ let _JsvPlayer = JsvPlayer;
10
+
11
+ let globalLoadJsvPlayerPlugin = initPlugin;
12
+ let globalPreLoadJsvPlayerPlugin = preLoadPlugin;
13
+ let getJsvPlayerCapabilitySet = getCapabilitySet;
14
+ let setJsvPlayerDebugMode = setDebugMode;
15
+ let getJsvPlayerRunningNum = getRunningPlayerNum;
16
+ let globalLoadSetOperator = setOperator;
17
+
18
+ if (window.jsvIsBrowserDebug) {
19
+ const BrowserPlayer = await import("./JsvPlayerBrowser.vue");
20
+ // 浏览器版本
21
+ _JsvPlayer = BrowserPlayer.default;
22
+
23
+ // 为Browser重新定义初始化处理
24
+ globalLoadJsvPlayerPlugin = (listener) => {
25
+ console.log("Loading player plugin");
26
+ setTimeout(()=>{listener()}, 0);
27
+ }
28
+
29
+ globalPreLoadJsvPlayerPlugin = (listener) => {
30
+ console.log("Preloading player plugin");
31
+ setTimeout(()=>{listener()}, 0);
32
+ }
33
+
34
+ getJsvPlayerCapabilitySet = () => {
35
+ return null;
36
+ }
37
+
38
+ setJsvPlayerDebugMode = () => {
39
+ console.log("Set debug mode");
40
+ }
41
+
42
+ getJsvPlayerRunningNum = () => {
43
+ return -1;
44
+ }
45
+
46
+ globalLoadSetOperator = (operator)=>{
47
+ console.log("operator is "+operator);
48
+ }
49
+ }
50
+
51
+ export {
52
+ _JsvPlayer as JsvPlayer,
53
+ globalLoadJsvPlayerPlugin, // 全局初始化播放器插件处理
54
+ globalPreLoadJsvPlayerPlugin, //预加载播放器插件
55
+ getJsvPlayerCapabilitySet, //获取设备能力集
56
+ setJsvPlayerDebugMode, //设置调试模式,可以查看帧率等信息
57
+ getJsvPlayerRunningNum, //获取正在运行的播放器个数
58
+ globalLoadSetOperator,// 设置运营商
59
+ }
@@ -0,0 +1,18 @@
1
+ let PluginInfo = {
2
+ // downloadUrl:"http://192.168.0.101:8080/plugin/JsvPlayer-214.zip", //插件下载地址
3
+ packageName:"com.qcode.jsvplayer",
4
+ name:"播放器插件",
5
+ version:"2.1.4", //插件需要的版本号
6
+ versionCodeMin:214,
7
+ versionCodeMax:214,
8
+ bridgeName:"jsvPlayerBridge", //插件bridge注册到jsview的名称
9
+ className:"com.qcode.jsvplayer.JsvPlayer", //插件初始化类名称
10
+ initMethod:"createInstance", //插件初始化方法
11
+ listener:"top.JsvPlayerPluginLoadResult", //插件加载结果回调
12
+ listener2: "top.JsvPlayerPluginStatus",
13
+ // debug:true,
14
+ md5:"6443d073696fe73818ca7b7d19b3591c"
15
+ };
16
+
17
+ // 导出字段要含有 pluginVersionInfo 信息,作为npm时版本参考
18
+ export default PluginInfo;
@@ -1,2 +1,3 @@
1
1
  export { default as JsvAccount } from "./JsvAccount/JsvAccount";
2
+ export * from "./JsvPlayer";
2
3
  export * from "./JsvAudio";
@@ -422,11 +422,12 @@ function closeWarmedView(view_refer_id) {
422
422
 
423
423
  /**
424
424
  * 触发预下载内核
425
- * @param {String} core_version 带branch(主分支版本不带此信息)和版本信息的内核版本,
425
+ * @param {string} core_version 带branch(主分支版本不带此信息)和版本信息的内核版本,
426
426
  * 例如: 1021265_release_build_xxx
427
+ * @returns promise 对象,用于监听下载完成与下载失败
427
428
  */
428
- function preDownloadCore(core_version){
429
- return direct_call("preDownloadCore", core_version);
429
+ function preDownloadSdk(core_version){
430
+ return direct_call("preDownloadSdk", core_version);
430
431
  }
431
432
 
432
433
  // 显示声明,可以提高执行速度和利用上编辑器的成员名提示功能
@@ -460,7 +461,7 @@ const bridge = {
460
461
  warmUpView,
461
462
  warmLoadView,
462
463
  closeWarmedView,
463
- preDownloadCore
464
+ preDownloadSdk
464
465
  };
465
466
 
466
467
  export {