x4js 2.2.9 → 2.2.12
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/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" fill="currentColor"><!--!Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM320 240C302.3 240 288 254.3 288 272C288 285.3 277.3 296 264 296C250.7 296 240 285.3 240 272C240 227.8 275.8 192 320 192C364.2 192 400 227.8 400 272C400 319.2 364 339.2 344 346.5L344 350.3C344 363.6 333.3 374.3 320 374.3C306.7 374.3 296 363.6 296 350.3L296 342.2C296 321.7 310.8 307 326.1 302C332.5 299.9 339.3 296.5 344.3 291.7C348.6 287.5 352 281.7 352 272.1C352 254.4 337.7 240.1 320 240.1zM288 432C288 414.3 302.3 400 320 400C337.7 400 352 414.3 352 432C352 449.7 337.7 464 320 464C302.3 464 288 449.7 288 432z"/></svg>
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Use of this source code is governed by an MIT-style license
|
|
14
14
|
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
+
*
|
|
16
|
+
* 2026-05-26: added resize types
|
|
15
17
|
**/
|
|
16
18
|
|
|
17
19
|
import { BaseProps } from '../input/input';
|
|
@@ -30,7 +32,7 @@ import { class_ns, IFormElement } from '../../core/core_tools';
|
|
|
30
32
|
interface TextAreaProps extends BaseProps {
|
|
31
33
|
label?: string;
|
|
32
34
|
value?: string;
|
|
33
|
-
resize?: boolean;
|
|
35
|
+
resize?: boolean | "none" | "vertical" | "horizontal" | "both";
|
|
34
36
|
readonly?: boolean;
|
|
35
37
|
trim?: boolean;
|
|
36
38
|
}
|
|
@@ -48,8 +50,8 @@ class SimpleTextArea extends Component<TextAreaProps> {
|
|
|
48
50
|
this.setAttribute( "name", props.name );
|
|
49
51
|
this.setAttribute( "value", props.value+'' );
|
|
50
52
|
|
|
51
|
-
if(
|
|
52
|
-
this.
|
|
53
|
+
if( props.resize!==undefined ) {
|
|
54
|
+
this.setStyleValue( "resize", props.resize===false ? "none" : props.resize as string );
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
if( props.readonly ) {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|.2
|
|
7
|
+
*
|
|
8
|
+
* @file video.module.scss
|
|
9
|
+
* @author Etienne Cochard
|
|
10
|
+
*
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Use of this source code is governed by an MIT-style license
|
|
14
|
+
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
.x4video {
|
|
20
|
+
background-color: black;
|
|
21
|
+
position: relative;
|
|
22
|
+
|
|
23
|
+
.vplayer {
|
|
24
|
+
position: absolute;
|
|
25
|
+
left: 0;
|
|
26
|
+
top: 0;
|
|
27
|
+
right: 0;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ___ ___ __
|
|
3
|
+
* \ \/ / / _
|
|
4
|
+
* \ / /_| |_
|
|
5
|
+
* / \____ _|
|
|
6
|
+
* /__/\__\ |_|.2
|
|
7
|
+
*
|
|
8
|
+
* @file video.ts
|
|
9
|
+
* @author Etienne Cochard
|
|
10
|
+
*
|
|
11
|
+
* @copyright (c) 2026 R-libre ingenierie
|
|
12
|
+
*
|
|
13
|
+
* Use of this source code is governed by an MIT-style license
|
|
14
|
+
* that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
|
|
15
|
+
**/
|
|
16
|
+
|
|
17
|
+
import { Box, Component, ComponentProps } from 'x4js';
|
|
18
|
+
|
|
19
|
+
import "./video.module.scss"
|
|
20
|
+
|
|
21
|
+
interface VideoProps extends ComponentProps {
|
|
22
|
+
autoplay?: boolean;
|
|
23
|
+
muted?: boolean;
|
|
24
|
+
playsInline?: boolean;
|
|
25
|
+
stream: MediaStream;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
export class Video extends Box {
|
|
33
|
+
|
|
34
|
+
private _vplayer: HTMLVideoElement;
|
|
35
|
+
|
|
36
|
+
constructor( props: VideoProps ) {
|
|
37
|
+
super( props );
|
|
38
|
+
|
|
39
|
+
const el = new Component( { cls: "vplayer", tag: 'video', } );
|
|
40
|
+
this.setContent( el );
|
|
41
|
+
|
|
42
|
+
this._vplayer = el.dom as HTMLVideoElement;
|
|
43
|
+
|
|
44
|
+
if( props.autoplay !== undefined ) {
|
|
45
|
+
this.autoPlay = props.autoplay;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if( props.muted !== undefined ) {
|
|
49
|
+
this.mute( props.muted );
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if( props.playsInline !== undefined ) {
|
|
53
|
+
this.playsInline = props.playsInline;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
this.stream = props.stream;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
get player( ) {
|
|
60
|
+
return this._vplayer;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get volume( ) {
|
|
64
|
+
return this.player.volume;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
set volume( vol: number ) {
|
|
68
|
+
this.player.volume = vol;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
get autoPlay( ) {
|
|
72
|
+
return this.player.autoplay;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
set autoPlay( set: boolean ) {
|
|
76
|
+
this.player.autoplay = set;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
get playsInline( ) {
|
|
80
|
+
return this.player.playsInline;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
set playsInline( set: boolean ) {
|
|
84
|
+
this.player.playsInline = set;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
set stream( stream: MediaStream ) {
|
|
88
|
+
this.player.srcObject = stream;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get videoWidth( ) {
|
|
92
|
+
return this.player.videoWidth;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get videoHeight( ) {
|
|
96
|
+
return this.player.videoHeight;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
get loop( ) {
|
|
100
|
+
return this.player.loop;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
set loop( set: boolean ) {
|
|
104
|
+
this.player.loop = set;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
get duration( ) {
|
|
108
|
+
return this.player.duration;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
get muted( ) {
|
|
112
|
+
return this.player.muted;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
mute( set: boolean ) {
|
|
116
|
+
this.player.muted = set;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
get paused( ) {
|
|
120
|
+
return this.player.paused;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
pause( ) {
|
|
124
|
+
this.player.pause( );
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
play( ) {
|
|
128
|
+
this.player.play( );
|
|
129
|
+
}
|
|
130
|
+
}
|