@flexem/fc-gui 3.0.0-alpha.59 → 3.0.0-alpha.60
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/bundles/@flexem/fc-gui.umd.js +51 -52
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/video/video-element.d.ts +0 -1
- package/elements/video/video-element.js +51 -52
- package/elements/video/video-element.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -46,64 +46,63 @@ export class VideoElement extends ConditionalDisplayElement {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
this.videoId = Guid.newGuid().toString('n');
|
|
49
|
-
this.rootElement.append('rect').attr('id', 'rect' + this.videoId).attr('fill', 'transparent')
|
|
50
|
-
.attr('width', this.model.size.width)
|
|
51
|
-
.attr('height', this.model.size.height);
|
|
52
49
|
this.videoService.getVideoUrl(this.model.videoTag).then(result => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
initVideo(videoUrl, isMobileType, videoId) {
|
|
59
|
-
const patt = /https:.+.m3u8/;
|
|
60
|
-
if (videoUrl.indexOf('http:') !== -1) {
|
|
61
|
-
videoUrl = videoUrl.replace('http:', 'https:');
|
|
62
|
-
}
|
|
63
|
-
if (!patt.test(videoUrl)) {
|
|
64
|
-
let videoToolTip = this.localization.invalidVideoAddress;
|
|
65
|
-
if (isNil(videoUrl) || videoUrl === '') {
|
|
66
|
-
videoToolTip = this.localization.unconfiguredVideoAddress;
|
|
50
|
+
const isAndroid = !!navigator.userAgent.match(/(Android)/i);
|
|
51
|
+
let videoUrl = result.url;
|
|
52
|
+
const patt = /https:.+.m3u8/;
|
|
53
|
+
if (videoUrl.indexOf('http:') !== -1) {
|
|
54
|
+
videoUrl = videoUrl.replace('http:', 'https:');
|
|
67
55
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
56
|
+
if (!patt.test(videoUrl)) {
|
|
57
|
+
let videoToolTip = this.localization.invalidVideoAddress;
|
|
58
|
+
if (isNil(videoUrl) || videoUrl === '') {
|
|
59
|
+
videoToolTip = this.localization.unconfiguredVideoAddress;
|
|
60
|
+
}
|
|
61
|
+
this.addVideoAddressToolTip(videoToolTip);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const video = this.rootElement.append('foreignObject')
|
|
65
|
+
.attr('x', 0)
|
|
66
|
+
.attr('y', 0)
|
|
67
|
+
.attr('width', this.model.size.width)
|
|
68
|
+
.attr('height', this.model.size.height)
|
|
69
|
+
.append('xhtml:video')
|
|
70
|
+
.attr('id', this.videoId)
|
|
71
|
+
.attr('scareX', this.model.location.x / this.guiSize.width)
|
|
72
|
+
.attr('scareY', this.model.location.y / this.guiSize.height)
|
|
73
|
+
.attr('src', videoUrl)
|
|
74
|
+
.style('width', '100%')
|
|
75
|
+
.style('height', '100%')
|
|
76
|
+
.attr('playsInline', true)
|
|
77
|
+
.attr('webkit-playsinline', true);
|
|
78
|
+
if (this.isMobileMode) {
|
|
79
|
+
if (isAndroid) {
|
|
80
|
+
if (result.isMobileType) {
|
|
81
|
+
video.attr('controls', true);
|
|
82
|
+
}
|
|
83
|
+
video.attr('autoplay', true);
|
|
84
|
+
video.attr('muted', true);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
video.attr('controls', true);
|
|
88
|
+
video.attr('muted', true);
|
|
89
89
|
}
|
|
90
|
-
videoHtml += ' autoplay muted></video>';
|
|
91
90
|
}
|
|
92
91
|
else {
|
|
93
|
-
|
|
92
|
+
video.attr('controls', true);
|
|
93
|
+
video.attr('autoplay', true);
|
|
94
|
+
video.attr('muted', true);
|
|
94
95
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
this.setAndroidVideo(videoId);
|
|
106
|
-
}
|
|
96
|
+
if (this.isShow === false) {
|
|
97
|
+
$('#' + this.videoId).hide();
|
|
98
|
+
}
|
|
99
|
+
this.videoPlayer = new EZUIPlayer(this.videoId);
|
|
100
|
+
if (isAndroid && !result.isMobileType) {
|
|
101
|
+
this.setAndroidVideo(this.videoId);
|
|
102
|
+
}
|
|
103
|
+
}).catch(() => {
|
|
104
|
+
throw new Error('Failure of the videoService');
|
|
105
|
+
});
|
|
107
106
|
}
|
|
108
107
|
addVideoAddressToolTip(videoToolTip) {
|
|
109
108
|
const size = this.model.size;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"VideoElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":15,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":23,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":24,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":25,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":26,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":27,"character":23},{"__symbolic":"reference","module":"../../service","name":"VideoService","line":28,"character":39},{"__symbolic":"reference","module":"../../model","name":"Size","line":29,"character":34},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"hide":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"VideoElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":15,"character":34},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":23,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":24,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":25,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":26,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":27,"character":23},{"__symbolic":"reference","module":"../../service","name":"VideoService","line":28,"character":39},{"__symbolic":"reference","module":"../../model","name":"Size","line":29,"character":34},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"hide":[{"__symbolic":"method"}],"show":[{"__symbolic":"method"}],"init":[{"__symbolic":"method"}],"addVideoAddressToolTip":[{"__symbolic":"method"}],"setAndroidVideo":[{"__symbolic":"method"}]}}}}]
|