@next2d/media 1.14.20

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.
@@ -0,0 +1,80 @@
1
+ /**
2
+ * SoundTransform クラスにはボリュームとループのプロパティが含まれます。
3
+ *
4
+ * The SoundTransform class contains properties for volume and loop.
5
+ *
6
+ * @class
7
+ * @memberOf next2d.media
8
+ */
9
+ export declare class SoundTransform {
10
+ private _$volume;
11
+ private _$loop;
12
+ /**
13
+ * @param {number} [volume=1]
14
+ * @param {boolean} [loop=false]
15
+ *
16
+ * @constructor
17
+ * @public
18
+ */
19
+ constructor(volume?: number, loop?: boolean);
20
+ /**
21
+ * @description 指定されたクラスのストリングを返します。
22
+ * Returns the string representation of the specified class.
23
+ *
24
+ * @return {string}
25
+ * @default [class SoundTransform]
26
+ * @method
27
+ * @static
28
+ */
29
+ static toString(): string;
30
+ /**
31
+ * @description 指定されたクラスの空間名を返します。
32
+ * Returns the space name of the specified class.
33
+ *
34
+ * @return {string}
35
+ * @default next2d.media.SoundTransform
36
+ * @const
37
+ * @static
38
+ */
39
+ static get namespace(): string;
40
+ /**
41
+ * @description 指定されたオブジェクトのストリングを返します。
42
+ * Returns the string representation of the specified object.
43
+ *
44
+ * @return {string}
45
+ * @default [object SoundTransform]
46
+ * @method
47
+ * @public
48
+ */
49
+ toString(): string;
50
+ /**
51
+ * @description 指定されたオブジェクトの空間名を返します。
52
+ * Returns the space name of the specified object.
53
+ *
54
+ * @return {string}
55
+ * @default next2d.media.SoundTransform
56
+ * @const
57
+ * @public
58
+ */
59
+ get namespace(): string;
60
+ /**
61
+ * @description ループ設定です。
62
+ * loop setting.
63
+ *
64
+ * @member {boolean}
65
+ * @default false
66
+ * @public
67
+ */
68
+ get loop(): boolean;
69
+ set loop(loop: boolean);
70
+ /**
71
+ * @description ボリュームです。範囲は 0(無音)~ 1(フルボリューム)です。
72
+ * The volume, ranging from 0 (silent) to 1 (full volume).
73
+ *
74
+ * @member {number}
75
+ * @default 1
76
+ * @public
77
+ */
78
+ get volume(): number;
79
+ set volume(volume: number);
80
+ }
@@ -0,0 +1,111 @@
1
+ import { $clamp } from "@next2d/share";
2
+ /**
3
+ * SoundTransform クラスにはボリュームとループのプロパティが含まれます。
4
+ *
5
+ * The SoundTransform class contains properties for volume and loop.
6
+ *
7
+ * @class
8
+ * @memberOf next2d.media
9
+ */
10
+ export class SoundTransform {
11
+ /**
12
+ * @param {number} [volume=1]
13
+ * @param {boolean} [loop=false]
14
+ *
15
+ * @constructor
16
+ * @public
17
+ */
18
+ constructor(volume = 1, loop = false) {
19
+ /**
20
+ * @type {number}
21
+ * @default 1
22
+ * @private
23
+ */
24
+ this._$volume = 1;
25
+ /**
26
+ * @type {boolean}
27
+ * @default false
28
+ * @private
29
+ */
30
+ this._$loop = false;
31
+ // setup
32
+ this.volume = volume;
33
+ this.loop = loop;
34
+ }
35
+ /**
36
+ * @description 指定されたクラスのストリングを返します。
37
+ * Returns the string representation of the specified class.
38
+ *
39
+ * @return {string}
40
+ * @default [class SoundTransform]
41
+ * @method
42
+ * @static
43
+ */
44
+ static toString() {
45
+ return "[class SoundTransform]";
46
+ }
47
+ /**
48
+ * @description 指定されたクラスの空間名を返します。
49
+ * Returns the space name of the specified class.
50
+ *
51
+ * @return {string}
52
+ * @default next2d.media.SoundTransform
53
+ * @const
54
+ * @static
55
+ */
56
+ static get namespace() {
57
+ return "next2d.media.SoundTransform";
58
+ }
59
+ /**
60
+ * @description 指定されたオブジェクトのストリングを返します。
61
+ * Returns the string representation of the specified object.
62
+ *
63
+ * @return {string}
64
+ * @default [object SoundTransform]
65
+ * @method
66
+ * @public
67
+ */
68
+ toString() {
69
+ return "[object SoundTransform]";
70
+ }
71
+ /**
72
+ * @description 指定されたオブジェクトの空間名を返します。
73
+ * Returns the space name of the specified object.
74
+ *
75
+ * @return {string}
76
+ * @default next2d.media.SoundTransform
77
+ * @const
78
+ * @public
79
+ */
80
+ get namespace() {
81
+ return "next2d.media.SoundTransform";
82
+ }
83
+ /**
84
+ * @description ループ設定です。
85
+ * loop setting.
86
+ *
87
+ * @member {boolean}
88
+ * @default false
89
+ * @public
90
+ */
91
+ get loop() {
92
+ return this._$loop;
93
+ }
94
+ set loop(loop) {
95
+ this._$loop = loop;
96
+ }
97
+ /**
98
+ * @description ボリュームです。範囲は 0(無音)~ 1(フルボリューム)です。
99
+ * The volume, ranging from 0 (silent) to 1 (full volume).
100
+ *
101
+ * @member {number}
102
+ * @default 1
103
+ * @public
104
+ */
105
+ get volume() {
106
+ return this._$volume;
107
+ }
108
+ set volume(volume) {
109
+ this._$volume = $clamp(+volume, 0, 1, 0);
110
+ }
111
+ }
@@ -0,0 +1,326 @@
1
+ import { DisplayObject } from "@next2d/display";
2
+ import { BoundsImpl, VideoCharacterImpl, DictionaryTagImpl, ParentImpl, PlayerHitObjectImpl, Character } from "@next2d/interface";
3
+ import { CanvasToWebGLContext } from "@next2d/webgl";
4
+ /**
5
+ * サーバーまたはローカルに保存された録画済みビデオファイルを再生する Video オブジェクトです。
6
+ * ビデオストリームを再生するには、attachNetStream() を使用して、ビデオを Video オブジェクトに関連付けます。
7
+ * 次に、addChild() を使用して、Video オブジェクトを表示リストに追加します。
8
+ *
9
+ * A Video object that plays a recorded video file stored on a server or locally.
10
+ * To play a video stream, use attachNetStream() to attach the video to the Video object.
11
+ * Then, add the Video object to the display list using addChild().
12
+ *
13
+ * @class
14
+ * @memberOf next2d.media
15
+ * @extends DisplayObject
16
+ */
17
+ export declare class Video extends DisplayObject {
18
+ private _$smoothing;
19
+ private _$loop;
20
+ private _$autoPlay;
21
+ private readonly _$bounds;
22
+ private _$bytesLoaded;
23
+ private _$bytesTotal;
24
+ private _$timerId;
25
+ _$video: HTMLVideoElement | null;
26
+ private _$stop;
27
+ private _$volume;
28
+ private _$ready;
29
+ private _$context;
30
+ /**
31
+ * @param {number} [width = 0]
32
+ * @param {number} [height = 0]
33
+ *
34
+ * @constructor
35
+ * @public
36
+ */
37
+ constructor(width?: number, height?: number);
38
+ /**
39
+ * @description 指定されたクラスのストリングを返します。
40
+ * Returns the string representation of the specified class.
41
+ *
42
+ * @return {string}
43
+ * @default [class Video]
44
+ * @method
45
+ * @static
46
+ */
47
+ static toString(): string;
48
+ /**
49
+ * @description 指定されたクラスの空間名を返します。
50
+ * Returns the space name of the specified class.
51
+ *
52
+ * @return {string}
53
+ * @default next2d.media.Video
54
+ * @const
55
+ * @static
56
+ */
57
+ static get namespace(): string;
58
+ /**
59
+ * @description 指定されたオブジェクトのストリングを返します。
60
+ * Returns the string representation of the specified object.
61
+ *
62
+ * @return {string}
63
+ * @default [object Video]
64
+ * @method
65
+ * @public
66
+ */
67
+ toString(): string;
68
+ /**
69
+ * @description 指定されたオブジェクトの空間名を返します。
70
+ * Returns the space name of the specified object.
71
+ *
72
+ * @return {string}
73
+ * @default next2d.media.Video
74
+ * @const
75
+ * @public
76
+ */
77
+ get namespace(): string;
78
+ /**
79
+ * @description 既にアプリケーションにロードされているデータのバイト数です。
80
+ * The number of bytes of data that have been loaded into the application.
81
+ *
82
+ * @member {number}
83
+ * @default 0
84
+ * @readonly
85
+ * @public
86
+ */
87
+ get bytesLoaded(): number;
88
+ /**
89
+ * @description アプリケーションにロードされるファイルの総バイト数。
90
+ * The total size in bytes of the file being loaded into the application.
91
+ *
92
+ * @member {number}
93
+ * @default 0
94
+ * @readonly
95
+ * @public
96
+ */
97
+ get bytesTotal(): number;
98
+ /**
99
+ * @description 現在のキーフレーム
100
+ * Current keyframe
101
+ *
102
+ *
103
+ * @member {number}
104
+ * @readonly
105
+ * @public
106
+ */
107
+ get currentTime(): number;
108
+ /**
109
+ * @description キーフレーム総数
110
+ * Total number of keyframes
111
+ *
112
+ * @member {number}
113
+ * @readonly
114
+ * @public
115
+ */
116
+ get duration(): number;
117
+ /**
118
+ * @description ビデオをループ生成するかどうかを指定します。
119
+ * Specifies whether to generate a video loop.
120
+ *
121
+ * @member {boolean}
122
+ * @default false
123
+ * @public
124
+ */
125
+ get loop(): boolean;
126
+ set loop(loop: boolean);
127
+ /**
128
+ * @description ビデオの自動再生の設定。
129
+ * Setting up automatic video playback.
130
+ *
131
+ * @member {boolean}
132
+ * @default true
133
+ * @public
134
+ */
135
+ get autoPlay(): boolean;
136
+ set autoPlay(auto_play: boolean);
137
+ /**
138
+ * @description ビデオを拡大 / 縮小する際にスムージング(補間)するかどうかを指定します。
139
+ * Specifies whether the video should be smoothed (interpolated)
140
+ * when it is scaled.
141
+ *
142
+ * @member {boolean}
143
+ * @default true
144
+ * @public
145
+ */
146
+ get smoothing(): boolean;
147
+ set smoothing(smoothing: boolean);
148
+ /**
149
+ * @description 映像コンテンツへの URL を指定します。
150
+ * Specifies the URL to the video content.
151
+ *
152
+ * @member {string}
153
+ * @default ""
154
+ * @public
155
+ */
156
+ get src(): string;
157
+ set src(src: string);
158
+ /**
159
+ * @description ビデオストリームの高さをピクセル単位で指定する整数です。
160
+ * An integer specifying the height of the video stream, in pixels.
161
+ *
162
+ * @member {number}
163
+ * @default 320
164
+ * @readonly
165
+ * @public
166
+ */
167
+ get videoHeight(): number;
168
+ /**
169
+ * @description ビデオストリームの幅をピクセル単位で指定する整数です。
170
+ * An integer specifying the width of the video stream, in pixels.
171
+ *
172
+ * @member {number}
173
+ * @default 240
174
+ * @readonly
175
+ * @public
176
+ */
177
+ get videoWidth(): number;
178
+ /**
179
+ * @description ボリュームです。範囲は 0(無音)~ 1(フルボリューム)です。
180
+ * The volume, ranging from 0 (silent) to 1 (full volume).
181
+ *
182
+ * @member {number}
183
+ * @default 1
184
+ * @public
185
+ */
186
+ get volume(): number;
187
+ set volume(volume: number);
188
+ /**
189
+ * @description Video オブジェクトに現在表示されているイメージ(ビデオストリームではない)をクリアします。
190
+ * Clears the image currently displayed
191
+ * in the Video object (not the video stream).
192
+ *
193
+ * @return {void}
194
+ * @method
195
+ * @public
196
+ */
197
+ clear(): void;
198
+ /**
199
+ * @description ビデオストリームの再生を一時停止します。
200
+ * Pauses playback of a video stream.
201
+ *
202
+ * @return {void}
203
+ * @method
204
+ * @public
205
+ */
206
+ pause(): void;
207
+ /**
208
+ * @description ローカルディレクトリまたは Web サーバーからメディアファイルを再生します。
209
+ * Plays a media file from a local directory or a web server;
210
+ *
211
+ * @returns {void}
212
+ * @method
213
+ * @public
214
+ */
215
+ play(): void;
216
+ /**
217
+ * @description 指定された位置に最も近いキーフレームをシークします。
218
+ * Seeks the keyframe closest to the specified location.
219
+ *
220
+ * @param {number} offset
221
+ * @return {void}
222
+ * @method
223
+ * @public
224
+ */
225
+ seek(offset: number): void;
226
+ /**
227
+ * @return {void}
228
+ * @method
229
+ * @private
230
+ */
231
+ _$update(): void;
232
+ /**
233
+ * @return {void}
234
+ * @method
235
+ * @private
236
+ */
237
+ _$start(): void;
238
+ /**
239
+ * @return {HTMLVideoElement}
240
+ * @method
241
+ * @private
242
+ */
243
+ _$initializeVideo(): HTMLVideoElement;
244
+ /**
245
+ * @return {void}
246
+ * @method
247
+ * @private
248
+ */
249
+ _$createContext(): void;
250
+ /**
251
+ * @param {object} character
252
+ * @return {void}
253
+ * @method
254
+ * @private
255
+ */
256
+ _$buildCharacter(character: Character<VideoCharacterImpl>): void;
257
+ /**
258
+ * @param {object} character
259
+ * @return {void}
260
+ * @method
261
+ * @private
262
+ */
263
+ _$sync(character: VideoCharacterImpl): void;
264
+ /**
265
+ * @param {object} tag
266
+ * @param {DisplayObjectContainer} parent
267
+ * @return {object}
268
+ * @method
269
+ * @private
270
+ */
271
+ _$build(tag: DictionaryTagImpl, parent: ParentImpl<any>): VideoCharacterImpl;
272
+ /**
273
+ * @param {CanvasToWebGLContext} context
274
+ * @param {Float32Array} matrix
275
+ * @returns {void}
276
+ * @method
277
+ * @private
278
+ */
279
+ _$clip(context: CanvasToWebGLContext, matrix: Float32Array): void;
280
+ /**
281
+ * @param {CanvasToWebGLContext} context
282
+ * @param {Float32Array} matrix
283
+ * @param {Float32Array} color_transform
284
+ * @return {void}
285
+ * @method
286
+ * @private
287
+ */
288
+ _$draw(context: CanvasToWebGLContext, matrix: Float32Array, color_transform: Float32Array): void;
289
+ /**
290
+ * @param {CanvasRenderingContext2D} context
291
+ * @param {Float32Array} matrix
292
+ * @param {object} options
293
+ * @return {boolean}
294
+ * @method
295
+ * @private
296
+ */
297
+ _$mouseHit(context: CanvasRenderingContext2D, matrix: Float32Array, options: PlayerHitObjectImpl): boolean;
298
+ /**
299
+ * @param {CanvasRenderingContext2D} context
300
+ * @param {array} matrix
301
+ * @param {object} options
302
+ * @return {boolean}
303
+ * @method
304
+ * @private
305
+ */
306
+ _$hit(context: CanvasRenderingContext2D, matrix: Float32Array, options: PlayerHitObjectImpl): boolean;
307
+ /**
308
+ * @param {Float32Array} [matrix=null]
309
+ * @return {object}
310
+ * @method
311
+ * @private
312
+ */
313
+ _$getBounds(matrix?: Float32Array | null): BoundsImpl;
314
+ /**
315
+ * @return {void}
316
+ * @method
317
+ * @private
318
+ */
319
+ _$createWorkerInstance(): void;
320
+ /**
321
+ * @return {void}
322
+ * @method
323
+ * @private
324
+ */
325
+ _$postProperty(): void;
326
+ }