@flexem/fc-gui 3.0.0-alpha.96 → 3.0.0-alpha.97

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/CHANGELOG.md CHANGED
@@ -388,7 +388,29 @@
388
388
  #### Bug Fix
389
389
  1. FLEXCLOUD-2612 组态元件写值超时
390
390
 
391
- ## 3.0.0-alpha.96(2023-09-26)
391
+ ## 3.0.0-alpha.87(2023-05-31)
392
392
  ### Web端
393
393
  #### Bug Fix
394
- 1. FLEXCLOUD-2864 2018年创建的模板组态写值失败(在补丁包v2.22.0-Hotfix5中使用,其它分支不要用)
394
+ 1. FLEXCLOUD-2698 【app-ios】视频元件放大后缩小不应占满整个组态
395
+
396
+ ## 3.0.0-alpha.88(2023-06-01)
397
+ ### Web端
398
+ #### Bug Fix
399
+ 1. FLEXCLOUD-2699、FLEXCLOUD-2700 将视频元件还原为在组态外渲染,并且在弹窗时隐藏视频
400
+
401
+ ## 3.0.0-alpha.89(2023-06-01)
402
+ ### Web端
403
+ #### Bug Fix
404
+ 1. FLEXCLOUD-2699、FLEXCLOUD-2700 修改视频元件,优化视频显示逻辑
405
+
406
+ ## 3.0.0-alpha.90(2023-06-06)
407
+ ### Web端
408
+ #### Bug Fix
409
+ 1. 安卓和鸿蒙系统上,组态横屏时不再显示状态栏
410
+ 2. 修复在鸿蒙系统的手机上,视频元件的控制按钮显示异常的问题
411
+ 3. 修复ios系统中视频放大缩小后,画面会变形的问题
412
+
413
+ ## 3.0.0-alpha.97(2023-09-26)
414
+ ### Web端
415
+ #### Bug Fix
416
+ 1. FLEXCLOUD-2864 2018年创建的模板组态写值失败(给APP补丁包v2.8.0中使用)
@@ -33767,7 +33767,7 @@ function styleFunction(name, value, priority) {
33767
33767
  };
33768
33768
  }
33769
33769
 
