@flexem/fc-gui 3.0.0-alpha.87 → 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 +7 -2
- package/bundles/@flexem/fc-gui.umd.js +85 -118
- 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 -6
- package/elements/video/video-element.js +79 -118
- 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
|
@@ -388,7 +388,12 @@
|
|
|
388
388
|
#### Bug Fix
|
|
389
389
|
1. FLEXCLOUD-2612 组态元件写值超时
|
|
390
390
|
|
|
391
|
-
## 3.0.0-alpha.
|
|
391
|
+
## 3.0.0-alpha.87(2023-05-31)
|
|
392
392
|
### Web端
|
|
393
393
|
#### Bug Fix
|
|
394
|
-
1. FLEXCLOUD-2698 【app-ios】视频元件放大后缩小不应占满整个组态
|
|
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,88 +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
|
-
this.
|
|
39519
|
-
return;
|
|
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;
|
|
39520
39528
|
}
|
|
39521
|
-
this.
|
|
39522
|
-
|
|
39523
|
-
|
|
39524
|
-
|
|
39525
|
-
|
|
39526
|
-
|
|
39527
|
-
|
|
39528
|
-
|
|
39529
|
-
|
|
39530
|
-
|
|
39531
|
-
|
|
39532
|
-
|
|
39533
|
-
|
|
39534
|
-
|
|
39535
|
-
|
|
39536
|
-
|
|
39537
|
-
|
|
39538
|
-
|
|
39539
|
-
|
|
39540
|
-
|
|
39541
|
-
|
|
39542
|
-
video.attr('autoplay', true);
|
|
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 ';
|
|
39543
39550
|
}
|
|
39551
|
+
videoHtml += ' autoplay muted></video>';
|
|
39544
39552
|
}
|
|
39545
39553
|
else {
|
|
39546
|
-
video
|
|
39554
|
+
videoHtml += ' controls muted></video>';
|
|
39547
39555
|
}
|
|
39548
|
-
|
|
39549
|
-
|
|
39550
|
-
|
|
39551
|
-
|
|
39552
|
-
|
|
39553
|
-
|
|
39554
|
-
|
|
39555
|
-
|
|
39556
|
-
|
|
39557
|
-
|
|
39558
|
-
|
|
39559
|
-
|
|
39560
|
-
this.rootElement.style('transform-origin', 'left top');
|
|
39561
|
-
video.style('z-index', 0);
|
|
39562
|
-
setTimeout(() => {
|
|
39563
|
-
this.videoClientRect = document.getElementById(this.videoId).getBoundingClientRect();
|
|
39564
|
-
video.style('position', 'absolute');
|
|
39565
|
-
video.style('left', this.clientRect.left + 'px');
|
|
39566
|
-
video.style('top', this.clientRect.top - svgClientRect.top + 'px');
|
|
39567
|
-
video.style('transform', `scale(${this.clientRect.width / this.videoClientRect.width}, ${this.clientRect.height / this.videoClientRect.height})`);
|
|
39568
|
-
video.style('transform-origin', 'left top');
|
|
39569
|
-
}, 300);
|
|
39570
|
-
$('#' + this.videoId).bind('webkitendfullscreen', () => {
|
|
39571
|
-
setTimeout(() => {
|
|
39572
|
-
video.style('width', this.videoClientRect.width + 'px');
|
|
39573
|
-
video.style('height', this.videoClientRect.height + 'px');
|
|
39574
|
-
}, 1000);
|
|
39575
|
-
});
|
|
39576
|
-
}
|
|
39577
|
-
this.videoPlayer = new EZUIPlayer(this.videoId);
|
|
39578
|
-
if (isAndroid) {
|
|
39579
|
-
setTimeout(() => {
|
|
39580
|
-
this.setAndroidVideo();
|
|
39581
|
-
}, 500);
|
|
39582
|
-
}
|
|
39583
|
-
}).catch(() => {
|
|
39584
|
-
throw new Error('Failure of the videoService');
|
|
39585
|
-
});
|
|
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
|
+
}
|
|
39586
39568
|
}
|
|
39587
39569
|
addVideoAddressToolTip(videoToolTip) {
|
|
39588
39570
|
const size = this.model.size;
|
|
@@ -39604,50 +39586,35 @@ class video_element_VideoElement extends conditional_display_element_Conditional
|
|
|
39604
39586
|
const textElement = new text_element_TextElementModal(videoToolTip, font, size.width, size.height);
|
|
39605
39587
|
this.$element.append(textElement.Element);
|
|
39606
39588
|
}
|
|
39607
|
-
setAndroidVideo() {
|
|
39608
|
-
|
|
39609
|
-
|
|
39610
|
-
|
|
39611
|
-
|
|
39612
|
-
|
|
39613
|
-
|
|
39614
|
-
|
|
39615
|
-
|
|
39616
|
-
|
|
39617
|
-
|
|
39618
|
-
|
|
39619
|
-
|
|
39620
|
-
|
|
39621
|
-
|
|
39622
|
-
|
|
39623
|
-
|
|
39624
|
-
|
|
39625
|
-
|
|
39626
|
-
|
|
39627
|
-
|
|
39628
|
-
'z-index': 99
|
|
39629
|
-
});
|
|
39630
|
-
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;
|
|
39631
39610
|
}
|
|
39632
39611
|
else {
|
|
39633
|
-
|
|
39634
|
-
|
|
39635
|
-
|
|
39636
|
-
|
|
39637
|
-
|
|
39638
|
-
|
|
39639
|
-
this.resetTimer = null;
|
|
39640
|
-
$('#' + this.videoId).css('display', 'none');
|
|
39641
|
-
this.resetTimer = setTimeout(() => {
|
|
39642
|
-
$('#' + this.videoId).css({
|
|
39643
|
-
'width': '100%',
|
|
39644
|
-
'height': '100%',
|
|
39645
|
-
'display': 'block',
|
|
39646
|
-
'z-index': 0,
|
|
39647
|
-
'object-fit': document.webkitIsFullScreen ? 'contain' : 'fill'
|
|
39648
|
-
});
|
|
39649
|
-
}, 1000);
|
|
39650
|
-
}
|
|
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;
|
|
39651
39618
|
}
|
|
39652
39619
|
});
|
|
39653
39620
|
}
|