@flexem/fc-gui 3.0.0-alpha.86 → 3.0.0-alpha.88
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 +11 -1
- package/bundles/@flexem/fc-gui.umd.js +85 -90
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +4 -4
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/video/video-element.d.ts +1 -4
- package/elements/video/video-element.js +79 -90
- package/elements/video/video-element.metadata.json +1 -1
- package/elements/view-operation/view-operation.element.js +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -386,4 +386,14 @@
|
|
|
386
386
|
## 3.0.0-alpha.86(2023-05-12)
|
|
387
387
|
### Web端
|
|
388
388
|
#### Bug Fix
|
|
389
|
-
1. FLEXCLOUD-2612 组态元件写值超时
|
|
389
|
+
1. FLEXCLOUD-2612 组态元件写值超时
|
|
390
|
+
|
|
391
|
+
## 3.0.0-alpha.87(2023-05-31)
|
|
392
|
+
### Web端
|
|
393
|
+
#### Bug Fix
|
|
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 将视频元件还原为在组态外渲染,并且在弹窗时隐藏视频
|
|
@@ -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,9 @@ class view_operation_element_ViewOperationElement extends conditional_enable_ele
|
|
|
39320
39323
|
}
|
|
39321
39324
|
closeView() {
|
|
39322
39325
|
this.popupViewService.closeView();
|
|
39326
|
+
$(`#${this.hostContainerId} .video-hidden`)
|
|
39327
|
+
.removeClass('video-hidden')
|
|
39328
|
+
.css('visibility', 'visible');
|
|
39323
39329
|
this.recordViewOperation();
|
|
39324
39330
|
}
|
|
39325
39331
|
moveView(movementX, movementY) {
|
|
@@ -39501,60 +39507,64 @@ class video_element_VideoElement extends conditional_display_element_Conditional
|
|
|
39501
39507
|
return;
|
|
39502
39508
|
}
|
|
39503
39509
|
this.videoId = guid["a" /* Guid */].newGuid().toString('n');
|
|
39510
|
+
this.rootElement.append('rect').attr('id', 'rect' + this.videoId).attr('fill', 'transparent')
|
|
39511
|
+
.attr('width', this.model.size.width)
|
|
39512
|
+
.attr('height', this.model.size.height);
|
|
39504
39513
|
this.videoService.getVideoUrl(this.model.videoTag).then(result => {
|
|
39505
|
-
this.
|
|
39506
|
-
|
|
39507
|
-
|
|
39508
|
-
|
|
39509
|
-
|
|
39510
|
-
|
|
39511
|
-
|
|
39512
|
-
|
|
39513
|
-
|
|
39514
|
-
|
|
39515
|
-
|
|
39516
|
-
|
|
39517
|
-
|
|
39518
|
-
|
|
39514
|
+
this.initVideo(result.url, result.isMobileType, this.videoId);
|
|
39515
|
+
}).catch(() => {
|
|
39516
|
+
throw new Error('Failure of the videoService');
|
|
39517
|
+
});
|
|
39518
|
+
}
|
|
39519
|
+
initVideo(videoUrl, isMobileType, videoId) {
|
|
39520
|
+
const patt = /https:.+.m3u8/;
|
|
39521
|
+
if (videoUrl.indexOf('http:') !== -1) {
|
|
39522
|
+
videoUrl = videoUrl.replace('http:', 'https:');
|
|
39523
|
+
}
|
|
39524
|
+
if (!patt.test(videoUrl)) {
|
|
39525
|
+
let videoToolTip = this.localization.invalidVideoAddress;
|
|
39526
|
+
if (Object(lodash["isNil"])(videoUrl) || videoUrl === '') {
|
|
39527
|
+
videoToolTip = this.localization.unconfiguredVideoAddress;
|
|
39519
39528
|
}
|
|
39520
|
-
|
|
39521
|
-
|
|
39522
|
-
|
|
39523
|
-
|
|
39524
|
-
|
|
39525
|
-
|
|
39526
|
-
|
|
39527
|
-
|
|
39528
|
-
|
|
39529
|
-
|
|
39530
|
-
|
|
39531
|
-
|
|
39532
|
-
|
|
39533
|
-
|
|
39534
|
-
|
|
39535
|
-
|
|
39536
|
-
|
|
39537
|
-
|
|
39538
|
-
if (
|
|
39539
|
-
if (
|
|
39540
|
-
|
|
39529
|
+
this.addVideoAddressToolTip(videoToolTip);
|
|
39530
|
+
return;
|
|
39531
|
+
}
|
|
39532
|
+
const currentRect = this.$element.find('rect#rect' + videoId).first();
|
|
39533
|
+
if (!currentRect.length) {
|
|
39534
|
+
return;
|
|
39535
|
+
}
|
|
39536
|
+
const clientRect = currentRect[0].getBoundingClientRect();
|
|
39537
|
+
const chartWidth = clientRect.width;
|
|
39538
|
+
const chartHeight = clientRect.height;
|
|
39539
|
+
const left = this.model.location.x / this.guiSize.width * $('.' + this.svgRootClass).find('.svg-content').width();
|
|
39540
|
+
const top = this.model.location.y / this.guiSize.height * $('.' + this.svgRootClass).find('.svg-content').height();
|
|
39541
|
+
let videoHtml = `<video scareX="${this.model.location.x / this.guiSize.width}"
|
|
39542
|
+
scareY="${this.model.location.y / this.guiSize.height}" id="${videoId}" src="${videoUrl}" style="
|
|
39543
|
+
position: absolute;top:${top}px;left:${left}px;width:${chartWidth}px;height:${chartHeight}px;object-fit:fill;z-index:0"
|
|
39544
|
+
playsInline webkit-playsinline `;
|
|
39545
|
+
const isAndroid = !!navigator.userAgent.match(/(Android)/i);
|
|
39546
|
+
if (this.isMobileMode) {
|
|
39547
|
+
if (isAndroid) {
|
|
39548
|
+
if (isMobileType) {
|
|
39549
|
+
videoHtml += ' controls ';
|
|
39541
39550
|
}
|
|
39551
|
+
videoHtml += ' autoplay muted></video>';
|
|
39542
39552
|
}
|
|
39543
39553
|
else {
|
|
39544
|
-
video
|
|
39554
|
+
videoHtml += ' controls muted></video>';
|
|
39545
39555
|
}
|
|
39546
|
-
|
|
39547
|
-
|
|
39548
|
-
|
|
39549
|
-
|
|
39550
|
-
|
|
39551
|
-
|
|
39552
|
-
|
|
39553
|
-
|
|
39554
|
-
|
|
39555
|
-
|
|
39556
|
-
|
|
39557
|
-
}
|
|
39556
|
+
}
|
|
39557
|
+
else {
|
|
39558
|
+
videoHtml += ' controls autoplay muted></video>';
|
|
39559
|
+
}
|
|
39560
|
+
$('.' + this.svgRootClass).find('.svg-content').append(videoHtml);
|
|
39561
|
+
if (this.isShow === false) {
|
|
39562
|
+
$('#' + this.videoId).hide();
|
|
39563
|
+
}
|
|
39564
|
+
this.videoPlayer = new EZUIPlayer(videoId);
|
|
39565
|
+
if (isAndroid && !isMobileType) {
|
|
39566
|
+
this.setAndroidVideo(videoId);
|
|
39567
|
+
}
|
|
39558
39568
|
}
|
|
39559
39569
|
addVideoAddressToolTip(videoToolTip) {
|
|
39560
39570
|
const size = this.model.size;
|
|
@@ -39576,50 +39586,35 @@ class video_element_VideoElement extends conditional_display_element_Conditional
|
|
|
39576
39586
|
const textElement = new text_element_TextElementModal(videoToolTip, font, size.width, size.height);
|
|
39577
39587
|
this.$element.append(textElement.Element);
|
|
39578
39588
|
}
|
|
39579
|
-
setAndroidVideo() {
|
|
39580
|
-
|
|
39581
|
-
|
|
39582
|
-
|
|
39583
|
-
|
|
39584
|
-
|
|
39585
|
-
|
|
39586
|
-
|
|
39587
|
-
|
|
39588
|
-
|
|
39589
|
-
|
|
39590
|
-
|
|
39591
|
-
|
|
39592
|
-
|
|
39593
|
-
|
|
39594
|
-
|
|
39595
|
-
|
|
39596
|
-
|
|
39597
|
-
|
|
39598
|
-
|
|
39599
|
-
|
|
39600
|
-
'z-index': 99
|
|
39601
|
-
});
|
|
39602
|
-
StatusBar.hide();
|
|
39589
|
+
setAndroidVideo(videoId) {
|
|
39590
|
+
let isFullscreen = false;
|
|
39591
|
+
const videoElement = $('#' + videoId);
|
|
39592
|
+
let preHeight = videoElement.height();
|
|
39593
|
+
let preWidth = videoElement.width();
|
|
39594
|
+
let preTop = videoElement.css('top');
|
|
39595
|
+
let preLeft = videoElement.css('left');
|
|
39596
|
+
videoElement.on('click', () => {
|
|
39597
|
+
if (!isFullscreen) {
|
|
39598
|
+
preHeight = videoElement.height();
|
|
39599
|
+
preWidth = videoElement.width();
|
|
39600
|
+
preTop = videoElement.css('top');
|
|
39601
|
+
preLeft = videoElement.css('left');
|
|
39602
|
+
const width = document.body.clientWidth;
|
|
39603
|
+
const height = width * 9 / 16;
|
|
39604
|
+
videoElement.css('width', width + 'px');
|
|
39605
|
+
videoElement.css('height', height + 'px');
|
|
39606
|
+
videoElement.css('left', '0px');
|
|
39607
|
+
videoElement.css('top', '0px');
|
|
39608
|
+
videoElement.css('z-index', '99');
|
|
39609
|
+
isFullscreen = true;
|
|
39603
39610
|
}
|
|
39604
39611
|
else {
|
|
39605
|
-
|
|
39606
|
-
|
|
39607
|
-
|
|
39608
|
-
|
|
39609
|
-
|
|
39610
|
-
|
|
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);
|
|
39622
|
-
}
|
|
39612
|
+
videoElement.css('width', preWidth + 'px');
|
|
39613
|
+
videoElement.css('height', preHeight + 'px');
|
|
39614
|
+
videoElement.css('left', preLeft);
|
|
39615
|
+
videoElement.css('top', preTop);
|
|
39616
|
+
videoElement.css('z-index', '0');
|
|
39617
|
+
isFullscreen = false;
|
|
39623
39618
|
}
|
|
39624
39619
|
});
|
|
39625
39620
|
}
|