@shijiu/jsview-vue 0.9.502 → 0.9.590
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 -3
- package/index.js +10 -0
- package/package.json +8 -1
- package/patches/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +16 -5
- package/samples/AnimPicture/App.vue +89 -106
- package/samples/Basic/App.vue +65 -68
- package/samples/Basic/components/ContentBlock.vue +31 -36
- package/samples/Basic/components/anim/AnimGroup.vue +61 -75
- package/samples/Basic/components/anim/AnimKeyframeBasic.vue +54 -43
- package/samples/Basic/components/anim/AnimKeyframeComposite.vue +25 -31
- package/samples/Basic/components/anim/AnimTransition.vue +142 -105
- package/samples/Basic/components/div/DivBackground.vue +38 -16
- package/samples/Basic/components/div/DivClip.vue +143 -78
- package/samples/Basic/components/div/DivCssScoped.vue +10 -10
- package/samples/Basic/components/div/DivCssVar.vue +40 -42
- package/samples/Basic/components/div/DivGroup1.vue +45 -39
- package/samples/Basic/components/div/DivGroup2.vue +56 -45
- package/samples/Basic/components/div/DivLayout.vue +34 -5
- package/samples/Basic/components/div/DivRadius.vue +51 -42
- package/samples/Basic/components/div/DivTransform.vue +21 -16
- package/samples/Basic/components/panel/Panel1.vue +46 -44
- package/samples/Basic/components/panel/Panel2.vue +22 -26
- package/samples/Basic/components/panel/TitleBar.vue +12 -12
- package/samples/Basic/components/text/TextAlign.vue +54 -44
- package/samples/Basic/components/text/TextEmoji.vue +16 -20
- package/samples/Basic/components/text/TextFontStyle.vue +77 -53
- package/samples/Basic/components/text/TextGroup1.vue +46 -38
- package/samples/Basic/components/text/TextGroup2.vue +25 -28
- package/samples/Basic/components/text/TextOverflow.vue +76 -57
- package/samples/BasicFocusControl/App.vue +22 -43
- package/samples/BasicFocusControl/components/BaseBlock.vue +42 -43
- package/samples/BasicFocusControl/components/MainArea.vue +55 -70
- package/samples/BasicFocusControl/components/MainAreaLeftBlock.vue +11 -15
- package/samples/BasicFocusControl/components/MainAreaRightBlock.vue +21 -24
- package/samples/BasicFocusControl/components/SideBar.vue +32 -47
- package/samples/BasicFocusControl/components/SideBarBlock.vue +20 -23
- package/samples/ColorSpace/App.vue +15 -24
- package/samples/DemoHomepage/App.vue +7 -11
- package/samples/DemoHomepage/components/BodyFrame.vue +19 -9
- package/samples/DemoHomepage/components/TabFrame.vue +7 -8
- package/samples/DemoHomepage/router.js +32 -33
- package/samples/DemoHomepage/views/Homepage.vue +24 -8
- package/samples/FilterDemo/AnimatePic.vue +58 -0
- package/samples/FilterDemo/App.vue +99 -61
- package/samples/FilterDemo/VideoLayer.vue +62 -0
- package/samples/FlipCard/App.vue +32 -41
- package/samples/FlipCard/FlipCard.vue +48 -54
- package/samples/GridDemo/App.vue +109 -77
- package/samples/GridDemo/ButtonBlock.vue +50 -49
- package/samples/GridDemo/FocusItem.vue +19 -38
- package/samples/GridDemo/Item.vue +46 -54
- package/samples/HashHistory/App.vue +63 -79
- package/samples/HashHistory/components/HorizontalButtonList.vue +72 -95
- package/samples/HashHistory/components/Item.vue +42 -56
- package/samples/HashHistory/router.js +23 -12
- package/samples/HashHistory/views/MainPage.vue +35 -46
- package/samples/HashHistory/views/SubPage.vue +34 -47
- package/samples/Input/App.vue +2 -3
- package/samples/Input/FullKeyboard.vue +2 -6
- package/samples/Input/InputPanel.vue +2 -3
- package/samples/Input/KeyboardItem.vue +1 -1
- package/samples/LongImage/App.vue +11 -27
- package/samples/LongImage/Button.vue +50 -145
- package/samples/LongImage/ButtonItem.vue +44 -0
- package/samples/LongImage/LongImageScroll.vue +71 -106
- package/samples/LongImage/Scroll.vue +7 -9
- package/samples/LongText/App.vue +13 -28
- package/samples/LongText/Button.vue +43 -145
- package/samples/LongText/ButtonItem.vue +44 -0
- package/samples/LongText/LongTextScroll.vue +68 -101
- package/samples/LongText/Scroll.vue +7 -9
- package/samples/Marquee/App.vue +34 -37
- package/samples/MaskClip/App.vue +17 -30
- package/samples/MetroWidgetDemos/Advanced/App.vue +211 -0
- package/samples/MetroWidgetDemos/Advanced/ButtonItem.vue +90 -0
- package/samples/MetroWidgetDemos/Item.vue +67 -0
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/App.vue +80 -104
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/Item.vue +7 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/bg.jpg +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_content.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_left.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_mid.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/coupon_right.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/focus_border.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/holder_logo.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/jrbm.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_left.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_mid.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/line_right.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/loading.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/logo.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/mcjx.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tao.png +0 -0
- package/samples/{ClassNameDemo → MetroWidgetDemos/PerformanceTest}/assets/tmall.png +0 -0
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/border.png +0 -0
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/ContentItem.vue +60 -86
- package/samples/{SimpleWidgetDemo → MetroWidgetDemos/PerformanceTest}/components/MyTab.vue +0 -0
- package/samples/MetroWidgetDemos/PerformanceTest/data.js +45 -0
- package/samples/MetroWidgetDemos/PingPong/App.vue +135 -0
- package/samples/MetroWidgetDemos/PingPong/AppPage.vue +58 -0
- package/samples/MetroWidgetDemos/PingPong/AppTab.vue +69 -0
- package/samples/MetroWidgetDemos/PingPong/Item.vue +92 -0
- package/samples/MetroWidgetDemos/PingPong/ViewSwiper.vue +214 -0
- package/samples/MetroWidgetDemos/Simple/App.vue +194 -0
- package/samples/MetroWidgetDemos/WidgetItem.vue +89 -0
- package/samples/MetroWidgetDemos/data.js +204 -0
- package/samples/NinePatchDemo/App.vue +114 -115
- package/samples/NinePatchDemo/Item.vue +7 -8
- package/samples/Preload/App.vue +61 -63
- package/samples/Preload/Item.vue +21 -29
- package/samples/QrcodeDemo/App.vue +24 -29
- package/samples/SoundPool/App.vue +77 -106
- package/samples/SprayView/App.vue +10 -8
- package/samples/SpriteImage/App.vue +1 -2
- package/samples/TextBox/App.vue +86 -101
- package/samples/TextBox/RenderCenter.vue +1 -1
- package/samples/TextBox/RenderLeft.vue +1 -1
- package/samples/TextBox/RenderOneLine.vue +1 -1
- package/samples/TextBox/RenderRight.vue +1 -1
- package/samples/TextShadowDemo/App.vue +1 -2
- package/samples/TextureAnimation/App.vue +16 -13
- package/samples/TextureSize/App.vue +15 -25
- package/samples/ThrowMoveDemo/AccelerateDemo.vue +2 -4
- package/samples/ThrowMoveDemo/LRParabolicDemo.vue +2 -3
- package/samples/ThrowMoveDemo/TargetDemo.vue +3 -4
- package/samples/ThrowMoveDemo/UDParabolicDemo.vue +2 -3
- package/samples/TouchSample/App.vue +2 -3
- package/samples/TouchSample/Item.vue +15 -13
- package/samples/TouchSample/MetroWidgetHorizontal.vue +2 -2
- package/samples/TouchSample/MetroWidgetVertical.vue +1 -1
- package/samples/TouchSample/TouchContainerHorizontal.vue +4 -3
- package/samples/TouchSample/TouchContainerVertical.vue +3 -2
- package/samples/TransitPage/App.vue +20 -32
- package/samples/VideoDemo/App.vue +65 -81
- package/samples/VideoDemo/components/Button.vue +41 -52
- package/samples/VideoDemo/components/Controllor.vue +171 -169
- package/samples/VideoDemo/components/VideoFrame.vue +87 -99
- package/samples/VisibleSensorDemo/App.vue +167 -0
- package/scripts/jsview-jsmap-serve.js +42 -0
- package/scripts/jsview-post-install.js +1 -1
- package/tsconfig.json +3 -0
- package/utils/JsViewEngineWidget/JsvFocusBlock.vue +204 -193
- package/utils/JsViewEngineWidget/JsvFocusManager.js +30 -17
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +1555 -1656
- package/utils/JsViewEngineWidget/MetroWidget/PageUpdater.js +136 -0
- package/utils/JsViewEngineWidget/MetroWidget/ToolFunctions.js +18 -0
- package/utils/JsViewEngineWidget/TemplateParser.js +111 -1
- package/utils/JsViewEngineWidget/WidgetCommon.js +8 -2
- package/utils/JsViewEngineWidget/index.js +4 -4
- package/utils/JsViewPlugin/JsvPlayer/GetVersion.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvMedia.js +264 -54
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +5 -1
- package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
- package/utils/JsViewVueTools/JsvRefTaker.js +35 -0
- package/utils/JsViewVueTools/index.js +19 -0
- package/utils/JsViewVueWidget/BrowserDebugWidget/BrowserQrcode.vue +8 -4
- package/utils/JsViewVueWidget/JsvFilterView.vue +59 -51
- package/utils/JsViewVueWidget/JsvGrid.vue +139 -41
- package/utils/JsViewVueWidget/JsvMaskClipDiv.vue +3 -1
- package/utils/JsViewVueWidget/JsvNativeSharedDiv.vue +8 -17
- package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -1
- package/utils/JsViewVueWidget/JsvPosterDiv.vue +37 -7
- package/utils/JsViewVueWidget/JsvPosterImage.vue +34 -13
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +2 -12
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +1 -1
- package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +13 -10
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -3
- package/utils/JsViewVueWidget/JsvTextureAnim/JsvTextureAnim.vue +25 -21
- package/utils/JsViewVueWidget/JsvTransparentDiv.vue +7 -8
- package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +141 -0
- package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +9 -0
- package/utils/JsViewVueWidget/index.js +42 -0
- package/samples/AdvanceMetroWidget/App.vue +0 -123
- package/samples/AdvanceMetroWidget/Frame.vue +0 -102
- package/samples/AdvanceMetroWidget/Item.vue +0 -63
- package/samples/AdvanceMetroWidget/data.js +0 -137
- package/samples/ClassNameDemo/App.vue +0 -119
- package/samples/ClassNameDemo/components/ContentItem.vue +0 -253
- package/samples/ClassNameDemo/components/LoadingView.vue +0 -43
- package/samples/ClassNameDemo/components/TitleView.vue +0 -24
- package/samples/ClassNameDemo/data.js +0 -24
- package/samples/FlowMultiWidget/App.vue +0 -91
- package/samples/FlowMultiWidget/assets/nine_patch_focus.png +0 -0
- package/samples/FlowMultiWidget/components/Block.vue +0 -107
- package/samples/FlowMultiWidget/components/FlowPage.vue +0 -60
- package/samples/FlowMultiWidget/components/Item.vue +0 -103
- package/samples/FlowMultiWidget/components/MenuItem.vue +0 -72
- package/samples/FlowMultiWidget/components/MyMenu.vue +0 -90
- package/samples/FlowMultiWidget/data.js +0 -446
- package/samples/HashHistory/views/BasePage.vue +0 -19
- package/samples/HashHistory/views/SubPageFirst.vue +0 -10
- package/samples/HashHistory/views/SubPageSecond.vue +0 -10
- package/samples/SimpleWidgetDemo/assets/bg.jpg +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_content.png +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_left.png +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_mid.png +0 -0
- package/samples/SimpleWidgetDemo/assets/coupon_right.png +0 -0
- package/samples/SimpleWidgetDemo/assets/focus_border.png +0 -0
- package/samples/SimpleWidgetDemo/assets/holder_logo.png +0 -0
- package/samples/SimpleWidgetDemo/assets/jrbm.png +0 -0
- package/samples/SimpleWidgetDemo/assets/line_left.png +0 -0
- package/samples/SimpleWidgetDemo/assets/line_mid.png +0 -0
- package/samples/SimpleWidgetDemo/assets/line_right.png +0 -0
- package/samples/SimpleWidgetDemo/assets/loading.png +0 -0
- package/samples/SimpleWidgetDemo/assets/logo.png +0 -0
- package/samples/SimpleWidgetDemo/assets/mcjx.png +0 -0
- package/samples/SimpleWidgetDemo/assets/tao.png +0 -0
- package/samples/SimpleWidgetDemo/assets/tmall.png +0 -0
- package/samples/SimpleWidgetDemo/data.js +0 -124
- package/utils/JsViewEngineWidget/MetroWidget/ContentView.vue +0 -63
- package/utils/JsViewEngineWidget/MetroWidget/DivWrapper.vue +0 -51
- package/utils/JsViewEngineWidget/MetroWidget/ItemView.vue +0 -213
- package/utils/JsViewEngineWidget/MetroWidget/RootView.vue +0 -154
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
/* eslint-disable no-prototype-builtins */
|
|
2
2
|
import {getPluginInfo} from './GetVersion'
|
|
3
3
|
|
|
4
|
+
let EVENT_STATUS_NONE = 0;
|
|
5
|
+
let EVENT_STATUS_LOADSTART = 1;
|
|
6
|
+
let EVENT_STATUS_LOAD = 2;
|
|
7
|
+
let EVENT_STATUS_SEEK = 3;
|
|
8
|
+
let EVENT_STATUS_SEEKED = 4;
|
|
9
|
+
let EVENT_STATUS_STALLED = 5;
|
|
10
|
+
let EVENT_STATUS_RESUME = 6;
|
|
11
|
+
let EVENT_STATUS_DISPLAY = 7;
|
|
12
|
+
let EVENT_STATUS_TIMESHIFT = 8;
|
|
13
|
+
let EVENT_STATUS_TIMESHIFTED = 9;
|
|
14
|
+
let EVENT_STATUS_BACKLIVE = 10;
|
|
15
|
+
let EVENT_STATUS_BACKLIVED = 11;
|
|
16
|
+
let EVENT_STATUS_END = 12;
|
|
17
|
+
|
|
18
|
+
|
|
4
19
|
let MediaPluginInfo = getPluginInfo();
|
|
5
20
|
|
|
6
21
|
var mediaArray = [];
|
|
@@ -175,8 +190,8 @@ function findMediaObjectByKey(key){
|
|
|
175
190
|
}
|
|
176
191
|
|
|
177
192
|
class JsvBaseMedia {
|
|
178
|
-
constructor(type, hole_id, player_type, key, background, design_map_width) {
|
|
179
|
-
logTrace("Create JsvBaseMedia, type="+type+", hole_id="+hole_id+", player_type="+player_type+", key="+key+", background="+background+", design_map_width="+design_map_width);
|
|
193
|
+
constructor(type, hole_id, player_type, key, background, design_map_width, decode_type) {
|
|
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);
|
|
180
195
|
|
|
181
196
|
this.state = {
|
|
182
197
|
muted: false,
|
|
@@ -209,9 +224,12 @@ class JsvBaseMedia {
|
|
|
209
224
|
this.holeIdModify = hole_id;
|
|
210
225
|
this.playerType = player_type;
|
|
211
226
|
this.designMapWidth = design_map_width;
|
|
227
|
+
this.decodeType = decode_type;
|
|
212
228
|
this.channelID = -1;
|
|
213
229
|
this.ref = 1;
|
|
214
230
|
this.appVisible = window.JsView&&window.JsView.getVisibility?(window.JsView.getVisibility()==="show"):true;
|
|
231
|
+
this.eventReport = true;
|
|
232
|
+
this.currentEventStatus = EVENT_STATUS_NONE;
|
|
215
233
|
this._onEvent = this.onEvent.bind(this);
|
|
216
234
|
this._onVisibilityChangeCallBack = this.onVisibilityChangeCallBack.bind(this);
|
|
217
235
|
|
|
@@ -247,7 +265,7 @@ class JsvBaseMedia {
|
|
|
247
265
|
|
|
248
266
|
let share_view = true;
|
|
249
267
|
|
|
250
|
-
let result = window.jsvPlayerBridge.CreatePlayer(this.key, this.holeId, this.background, this.designMapWidth, share_view, this.playerType, "top.CreatePlayerResult");
|
|
268
|
+
let result = window.jsvPlayerBridge.CreatePlayer(this.key, this.holeId, this.background, this.designMapWidth, share_view, this.playerType, this.decodeType, "top.CreatePlayerResult");
|
|
251
269
|
if(result > 0){
|
|
252
270
|
this.initPlayer();
|
|
253
271
|
}
|
|
@@ -286,7 +304,7 @@ class JsvBaseMedia {
|
|
|
286
304
|
logDebug("InitPlayer:2, key="+this.key);
|
|
287
305
|
|
|
288
306
|
if(this.channelID >= 0){
|
|
289
|
-
this.
|
|
307
|
+
this.joinChannelPrivate(this.channelID);
|
|
290
308
|
}else if(this.state["src"]){
|
|
291
309
|
this.setState("src", this.state["src"], "string");
|
|
292
310
|
if(this.state["currentTime"]){
|
|
@@ -327,7 +345,14 @@ class JsvBaseMedia {
|
|
|
327
345
|
|
|
328
346
|
onVisibilityChangeCallBack(){
|
|
329
347
|
let visible = window.JsView&&window.JsView.getVisibility?(window.JsView.getVisibility()==="show"):true;
|
|
348
|
+
|
|
330
349
|
logDebug("playerKey:"+this.key+", 小程序可见状态: "+visible);
|
|
350
|
+
|
|
351
|
+
if(visible === this.appVisible){
|
|
352
|
+
logDebug("playerKey:"+this.key+", 小程序可见状态未发生变化,不执行动作");
|
|
353
|
+
return;
|
|
354
|
+
}
|
|
355
|
+
|
|
331
356
|
if(visible){
|
|
332
357
|
this.appVisible = visible;
|
|
333
358
|
this.state.paused = this.local.paused;
|
|
@@ -337,6 +362,7 @@ class JsvBaseMedia {
|
|
|
337
362
|
}else{
|
|
338
363
|
logDebug("playerKey:"+this.key+", playerCreate: "+this.playerCreate+", channelID: "+this.channelID+", src: "+this.state["src"]);
|
|
339
364
|
if(this.playerCreate){
|
|
365
|
+
this.eventReport = false;
|
|
340
366
|
if(this.channelID > 0){
|
|
341
367
|
logDebug("leaveChannel");
|
|
342
368
|
window.jsvPlayerBridge.leaveChannel(this.key);
|
|
@@ -345,7 +371,7 @@ class JsvBaseMedia {
|
|
|
345
371
|
this.local.currentTime = this.currentTime;
|
|
346
372
|
this.local.paused = this.paused;
|
|
347
373
|
logDebug("currentTime: "+this.local.currentTime);
|
|
348
|
-
this.
|
|
374
|
+
this.unloadPrivate();
|
|
349
375
|
}
|
|
350
376
|
}
|
|
351
377
|
this.appVisible = visible;
|
|
@@ -396,11 +422,107 @@ class JsvBaseMedia {
|
|
|
396
422
|
}
|
|
397
423
|
}
|
|
398
424
|
|
|
425
|
+
needReportEvent(event){
|
|
426
|
+
let ret = true;
|
|
427
|
+
if(!this.eventReport){
|
|
428
|
+
ret = false;
|
|
429
|
+
switch(this.currentEventStatus){
|
|
430
|
+
case EVENT_STATUS_NONE:
|
|
431
|
+
this.eventReport = true;
|
|
432
|
+
ret = true;
|
|
433
|
+
break;
|
|
434
|
+
case EVENT_STATUS_LOADSTART:
|
|
435
|
+
if(event == EVENT_STATUS_LOADSTART || event == EVENT_STATUS_LOAD || event == EVENT_STATUS_DISPLAY || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_TIMESHIFTED){
|
|
436
|
+
this.eventReport = true;
|
|
437
|
+
}
|
|
438
|
+
if(event == EVENT_STATUS_LOADSTART){
|
|
439
|
+
ret = false;
|
|
440
|
+
}else{
|
|
441
|
+
ret = true;
|
|
442
|
+
}
|
|
443
|
+
break;
|
|
444
|
+
case EVENT_STATUS_LOAD:
|
|
445
|
+
if(event == EVENT_STATUS_LOAD || event == EVENT_STATUS_DISPLAY || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_TIMESHIFTED){
|
|
446
|
+
this.eventReport = true;
|
|
447
|
+
}
|
|
448
|
+
if(event == EVENT_STATUS_LOADSTART || event == EVENT_STATUS_LOAD){
|
|
449
|
+
ret = false;
|
|
450
|
+
}else{
|
|
451
|
+
ret = true;
|
|
452
|
+
}
|
|
453
|
+
break;
|
|
454
|
+
case EVENT_STATUS_DISPLAY:
|
|
455
|
+
if(event == EVENT_STATUS_DISPLAY || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_TIMESHIFTED){
|
|
456
|
+
this.eventReport = true;
|
|
457
|
+
}
|
|
458
|
+
if(event != EVENT_STATUS_END){
|
|
459
|
+
ret = false;
|
|
460
|
+
}else{
|
|
461
|
+
ret = true;
|
|
462
|
+
}
|
|
463
|
+
break;
|
|
464
|
+
case EVENT_STATUS_TIMESHIFT:
|
|
465
|
+
if(event == EVENT_STATUS_TIMESHIFT || event == EVENT_STATUS_TIMESHIFTED || event == EVENT_STATUS_BACKLIVE || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_DISPLAY){
|
|
466
|
+
this.eventReport = true;
|
|
467
|
+
}
|
|
468
|
+
if(event == EVENT_STATUS_TIMESHIFT){
|
|
469
|
+
ret = false;
|
|
470
|
+
}else{
|
|
471
|
+
ret = true;
|
|
472
|
+
}
|
|
473
|
+
break;
|
|
474
|
+
case EVENT_STATUS_TIMESHIFTED:
|
|
475
|
+
if(event == EVENT_STATUS_TIMESHIFTED || event == EVENT_STATUS_BACKLIVE || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_DISPLAY){
|
|
476
|
+
this.eventReport = true;
|
|
477
|
+
}
|
|
478
|
+
if(event == EVENT_STATUS_TIMESHIFT || event == EVENT_STATUS_TIMESHIFTED){
|
|
479
|
+
ret = false;
|
|
480
|
+
}else{
|
|
481
|
+
ret = true;
|
|
482
|
+
}
|
|
483
|
+
break;
|
|
484
|
+
case EVENT_STATUS_BACKLIVE:
|
|
485
|
+
if(event == EVENT_STATUS_TIMESHIFT || event == EVENT_STATUS_TIMESHIFTED || event == EVENT_STATUS_BACKLIVE || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_DISPLAY){
|
|
486
|
+
this.eventReport = true;
|
|
487
|
+
}
|
|
488
|
+
if(event == EVENT_STATUS_BACKLIVE){
|
|
489
|
+
ret = false;
|
|
490
|
+
}else{
|
|
491
|
+
ret = true;
|
|
492
|
+
}
|
|
493
|
+
break;
|
|
494
|
+
case EVENT_STATUS_BACKLIVED:
|
|
495
|
+
if(event == EVENT_STATUS_TIMESHIFTED || event == EVENT_STATUS_TIMESHIFT || event == EVENT_STATUS_BACKLIVED || event == EVENT_STATUS_DISPLAY){
|
|
496
|
+
this.eventReport = true;
|
|
497
|
+
}
|
|
498
|
+
if(event == EVENT_STATUS_BACKLIVE || event == EVENT_STATUS_BACKLIVED){
|
|
499
|
+
ret = false;
|
|
500
|
+
}else{
|
|
501
|
+
ret = true;
|
|
502
|
+
}
|
|
503
|
+
break;
|
|
504
|
+
case EVENT_STATUS_END:
|
|
505
|
+
this.eventReport = true;
|
|
506
|
+
ret = true;
|
|
507
|
+
break;
|
|
508
|
+
default:
|
|
509
|
+
logWarning("current event status is "+this.currentEventStatus);
|
|
510
|
+
this.eventReport = true;
|
|
511
|
+
ret = true;
|
|
512
|
+
break;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
logTrace("eventReport:"+this.eventReport+", ret="+ret);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return ret;
|
|
519
|
+
}
|
|
520
|
+
|
|
399
521
|
/**
|
|
400
522
|
* 私有接口,外部不需要调用此接口。
|
|
401
523
|
*/
|
|
402
524
|
onEvent(event_str){
|
|
403
|
-
|
|
525
|
+
logTrace("player event: "+event_str);
|
|
404
526
|
let obj = JSON.parse(event_str);
|
|
405
527
|
let event_obj = JSON.parse(obj.param);
|
|
406
528
|
let event = event_obj.event;
|
|
@@ -432,33 +554,42 @@ class JsvBaseMedia {
|
|
|
432
554
|
}
|
|
433
555
|
break;
|
|
434
556
|
case "onEnd":
|
|
435
|
-
this.
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
this
|
|
557
|
+
if(this.needReportEvent(EVENT_STATUS_END)){
|
|
558
|
+
this.local.isRenderable = false;
|
|
559
|
+
this.setState("paused", true, "boolean");
|
|
560
|
+
if(this.hasOwnProperty("onend")){
|
|
561
|
+
this["onend"]();
|
|
562
|
+
}
|
|
563
|
+
this.currentEventStatus = EVENT_STATUS_END;
|
|
439
564
|
}
|
|
440
565
|
break;
|
|
441
566
|
case "onLoadStart":
|
|
442
567
|
logDebug("onLoadStart:"+data);
|
|
443
|
-
if(this.
|
|
444
|
-
this
|
|
568
|
+
if(this.needReportEvent(EVENT_STATUS_LOADSTART)){
|
|
569
|
+
if(this.hasOwnProperty("onloadstart")){
|
|
570
|
+
this["onloadstart"]();
|
|
571
|
+
}
|
|
572
|
+
this.currentEventStatus = EVENT_STATUS_LOADSTART;
|
|
445
573
|
}
|
|
446
574
|
break;
|
|
447
575
|
case "onLoad":
|
|
448
576
|
logDebug("onLoad:"+data);
|
|
449
|
-
this.
|
|
450
|
-
|
|
577
|
+
if(this.needReportEvent(EVENT_STATUS_LOAD)){
|
|
578
|
+
this.local.currentTime = data.currentTime;
|
|
579
|
+
this.local.duration = data.duration;
|
|
451
580
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
581
|
+
if (this.hasOwnProperty("onloadedmetadata")) {
|
|
582
|
+
this["onloadedmetadata"]();
|
|
583
|
+
}
|
|
455
584
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
585
|
+
if (this.hasOwnProperty("onload")) {
|
|
586
|
+
this["onload"]();
|
|
587
|
+
}
|
|
459
588
|
|
|
460
|
-
|
|
461
|
-
|
|
589
|
+
if (this.hasOwnProperty("ondurationchange")) {
|
|
590
|
+
this["ondurationchange"]();
|
|
591
|
+
}
|
|
592
|
+
this.currentEventStatus = EVENT_STATUS_LOAD;
|
|
462
593
|
}
|
|
463
594
|
break;
|
|
464
595
|
case "onError":
|
|
@@ -471,6 +602,7 @@ class JsvBaseMedia {
|
|
|
471
602
|
MEDIA_ERR_DECODE: 3,
|
|
472
603
|
MEDIA_ERR_SRC_NOT_SUPPORTED: 4,
|
|
473
604
|
MEDIA_ERR_ONLY_ONE_4K: 5,
|
|
605
|
+
MEDIA_ERR_NO_DECODE_RESOURCE: 6,
|
|
474
606
|
};
|
|
475
607
|
const platform_error = data.error.what;
|
|
476
608
|
let e = Error.MEDIA_ERR_ABORTED;
|
|
@@ -486,15 +618,23 @@ class JsvBaseMedia {
|
|
|
486
618
|
break;
|
|
487
619
|
case -50001:
|
|
488
620
|
e = Error.MEDIA_ERR_ONLY_ONE_4K;
|
|
621
|
+
break;
|
|
622
|
+
case -50002:
|
|
623
|
+
e = Error.MEDIA_ERR_NO_DECODE_RESOURCE;
|
|
624
|
+
break;
|
|
625
|
+
default:
|
|
626
|
+
break;
|
|
489
627
|
}
|
|
490
628
|
this["onerror"](e);
|
|
491
629
|
}
|
|
492
630
|
break;
|
|
493
631
|
case "onSeek":
|
|
494
632
|
logDebug("onSeek:"+data);
|
|
495
|
-
this.
|
|
496
|
-
|
|
497
|
-
this
|
|
633
|
+
if(this.needReportEvent(EVENT_STATUS_SEEK)){
|
|
634
|
+
this.local.isRenderable = false;
|
|
635
|
+
if(this.hasOwnProperty("onseeking")){
|
|
636
|
+
this["onseeking"]();
|
|
637
|
+
}
|
|
498
638
|
}
|
|
499
639
|
break;
|
|
500
640
|
case "onEventExt":
|
|
@@ -506,9 +646,11 @@ class JsvBaseMedia {
|
|
|
506
646
|
}
|
|
507
647
|
break;
|
|
508
648
|
case "videoSeekComplete" :
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
this
|
|
649
|
+
if(this.needReportEvent(EVENT_STATUS_SEEKED)){
|
|
650
|
+
//this.local.isRenderable = true; // waiting until BUFFERING END
|
|
651
|
+
if (this.hasOwnProperty("onseeked")) {
|
|
652
|
+
this["onseeked"]();
|
|
653
|
+
}
|
|
512
654
|
}
|
|
513
655
|
break;
|
|
514
656
|
default:
|
|
@@ -529,45 +671,64 @@ class JsvBaseMedia {
|
|
|
529
671
|
}
|
|
530
672
|
break;
|
|
531
673
|
case "onPlaybackStalled":
|
|
532
|
-
this.
|
|
533
|
-
|
|
534
|
-
this
|
|
674
|
+
if(this.needReportEvent(EVENT_STATUS_STALLED)){
|
|
675
|
+
this.local.isRenderable = false;
|
|
676
|
+
if(this.hasOwnProperty("onstalled")){
|
|
677
|
+
this["onstalled"]();
|
|
678
|
+
}
|
|
535
679
|
}
|
|
536
680
|
break;
|
|
537
681
|
case "onPlaybackResume":
|
|
538
|
-
this.
|
|
539
|
-
|
|
540
|
-
this
|
|
682
|
+
if(this.needReportEvent(EVENT_STATUS_RESUME)){
|
|
683
|
+
this.local.isRenderable = true;
|
|
684
|
+
if(this.hasOwnProperty("onplaying")){
|
|
685
|
+
this["onplaying"]();
|
|
686
|
+
}
|
|
541
687
|
}
|
|
542
688
|
break;
|
|
543
689
|
case "onReadyForDisplay":
|
|
544
|
-
this.
|
|
545
|
-
|
|
546
|
-
this
|
|
690
|
+
if(this.needReportEvent(EVENT_STATUS_DISPLAY)){
|
|
691
|
+
this.local.isRenderable = true;
|
|
692
|
+
if(this.hasOwnProperty("oncanplay")){
|
|
693
|
+
this["oncanplay"]();
|
|
694
|
+
}
|
|
695
|
+
this.currentEventStatus = EVENT_STATUS_DISPLAY;
|
|
547
696
|
}
|
|
548
697
|
break;
|
|
549
698
|
case "onTimeShift":
|
|
550
699
|
logDebug("onTimeShift");
|
|
551
|
-
if(this.
|
|
552
|
-
this
|
|
700
|
+
if(this.needReportEvent(EVENT_STATUS_TIMESHIFT)){
|
|
701
|
+
if(this.hasOwnProperty("ontimeshift")){
|
|
702
|
+
this["ontimeshift"](data.seekTime);
|
|
703
|
+
}
|
|
704
|
+
this.currentEventStatus = EVENT_STATUS_TIMESHIFT;
|
|
553
705
|
}
|
|
554
706
|
break;
|
|
555
707
|
case "onTimeShifted":
|
|
556
708
|
logDebug("onTimeShifted");
|
|
557
|
-
if(this.
|
|
558
|
-
this
|
|
709
|
+
if(this.needReportEvent(EVENT_STATUS_TIMESHIFTED)){
|
|
710
|
+
if(this.hasOwnProperty("ontimeshifted")){
|
|
711
|
+
this["ontimeshifted"]();
|
|
712
|
+
}
|
|
713
|
+
this.currentEventStatus = EVENT_STATUS_TIMESHIFTED;
|
|
559
714
|
}
|
|
560
715
|
break;
|
|
561
716
|
case "onBackLive":
|
|
562
717
|
logDebug("onBackLive");
|
|
563
|
-
if(this.
|
|
564
|
-
this
|
|
718
|
+
if(this.needReportEvent(EVENT_STATUS_BACKLIVE)){
|
|
719
|
+
if(this.hasOwnProperty("onbacklive")){
|
|
720
|
+
this["onbacklive"]();
|
|
721
|
+
}
|
|
722
|
+
this.currentEventStatus = EVENT_STATUS_BACKLIVE;
|
|
565
723
|
}
|
|
566
724
|
break;
|
|
567
725
|
case "onBackLived":
|
|
568
726
|
logDebug("onBackLived");
|
|
569
|
-
if(this.
|
|
570
|
-
this
|
|
727
|
+
if(this.needReportEvent(EVENT_STATUS_BACKLIVED)){
|
|
728
|
+
if(this.hasOwnProperty("onbacklived")){
|
|
729
|
+
this["onbacklived"]();
|
|
730
|
+
}
|
|
731
|
+
this.currentEventStatus = EVENT_STATUS_BACKLIVED;
|
|
571
732
|
}
|
|
572
733
|
break;
|
|
573
734
|
default:
|
|
@@ -601,7 +762,7 @@ class JsvBaseMedia {
|
|
|
601
762
|
set currentTime(value) {
|
|
602
763
|
this.local.isRenderable = false;
|
|
603
764
|
this.local.currentTime = value;
|
|
604
|
-
|
|
765
|
+
this.setState("currentTime", value, "number");
|
|
605
766
|
}
|
|
606
767
|
|
|
607
768
|
/**
|
|
@@ -732,8 +893,9 @@ class JsvBaseMedia {
|
|
|
732
893
|
* @param {string} head 网络请求的head信息,可以为NULL。
|
|
733
894
|
* @param {int} type 类型,1表示点播,2表示直播,3表示时移,默认1。
|
|
734
895
|
* @param {double} timeShift 时移时间,只有在type=3时才有效,表示从当前时间时移多长时间,单位秒。
|
|
896
|
+
* @param {int} 分辨率类型。0:unknown或其它;1:标清;2:高清;3:超清(720P);4:蓝光(1080P);5:2K;6:4K;7:8K。
|
|
735
897
|
*/
|
|
736
|
-
setSrc(url, head, type, timeShift){
|
|
898
|
+
setSrc(url, head, type, timeShift, resolution){
|
|
737
899
|
let src = {};
|
|
738
900
|
src.url = url;
|
|
739
901
|
if(head){
|
|
@@ -747,7 +909,14 @@ class JsvBaseMedia {
|
|
|
747
909
|
if(type === 3 && timeShift){
|
|
748
910
|
src.timeShift = timeShift;
|
|
749
911
|
}
|
|
912
|
+
|
|
913
|
+
if(resolution && typeof resolution === "number"){
|
|
914
|
+
src.resolution = resolution;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
this.currentEventStatus = EVENT_STATUS_NONE;
|
|
750
918
|
this.setState("src", JSON.stringify(src), "string");
|
|
919
|
+
this.eventReport = true;
|
|
751
920
|
}
|
|
752
921
|
|
|
753
922
|
/**
|
|
@@ -792,10 +961,16 @@ class JsvBaseMedia {
|
|
|
792
961
|
* 停止视频流。
|
|
793
962
|
*/
|
|
794
963
|
unload() {
|
|
964
|
+
this.unloadPrivate();
|
|
965
|
+
this.currentEventStatus = EVENT_STATUS_NONE;
|
|
966
|
+
this.eventReport = true;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
unloadPrivate(){
|
|
795
970
|
this.setState("paused", true, "boolean");
|
|
796
971
|
this.local.isRenderable = false;
|
|
797
972
|
this.setState("enablePlayer", false, "boolean");
|
|
798
|
-
|
|
973
|
+
}
|
|
799
974
|
|
|
800
975
|
/**
|
|
801
976
|
* 要求终端访问指定的频道,并立即返回。对由本地设置为跳过的频道,也返回-1。
|
|
@@ -809,6 +984,15 @@ class JsvBaseMedia {
|
|
|
809
984
|
*/
|
|
810
985
|
joinChannel(mixNo){
|
|
811
986
|
logTrace("joinChannel, key="+this.key+", mixNo="+mixNo);
|
|
987
|
+
let ret = this.joinChannelPrivate(mixNo);
|
|
988
|
+
if(ret >= 0){
|
|
989
|
+
this.currentEventStatus = EVENT_STATUS_NONE;
|
|
990
|
+
this.eventReport = true;
|
|
991
|
+
}
|
|
992
|
+
return ret;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
joinChannelPrivate(mixNo){
|
|
812
996
|
if(mixNo <= 0){
|
|
813
997
|
return -1;
|
|
814
998
|
}
|
|
@@ -821,6 +1005,7 @@ class JsvBaseMedia {
|
|
|
821
1005
|
if(ret >= 0){
|
|
822
1006
|
this.channelID = mixNo;
|
|
823
1007
|
this.local.paused = false;
|
|
1008
|
+
|
|
824
1009
|
this.setState("paused", false, "boolean");
|
|
825
1010
|
}
|
|
826
1011
|
|
|
@@ -837,6 +1022,14 @@ class JsvBaseMedia {
|
|
|
837
1022
|
*/
|
|
838
1023
|
leaveChannel(){
|
|
839
1024
|
logTrace("leaveChannel, key="+this.key+", channelID="+this.channelID);
|
|
1025
|
+
let ret = this.leaveChannelPrivate();
|
|
1026
|
+
|
|
1027
|
+
this.currentEventStatus = EVENT_STATUS_NONE;
|
|
1028
|
+
this.eventReport = true;
|
|
1029
|
+
return ret;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
leaveChannelPrivate(){
|
|
840
1033
|
let ret = 0;
|
|
841
1034
|
if(this.playerCreate && this.appVisible){
|
|
842
1035
|
ret = window.jsvPlayerBridge.leaveChannel(this.key);
|
|
@@ -1023,21 +1216,21 @@ class JsvBaseMedia {
|
|
|
1023
1216
|
}
|
|
1024
1217
|
|
|
1025
1218
|
class JsvMedia extends JsvBaseMedia {
|
|
1026
|
-
constructor(type, hole_id, player_type, key, background, design_map_width) {
|
|
1027
|
-
super(type, hole_id, player_type, key, background, design_map_width);
|
|
1219
|
+
constructor(type, hole_id, player_type, key, background, design_map_width, decode_type) {
|
|
1220
|
+
super(type, hole_id, player_type, key, background, design_map_width, decode_type);
|
|
1028
1221
|
//super.buildPlatformInstance(type);
|
|
1029
1222
|
}
|
|
1030
1223
|
}
|
|
1031
1224
|
|
|
1032
1225
|
class JsvMediaAudio extends JsvMedia {
|
|
1033
1226
|
constructor() {
|
|
1034
|
-
super("audio", null, null, null, null, null);
|
|
1227
|
+
super("audio", null, null, null, null, null, 0);
|
|
1035
1228
|
}
|
|
1036
1229
|
}
|
|
1037
1230
|
|
|
1038
1231
|
class JsvMediaVideo extends JsvMedia {
|
|
1039
|
-
constructor(hole_id, player_type, key, background, design_map_width) {
|
|
1040
|
-
super("video", hole_id, player_type, key, background, design_map_width);
|
|
1232
|
+
constructor(hole_id, player_type, key, background, design_map_width, decode_type) {
|
|
1233
|
+
super("video", hole_id, player_type, key, background, design_map_width, decode_type);
|
|
1041
1234
|
|
|
1042
1235
|
this.state.aspectRatio = 'origin'; // 'origin', 'full', '16:9', '4:3',
|
|
1043
1236
|
}
|
|
@@ -1078,7 +1271,7 @@ class JsvMediaVideo extends JsvMedia {
|
|
|
1078
1271
|
|
|
1079
1272
|
/**
|
|
1080
1273
|
* 获取播放器能力集,当前主要是对4K多播放器的支持以及H265解码能力的支持。
|
|
1081
|
-
* @return {string}
|
|
1274
|
+
* @return {string} json string,能力集JSON数据格式。
|
|
1082
1275
|
*/
|
|
1083
1276
|
function getJsvPlayerCapabilitySet(){
|
|
1084
1277
|
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
@@ -1086,12 +1279,29 @@ function getJsvPlayerCapabilitySet(){
|
|
|
1086
1279
|
}
|
|
1087
1280
|
}
|
|
1088
1281
|
|
|
1282
|
+
/**
|
|
1283
|
+
* 设置指定视频类型的同时使用播放器个数,会check硬件是否支持系统设置的播放器个数,最好在小程序初始化的时候,使用播放器资源之前调用。
|
|
1284
|
+
* @param {string} videoType,对于H264,是video/avc,对于H265,是video/hevc,其他可以参考相关定义。
|
|
1285
|
+
* @param {int} num,需要使用的播放器个数。
|
|
1286
|
+
* @return {String} json string,对设置的播放器个数的支持状态,返回的总数不会大于设置的个数(实际硬件能力可能大于设置的个数)。
|
|
1287
|
+
* 支持三个属性:1、total:总的播放器个数;2、hardware:硬解播放器个数;3、软解播放器个数,如果硬解播放器个数不满足需求,会根据cpu能力确定是否提供软解播放器。
|
|
1288
|
+
* */
|
|
1289
|
+
function setJsvPlayerNumber(videoType, num){
|
|
1290
|
+
logTrace("setPlayerNumber, key="+this.key+", videoType="+videoType+", num="+num);
|
|
1291
|
+
if(typeof window.jsvPlayerBridge !== "undefined"){
|
|
1292
|
+
return window.jsvPlayerBridge.setPlayerNumber(videoType, num);
|
|
1293
|
+
}else{
|
|
1294
|
+
return null;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1089
1298
|
export {
|
|
1090
1299
|
JsvMediaVideo,
|
|
1091
1300
|
JsvMediaAudio,
|
|
1092
1301
|
globalLoadJsvPlayerPlugin,
|
|
1093
1302
|
findMediaObjectByKey,
|
|
1094
1303
|
getJsvPlayerCapabilitySet,
|
|
1304
|
+
setJsvPlayerNumber,
|
|
1095
1305
|
setLogLevel,
|
|
1096
1306
|
logFatal,
|
|
1097
1307
|
logError,
|
|
@@ -22,6 +22,10 @@ export default {
|
|
|
22
22
|
* 属性,int类型,底层使用的播放器类型。1:系统播放器;2:jsv播放器。默认2。
|
|
23
23
|
*/
|
|
24
24
|
playerType: {type: Number, default: 2},
|
|
25
|
+
/**
|
|
26
|
+
* 属性,int类型,播放器解码方式。0:根据硬件能力自动匹配;1:硬解码;2:软解码。默认0(根据芯片能力自动匹配)。
|
|
27
|
+
*/
|
|
28
|
+
decodeType: {type: Number, default: 0},
|
|
25
29
|
/**
|
|
26
30
|
* 属性,Boolean类型,层级关系,true表示在界面的下面,false表示在界面上面,默认true。
|
|
27
31
|
*/
|
|
@@ -222,7 +226,7 @@ export default {
|
|
|
222
226
|
let first_create = true;
|
|
223
227
|
|
|
224
228
|
if(!this.video){
|
|
225
|
-
this.video = new JsvMediaVideo(this.holeId, player_type, key, background, designMap.width);
|
|
229
|
+
this.video = new JsvMediaVideo(this.holeId, player_type, key, background, designMap.width, this.decodeType);
|
|
226
230
|
}else{
|
|
227
231
|
this.video.setRef();
|
|
228
232
|
first_create = false;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
let PluginInfo={
|
|
2
|
-
//downloadUrl:"http://192.168.0.
|
|
2
|
+
// downloadUrl:"http://192.168.0.34:8080/plugin/JsvPlayer-160.dat", //插件下载地址
|
|
3
3
|
packageName:"com.qcode.jsvplayer",
|
|
4
4
|
name:"播放器插件",
|
|
5
|
-
version:"1.
|
|
6
|
-
versionCodeMin:
|
|
7
|
-
versionCodeMax:
|
|
5
|
+
version:"1.6.2", //插件需要的版本号
|
|
6
|
+
versionCodeMin:162,
|
|
7
|
+
versionCodeMax:162,
|
|
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:"3efdfaa94325d7dbf81ae80fb4834143"
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
// 不要用export default,update-env脚本不能解析
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
/********************
|
|
3
|
+
* JsvRefTaker模块
|
|
4
|
+
*
|
|
5
|
+
* 用于解决 script setup 写法,不容易通过 this.$ref.xxxx 拿到子模块的句柄,
|
|
6
|
+
* 但使用ref(null)的方式构筑的深度reactive对象又会严重影响element的内部处理性能的问题
|
|
7
|
+
*
|
|
8
|
+
* 使用方法:
|
|
9
|
+
* <script setup>
|
|
10
|
+
* const element_ref = buildTaker();
|
|
11
|
+
*
|
|
12
|
+
* onMounted(()=>{
|
|
13
|
+
* // onMounted以后,可以用 .current 访问到引用
|
|
14
|
+
* console.log(element.current)
|
|
15
|
+
* })
|
|
16
|
+
* </script>
|
|
17
|
+
*
|
|
18
|
+
* <template>
|
|
19
|
+
* <div :ref="element_ref.fnc" />
|
|
20
|
+
* </template>
|
|
21
|
+
*
|
|
22
|
+
********************/
|
|
23
|
+
|
|
24
|
+
function buildTaker() {
|
|
25
|
+
let pack = {
|
|
26
|
+
fnc: null,
|
|
27
|
+
current: null
|
|
28
|
+
}
|
|
29
|
+
pack.fnc = (r)=>{
|
|
30
|
+
pack.current = r;
|
|
31
|
+
}
|
|
32
|
+
return pack;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default buildTaker;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: ChenChanghua
|
|
3
|
+
* @Date: 2022-07-05 14:09:55
|
|
4
|
+
* @LastEditors: ChenChanghua
|
|
5
|
+
* @LastEditTime: 2022-07-06 11:03:34
|
|
6
|
+
* @Description: file content
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from "./JsvHashHistory";
|
|
10
|
+
export * from "./JsvDynamicCssStyle.js";
|
|
11
|
+
export * from "./JsvDynamicKeyFrames.js";
|
|
12
|
+
export * from "./JsvRuntimeBridge.js";
|
|
13
|
+
export * from "./NinePatchHelper";
|
|
14
|
+
export * from "./TypeCheckAndSet";
|
|
15
|
+
export * from "./JsvRefTaker.js";
|
|
16
|
+
export * from "./JsvStyleClass.js";
|
|
17
|
+
export * from "./DebugContentShellJBridge.js";
|
|
18
|
+
export * from "./DebugTool.js";
|
|
19
|
+
export { default as DefaultKeyCodeMap } from "./DefaultKeyMap.js";
|
|
@@ -18,11 +18,15 @@ export default {
|
|
|
18
18
|
},
|
|
19
19
|
imageSettings: Object
|
|
20
20
|
},
|
|
21
|
-
|
|
21
|
+
setup() {
|
|
22
22
|
return {
|
|
23
23
|
imageStyle: null,
|
|
24
|
+
qrcodeRes: null,
|
|
24
25
|
}
|
|
25
26
|
},
|
|
27
|
+
created() {
|
|
28
|
+
this.qrcodeRes = this.renderQrcode();
|
|
29
|
+
},
|
|
26
30
|
methods: {
|
|
27
31
|
convertStr(str) {
|
|
28
32
|
let out = "";
|
|
@@ -149,10 +153,10 @@ export default {
|
|
|
149
153
|
:shapeRendering="'crispEdges'"
|
|
150
154
|
:height="size"
|
|
151
155
|
:width="size"
|
|
152
|
-
:viewBox="'0 0 ' +
|
|
156
|
+
:viewBox="'0 0 ' + qrcodeRes.numCells + ' ' + qrcodeRes.numCells"
|
|
153
157
|
>
|
|
154
|
-
<jsve-path :fill="bgColor" :d="'M0,0 h' +
|
|
155
|
-
<jsve-path :fill="fgColor" :d="
|
|
158
|
+
<jsve-path :fill="bgColor" :d="'M0,0 h' + qrcodeRes.numCells + 'v' + qrcodeRes.numCells + 'H0z'" />
|
|
159
|
+
<jsve-path :fill="fgColor" :d="qrcodeRes.fgPath" />
|
|
156
160
|
</jsve-svg>
|
|
157
161
|
<div :style="imageStyle"></div>
|
|
158
162
|
</div>
|