33770
- /* harmony default export */ var style = (function(name, value, priority) {
33770
+ /* harmony default export */ var selection_style = (function(name, value, priority) {
33771
33771
  return arguments.length > 1
33772
33772
  ? this.each((value == null
33773
33773
  ? styleRemove : typeof value === "function"
@@ -34222,7 +34222,7 @@ Selection.prototype = selection_selection.prototype = {
34222
34222
  empty: selection_empty,
34223
34223
  each: each,
34224
34224
  attr: attr,
34225
- style: style,
34225
+ style: selection_style,
34226
34226
  property: property,
34227
34227
  classed: classed,
34228
34228
  text: selection_text,
@@ -39313,6 +39313,9 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
39313
39313
  const viewIndex = this.model.viewIndex;
39314
39314
  if (null != viewIndex) {
39315
39315
  this.popupViewService.popView(viewIndex, this.hostContainerId, this.el).subscribe(() => this.recordViewOperation(), error => this.logger.error(`ToggleView(${viewIndex}) failed. ${error}`));
39316
+ $(`#${this.hostContainerId} video`)
39317
+ .addClass('video-hidden')
39318
+ .css('visibility', 'hidden');
39316
39319
  }
39317
39320
  else {
39318
39321
  this.logger.error('[GUI]Toggle View:invalid view index');
@@ -39320,6 +39323,11 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
39320
39323
  }
39321
39324
  closeView() {
39322
39325
  this.popupViewService.closeView();
39326
+ if ($(`#${this.hostContainerId} > svg > svg`).length === 0) {
39327
+ $(`#${this.hostContainerId} .video-hidden`)
39328
+ .removeClass('video-hidden')
39329
+ .css('visibility', 'visible');
39330
+ }
39323
39331
  this.recordViewOperation();
39324
39332
  }
39325
39333
  moveView(movementX, movementY) {
@@ -39466,6 +39474,7 @@ class video_element_VideoElement extends conditional_display_element_Conditional
39466
39474
  this.guiSize = guiSize;
39467
39475
  this.svgRootClass = svgRootClass;
39468
39476
  this.videoId = '';
39477
+ this.isFullscreen = false;
39469
39478
  this.isMobileMode = _tmp_settings["a" /* DisplayMode */].Mobile === injector.get(_tmp_settings["b" /* GlobalSettings */]).displayMode;
39470
39479
  this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
39471
39480
  this.init();
@@ -39501,60 +39510,79 @@ class video_element_VideoElement extends conditional_display_element_Conditional
39501
39510
  return;
39502
39511
  }
39503
39512
  this.videoId = guid["a" /* Guid */].newGuid().toString('n');
39513
+ this.rootElement.append('rect').attr('id', 'rect' + this.videoId).attr('fill', 'transparent')
39514
+ .attr('width', this.model.size.width)
39515
+ .attr('height', this.model.size.height);
39504
39516
  this.videoService.getVideoUrl(this.model.videoTag).then(result => {
39505
- this.isMobileType = result.isMobileType;
39506
- const isAndroid = !!navigator.userAgent.match(/(Android)/i);
39507
- let videoUrl = result.url;
39508
- const patt = /https:.+.m3u8/;
39509
- if (videoUrl.indexOf('http:') !== -1) {
39510
- videoUrl = videoUrl.replace('http:', 'https:');
39511
- }
39512
- if (!patt.test(videoUrl)) {
39513
- let videoToolTip = this.localization.invalidVideoAddress;
39514
- if (Object(lodash["isNil"])(videoUrl) || videoUrl === '') {
39515
- videoToolTip = this.localization.unconfiguredVideoAddress;
39516
- }
39517
- this.addVideoAddressToolTip(videoToolTip);
39518
- return;
39517
+ this.videoUrl = result.url;
39518
+ this.initVideo(result.url, this.videoId);
39519
+ }).catch(() => {
39520
+ throw new Error('Failure of the videoService');
39521
+ });
39522
+ }
39523
+ initVideo(videoUrl, videoId) {
39524
+ const patt = /https:.+.m3u8/;
39525
+ if (videoUrl.indexOf('http:') !== -1) {
39526
+ videoUrl = videoUrl.replace('http:', 'https:');
39527
+ }
39528
+ if (!patt.test(videoUrl)) {
39529
+ let videoToolTip = this.localization.invalidVideoAddress;
39530
+ if (Object(lodash["isNil"])(videoUrl) || videoUrl === '') {
39531
+ videoToolTip = this.localization.unconfiguredVideoAddress;
39519
39532
  }
39520
- const video = this.rootElement.append('foreignObject')
39521
- .attr('x', 0)
39522
- .attr('y', 0)
39523
- .attr('width', this.model.size.width)
39524
- .attr('height', this.model.size.height)
39525
- .append('xhtml:video')
39526
- .attr('id', this.videoId)
39527
- .attr('class', 'element-video')
39528
- .attr('scareX', this.model.location.x / this.guiSize.width)
39529
- .attr('scareY', this.model.location.y / this.guiSize.height)
39530
- .attr('src', videoUrl)
39531
- .style('width', '100%')
39532
- .style('height', '100%')
39533
- .style('object-fit', 'fill')
39534
- .attr('playsInline', true)
39535
- .attr('webkit-playsinline', true)
39536
- .attr('controls', true)
39537
- .attr('muted', true);
39538
- if (this.isMobileMode) {
39539
- if (isAndroid) {
39540
- video.attr('autoplay', true);
39541
- }
39533
+ this.addVideoAddressToolTip(videoToolTip);
39534
+ return;
39535
+ }
39536
+ const isAndroid = !!navigator.userAgent.match(/(Android)/i);
39537
+ const isIos = !!navigator.userAgent.match(/(Mac)/i);
39538
+ const currentRect = this.$element.find('rect#rect' + videoId).first();
39539
+ if (!currentRect.length) {
39540
+ return;
39541
+ }
39542
+ const clientRect = currentRect[0].getBoundingClientRect();
39543
+ const chartWidth = clientRect.width;
39544
+ const chartHeight = clientRect.height;
39545
+ const left = this.model.location.x / this.guiSize.width * $('.' + this.svgRootClass).find('.svg-content').width();
39546
+ const top = this.model.location.y / this.guiSize.height * $('.' + this.svgRootClass).find('.svg-content').height();
39547
+ const scareX = this.model.location.x / this.guiSize.width;
39548
+ const scareY = this.model.location.y / this.guiSize.height;
39549
+ if (isIos) {
39550
+ videoUrl = videoUrl + '#t=1';
39551
+ }
39552
+ const preload = isIos ? ' preload=\'metadata\'' : '';
39553
+ let videoHtml = `<video scareX="${scareX}"
39554
+ scareY="${scareY}" id="${videoId}" ${preload} src="${videoUrl}" width="${chartWidth}" height="${chartHeight}"
39555
+ style="position: absolute;top:${top}px;left:${left}px;object-fit:fill;z-index:0;"
39556
+ playsInline webkit-playsinline `;
39557
+ if (this.isMobileMode) {
39558
+ if (isAndroid) {
39559
+ videoHtml += ' autoplay muted></video>';
39542
39560
  }
39543
39561
  else {
39544
- video.attr('autoplay', true);
39545
- }
39546
- if (this.isShow === false) {
39547
- $('#' + this.videoId).hide();
39562
+ videoHtml += ' controls muted></video>';
39548
39563
  }
39549
- this.videoPlayer = new EZUIPlayer(this.videoId);
39564
+ }
39565
+ else {
39566
+ videoHtml += ' controls autoplay muted></video>';
39567
+ }
39568
+ $('.' + this.svgRootClass).find('.svg-content').append(videoHtml);
39569
+ if (this.isShow === false) {
39570
+ $('#' + this.videoId).hide();
39571
+ }
39572
+ setTimeout(() => {
39550
39573
  if (isAndroid) {
39551
- setTimeout(() => {
39552
- this.setAndroidVideo();
39553
- }, 500);
39574
+ this.setAndroidVideo(videoId);
39554
39575
  }
39555
- }).catch(() => {
39556
- throw new Error('Failure of the videoService');
39557
- });
39576
+ else if (isIos) {
39577
+ this.setIosVideo(this.videoUrl, videoId);
39578
+ }
39579
+ this.videoPlayer = new EZUIPlayer(videoId);
39580
+ }, 1000);
39581
+ const style = document.createElement('style');
39582
+ style.innerHTML = `#${videoId}::-webkit-media-controls-enclosure {
39583
+ display: none;
39584
+ }`;
39585
+ document.head.append();
39558
39586
  }
39559
39587
  addVideoAddressToolTip(videoToolTip) {
39560
39588
  const size = this.model.size;
@@ -39576,53 +39604,71 @@ class video_element_VideoElement extends conditional_display_element_Conditional
39576
39604
  const textElement = new text_element_TextElementModal(videoToolTip, font, size.width, size.height);
39577
39605
  this.$element.append(textElement.Element);
39578
39606
  }
39579
- setAndroidVideo() {
39580
- const { StatusBar } = window;
39581
- this.bindFullscreenEvent();
39582
- window.addEventListener('orientationchange', () => {
39583
- StatusBar.show();
39584
- this.hide();
39585
- clearTimeout(this.refreshTimer);
39586
- this.refreshTimer = null;
39587
- this.refreshTimer = setTimeout(() => {
39588
- this.init();
39589
- this.show();
39590
- }, 1000);
39591
- });
39592
- }
39593
- bindFullscreenEvent() {
39594
- const that = this;
39607
+ setAndroidVideo(videoId) {
39608
+ const videoElement = $('#' + videoId);
39609
+ let preHeight = videoElement.height();
39610
+ let preWidth = videoElement.width();
39611
+ let preTop = videoElement.css('top');
39612
+ let preLeft = videoElement.css('left');
39595
39613
  const { StatusBar } = window;
39596
- $('#' + this.videoId).bind('webkitfullscreenchange', () => {
39597
- if (document.webkitIsFullScreen) {
39598
- $('#' + that.videoId).css({
39599
- 'object-fit': 'contain',
39600
- 'z-index': 99
39601
- });
39602
- StatusBar.hide();
39614
+ videoElement.on('click', () => {
39615
+ if (!this.isFullscreen) {
39616
+ if (StatusBar) {
39617
+ StatusBar.hide();
39618
+ }
39619
+ preHeight = videoElement.height();
39620
+ preWidth = videoElement.width();
39621
+ preTop = videoElement.css('top');
39622
+ preLeft = videoElement.css('left');
39623
+ const width = document.documentElement.clientWidth;
39624
+ const height = document.documentElement.clientHeight;
39625
+ videoElement.css('object-fit', 'contain');
39626
+ videoElement.css('background', '#000000');
39627
+ videoElement.css('width', width + 'px');
39628
+ videoElement.css('height', height + 'px');
39629
+ videoElement.css('left', '0px');
39630
+ videoElement.css('top', '0px');
39631
+ videoElement.css('z-index', '99');
39632
+ videoElement.css('position', 'fixed');
39633
+ this.isFullscreen = true;
39634
+ try {
39635
+ screen.orientation.lock(screen.orientation.type);
39636
+ }
39637
+ catch (error) {
39638
+ console.error(error);
39639
+ }
39603
39640
  }
39604
39641
  else {
39605
- StatusBar.show();
39606
- if (that.isMobileType) {
39607
- $('#' + this.videoId).css('object-fit', document.webkitIsFullScreen ? 'contain' : 'fill');
39642
+ videoElement.css('object-fit', 'fill');
39643
+ videoElement.css('width', preWidth + 'px');
39644
+ videoElement.css('height', preHeight + 'px');
39645
+ videoElement.css('left', preLeft);
39646
+ videoElement.css('top', preTop);
39647
+ videoElement.css('z-index', '0');
39648
+ videoElement.css('position', 'absolute');
39649
+ this.isFullscreen = false;
39650
+ try {
39651
+ if (screen.orientation.type.includes('portrait')) {
39652
+ StatusBar.show();
39653
+ }
39608
39654
  }
39609
- else {
39610
- clearTimeout(this.resetTimer);
39611
- this.resetTimer = null;
39612
- $('#' + this.videoId).css('display', 'none');
39613
- this.resetTimer = setTimeout(() => {
39614
- $('#' + this.videoId).css({
39615
- 'width': '100%',
39616
- 'height': '100%',
39617
- 'display': 'block',
39618
- 'z-index': 0,
39619
- 'object-fit': document.webkitIsFullScreen ? 'contain' : 'fill'
39620
- });
39621
- }, 1000);
39655
+ catch (error) {
39656
+ console.error(error);
39622
39657
  }
39623
39658
  }
39624
39659
  });
39625
39660
  }
39661
+ setIosVideo(videoUrl, videoId) {
39662
+ const video = $('#' + this.videoId);
39663
+ video.on('webkitendfullscreen', () => {
39664
+ video.remove();
39665
+ clearTimeout(this.refreshTimer);
39666
+ this.refreshTimer = null;
39667
+ this.refreshTimer = setTimeout(() => {
39668
+ this.initVideo(videoUrl, videoId);
39669
+ }, 500);
39670
+ });
39671
+ }
39626
39672
  }
39627
39673
 
39628
39674
  // CONCATENATED MODULE: ./.tmp/elements/weather/weater-element.ts