@flexem/fc-gui 3.0.0-alpha.141 → 3.0.0-alpha.142

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.
@@ -41082,8 +41082,10 @@ class video_element_VideoElement extends conditional_display_element_Conditional
41082
41082
  this.svgRootClass = svgRootClass;
41083
41083
  this.videoId = '';
41084
41084
  this.isFullscreen = false;
41085
+ this.lastTimeUpdate = 0;
41085
41086
  this.isMobileMode = _tmp_settings["a" /* DisplayMode */].Mobile === injector.get(_tmp_settings["b" /* GlobalSettings */]).displayMode;
41086
41087
  this.localization = injector.get(_tmp_localization["b" /* LOCALIZATION */]);
41088
+ this.initVisibilityHandler();
41087
41089
  this.init();
41088
41090
  }
41089
41091
  dispose() {
@@ -41093,6 +41095,10 @@ class video_element_VideoElement extends conditional_display_element_Conditional
41093
41095
  $('div.' + this.svgRootClass + ' video').each(function () {
41094
41096
  $(this).remove();
41095
41097
  });
41098
+ if (this.visibilityChangeHandler) {
41099
+ document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
41100
+ }
41101
+ this.clearTimeUpdateWatchdog();
41096
41102
  }
41097
41103
  hide() {
41098
41104
  super.hide();
@@ -41191,6 +41197,7 @@ class video_element_VideoElement extends conditional_display_element_Conditional
41191
41197
  this.videoPlayer.play();
41192
41198
  });
41193
41199
  }
41200
+ this.startTimeUpdateWatchdog(videoId);
41194
41201
  }
41195
41202
  catch (err) {
41196
41203
  console.log(err);
@@ -41276,6 +41283,37 @@ class video_element_VideoElement extends conditional_display_element_Conditional
41276
41283
  }
41277
41284
  });
41278
41285
  }
41286
+ initVisibilityHandler() {
41287
+ this.visibilityChangeHandler = () => {
41288
+ if (!document.hidden && this.videoUrl && this.videoId) {
41289
+ this.initVideo(this.videoUrl, this.videoId);
41290
+ }
41291
+ };
41292
+ document.addEventListener('visibilitychange', this.visibilityChangeHandler);
41293
+ }
41294
+ startTimeUpdateWatchdog(videoId) {
41295
+ this.clearTimeUpdateWatchdog();
41296
+ this.lastTimeUpdate = Date.now();
41297
+ const videoEl = document.getElementById(videoId);
41298
+ if (videoEl && videoEl.tagName === 'VIDEO') {
41299
+ videoEl.addEventListener('timeupdate', () => {
41300
+ this.lastTimeUpdate = Date.now();
41301
+ });
41302
+ }
41303
+ this.timeUpdateWatchdog = setInterval(() => {
41304
+ if (document.hidden)
41305
+ return;
41306
+ if (Date.now() - this.lastTimeUpdate > 30000) {
41307
+ this.initVideo(this.videoUrl, this.videoId);
41308
+ }
41309
+ }, 30000);
41310
+ }
41311
+ clearTimeUpdateWatchdog() {
41312
+ if (this.timeUpdateWatchdog) {
41313
+ clearInterval(this.timeUpdateWatchdog);
41314
+ this.timeUpdateWatchdog = null;
41315
+ }
41316
+ }
41279
41317
  setIosVideo(videoUrl, videoId) {
41280
41318
  const video = $('#' + this.videoId);
41281
41319
  video.on('webkitendfullscreen', () => {
@@ -42494,7 +42532,7 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
42494
42532
  this.container = document.createElement('div');
42495
42533
  this.container.style.cssText = `
42496
42534
  height: ${elementHeight}px;
42497
- width: 100%;
42535
+ width: ${elementWidth}px;
42498
42536
  background-color: ${((_a = this.model.generalSetting) === null || _a === void 0 ? void 0 : _a.headerFillColor) || '#ffffff'};
42499
42537
  display: flex;
42500
42538
  align-items: center;
@@ -42505,11 +42543,11 @@ class scroll_alarm_element_ScrollAlarmElement extends conditional_dynamic_displa
42505
42543
  `;
42506
42544
  this.element.appendChild(this.container);
42507
42545
  // 创建一个大容器来包含所有告警项,初始位置在容器右侧(从右边开始滚入)
42546
+ // 使用 position: relative 而非 absolute,避免 iOS Safari foreignObject 内 absolute 定位逃逸到页面左上角的 bug
42508
42547
  this.allAlarmsContainer = document.createElement('div');
42509
42548
  this.allAlarmsContainer.style.cssText = `
42510
- position: absolute;
42511
- top: 50%;
42512
- transform: translateY(-50%);
42549
+ position: relative;
42550
+ flex-shrink: 0;
42513
42551
  display: flex;
42514
42552
  align-items: center;
42515
42553
  gap: 80px;