Skip to content

Commit b2b4cdd

Browse files
committed
added play inline to html5 video element
1 parent 087154a commit b2b4cdd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/clips/video/video.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ export class VideoClip extends VisualMixin(MediaClip<VideoClipProps>) {
4747
public constructor(source?: File | VideoSource, props: VideoClipProps = {}) {
4848
super();
4949

50-
(this.textrues.html5.source as any).playsInline = true;
50+
this.element.controls = false;
51+
this.element.playsInline = true;
52+
this.element.style.display = 'hidden';
53+
5154
(this.textrues.html5.source as any).autoPlay = false;
5255
(this.textrues.html5.source as any).loop = false;
5356
this.sprite.texture = this.textrues.html5;
@@ -96,11 +99,11 @@ export class VideoClip extends VisualMixin(MediaClip<VideoClipProps>) {
9699
}
97100

98101
public async connect(track: Track<VideoClip>): Promise<void> {
102+
super.connect(track);
103+
99104
// without seeking the first frame a black frame will be rendered
100105
const frame = track.composition?.frame ?? 0;
101106
await this.seek(Timestamp.fromFrames(frame));
102-
103-
super.connect(track);
104107
}
105108

106109
@visualize

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"useDefineForClassFields": true,
1212
"module": "ESNext",
1313
"skipLibCheck": true,
14+
"allowJs": true,
1415
"types": [
1516
"@webgpu/types",
1617
"@types/wicg-file-system-access",

0 commit comments

Comments
 (0)