@editframe/create 0.44.0 → 0.45.0
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/dist/index.js +16 -28
- package/dist/index.js.map +1 -1
- package/dist/skills/editframe-brand-video-generator/README.md +155 -0
- package/dist/skills/editframe-brand-video-generator/SKILL.md +207 -0
- package/dist/skills/editframe-brand-video-generator/references/brand-examples.md +178 -0
- package/dist/skills/editframe-brand-video-generator/references/color-psychology.md +227 -0
- package/dist/skills/editframe-brand-video-generator/references/composition-patterns.md +383 -0
- package/dist/skills/editframe-brand-video-generator/references/editing.md +66 -0
- package/dist/skills/editframe-brand-video-generator/references/emotional-arcs.md +496 -0
- package/dist/skills/editframe-brand-video-generator/references/genre-selection.md +135 -0
- package/dist/skills/editframe-brand-video-generator/references/transition-styles.md +611 -0
- package/dist/skills/editframe-brand-video-generator/references/typography-personalities.md +326 -0
- package/dist/skills/editframe-brand-video-generator/references/video-archetypes.md +86 -0
- package/dist/skills/editframe-brand-video-generator/references/video-fundamentals.md +169 -0
- package/dist/skills/editframe-brand-video-generator/references/visual-metaphors.md +50 -0
- package/dist/skills/editframe-composition/SKILL.md +169 -0
- package/dist/skills/editframe-composition/references/audio.md +483 -0
- package/dist/skills/editframe-composition/references/captions.md +844 -0
- package/dist/skills/editframe-composition/references/composition-model.md +73 -0
- package/dist/skills/editframe-composition/references/configuration.md +403 -0
- package/dist/skills/editframe-composition/references/css-parts.md +105 -0
- package/dist/skills/editframe-composition/references/css-variables.md +640 -0
- package/dist/skills/editframe-composition/references/entry-points.md +810 -0
- package/dist/skills/editframe-composition/references/events.md +499 -0
- package/dist/skills/editframe-composition/references/getting-started.md +259 -0
- package/dist/skills/editframe-composition/references/hooks.md +234 -0
- package/dist/skills/editframe-composition/references/image.md +241 -0
- package/dist/skills/editframe-composition/references/r3f.md +580 -0
- package/dist/skills/editframe-composition/references/render-api.md +484 -0
- package/dist/skills/editframe-composition/references/render-strategies.md +119 -0
- package/dist/skills/editframe-composition/references/render-to-video.md +1101 -0
- package/dist/skills/editframe-composition/references/scripting.md +606 -0
- package/dist/skills/editframe-composition/references/sequencing.md +116 -0
- package/dist/skills/editframe-composition/references/server-rendering.md +753 -0
- package/dist/skills/editframe-composition/references/surface.md +329 -0
- package/dist/skills/editframe-composition/references/text.md +627 -0
- package/dist/skills/editframe-composition/references/time-model.md +99 -0
- package/dist/skills/editframe-composition/references/timegroup-modes.md +102 -0
- package/dist/skills/editframe-composition/references/timegroup.md +457 -0
- package/dist/skills/editframe-composition/references/timeline-root.md +398 -0
- package/dist/skills/editframe-composition/references/transcription.md +47 -0
- package/dist/skills/editframe-composition/references/transitions.md +608 -0
- package/dist/skills/editframe-composition/references/use-media-info.md +357 -0
- package/dist/skills/editframe-composition/references/video.md +506 -0
- package/dist/skills/editframe-composition/references/waveform.md +327 -0
- package/dist/skills/editframe-editor-gui/SKILL.md +152 -0
- package/dist/skills/editframe-editor-gui/references/active-root-temporal.md +657 -0
- package/dist/skills/editframe-editor-gui/references/canvas.md +947 -0
- package/dist/skills/editframe-editor-gui/references/controls.md +366 -0
- package/dist/skills/editframe-editor-gui/references/dial.md +756 -0
- package/dist/skills/editframe-editor-gui/references/editor-toolkit.md +587 -0
- package/dist/skills/editframe-editor-gui/references/filmstrip.md +460 -0
- package/dist/skills/editframe-editor-gui/references/fit-scale.md +772 -0
- package/dist/skills/editframe-editor-gui/references/focus-overlay.md +561 -0
- package/dist/skills/editframe-editor-gui/references/hierarchy.md +544 -0
- package/dist/skills/editframe-editor-gui/references/overlay-item.md +634 -0
- package/dist/skills/editframe-editor-gui/references/overlay-layer.md +429 -0
- package/dist/skills/editframe-editor-gui/references/pan-zoom.md +568 -0
- package/dist/skills/editframe-editor-gui/references/pause.md +397 -0
- package/dist/skills/editframe-editor-gui/references/play.md +370 -0
- package/dist/skills/editframe-editor-gui/references/preview.md +391 -0
- package/dist/skills/editframe-editor-gui/references/resizable-box.md +749 -0
- package/dist/skills/editframe-editor-gui/references/scrubber.md +588 -0
- package/dist/skills/editframe-editor-gui/references/thumbnail-strip.md +566 -0
- package/dist/skills/editframe-editor-gui/references/time-display.md +492 -0
- package/dist/skills/editframe-editor-gui/references/timeline-ruler.md +489 -0
- package/dist/skills/editframe-editor-gui/references/timeline.md +604 -0
- package/dist/skills/editframe-editor-gui/references/toggle-loop.md +618 -0
- package/dist/skills/editframe-editor-gui/references/toggle-play.md +526 -0
- package/dist/skills/editframe-editor-gui/references/transform-handles.md +924 -0
- package/dist/skills/editframe-editor-gui/references/trim-handles.md +725 -0
- package/dist/skills/editframe-editor-gui/references/workbench.md +453 -0
- package/dist/skills/editframe-motion-design/SKILL.md +101 -0
- package/dist/skills/editframe-motion-design/references/0-editframe.md +299 -0
- package/dist/skills/editframe-motion-design/references/1-intent.md +201 -0
- package/dist/skills/editframe-motion-design/references/2-physics-model.md +405 -0
- package/dist/skills/editframe-motion-design/references/3-attention.md +350 -0
- package/dist/skills/editframe-motion-design/references/4-process.md +418 -0
- package/dist/skills/editframe-vite-plugin/SKILL.md +75 -0
- package/dist/skills/editframe-vite-plugin/references/file-api.md +111 -0
- package/dist/skills/editframe-vite-plugin/references/getting-started.md +96 -0
- package/dist/skills/editframe-vite-plugin/references/jit-transcoding.md +91 -0
- package/dist/skills/editframe-vite-plugin/references/local-assets.md +75 -0
- package/dist/skills/editframe-vite-plugin/references/visual-testing.md +136 -0
- package/dist/skills/editframe-webhooks/SKILL.md +126 -0
- package/dist/skills/editframe-webhooks/references/events.md +382 -0
- package/dist/skills/editframe-webhooks/references/getting-started.md +232 -0
- package/dist/skills/editframe-webhooks/references/security.md +418 -0
- package/dist/skills/editframe-webhooks/references/testing.md +409 -0
- package/dist/skills/editframe-webhooks/references/troubleshooting.md +457 -0
- package/dist/templates/html/AGENTS.md +13 -0
- package/dist/templates/react/AGENTS.md +13 -0
- package/dist/utils.js +15 -16
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/tsdown.config.ts +4 -0
- package/dist/detectAgent.js +0 -89
- package/dist/detectAgent.js.map +0 -1
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Play Button Element
|
|
3
|
+
description: Play button component that auto-hides when the composition is already playing, for clean minimal editor control bars.
|
|
4
|
+
type: reference
|
|
5
|
+
nav:
|
|
6
|
+
parent: "Playback Controls"
|
|
7
|
+
priority: 11
|
|
8
|
+
api:
|
|
9
|
+
attributes:
|
|
10
|
+
- name: target
|
|
11
|
+
type: string
|
|
12
|
+
description: ID of the element to control (optional if nested in composition)
|
|
13
|
+
react:
|
|
14
|
+
generate: true
|
|
15
|
+
componentName: Play
|
|
16
|
+
importPath: "@editframe/react"
|
|
17
|
+
additionalProps:
|
|
18
|
+
- name: className
|
|
19
|
+
type: string
|
|
20
|
+
description: CSS classes for styling
|
|
21
|
+
- name: children
|
|
22
|
+
type: ReactNode
|
|
23
|
+
description: Content to display as the play button
|
|
24
|
+
nav:
|
|
25
|
+
parent: "Components / Playback Controls"
|
|
26
|
+
priority: 50
|
|
27
|
+
related: ["pause", "toggle-play", "controls"]
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
<!-- html-only -->
|
|
31
|
+
# ef-play
|
|
32
|
+
<!-- /html-only -->
|
|
33
|
+
<!-- react-only -->
|
|
34
|
+
# Play
|
|
35
|
+
<!-- /react-only -->
|
|
36
|
+
|
|
37
|
+
Play button that automatically hides when playback starts.
|
|
38
|
+
|
|
39
|
+
<!-- react-only -->
|
|
40
|
+
## Import
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { Play } from "@editframe/react";
|
|
44
|
+
```
|
|
45
|
+
<!-- /react-only -->
|
|
46
|
+
|
|
47
|
+
## Basic Usage
|
|
48
|
+
|
|
49
|
+
<!-- html-only -->
|
|
50
|
+
```html live
|
|
51
|
+
<ef-timegroup mode="contain" class="w-[720px] h-[480px] bg-black relative">
|
|
52
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
53
|
+
|
|
54
|
+
<ef-play class="absolute inset-0 flex items-center justify-center">
|
|
55
|
+
<button class="w-20 h-20 rounded-full bg-white/90 flex items-center justify-center shadow-lg">
|
|
56
|
+
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">
|
|
57
|
+
<path d="M8 5v14l11-7z"/>
|
|
58
|
+
</svg>
|
|
59
|
+
</button>
|
|
60
|
+
</ef-play>
|
|
61
|
+
</ef-timegroup>
|
|
62
|
+
```
|
|
63
|
+
<!-- /html-only -->
|
|
64
|
+
<!-- react-only -->
|
|
65
|
+
```tsx
|
|
66
|
+
import { Play, Timegroup, Video } from "@editframe/react";
|
|
67
|
+
|
|
68
|
+
<Timegroup mode="contain" className="w-[720px] h-[480px] bg-black relative">
|
|
69
|
+
<Video src="/assets/video.mp4" className="size-full object-contain" />
|
|
70
|
+
|
|
71
|
+
<Play className="absolute inset-0 flex items-center justify-center">
|
|
72
|
+
<button className="w-20 h-20 rounded-full bg-white/90 flex items-center justify-center shadow-lg">
|
|
73
|
+
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">
|
|
74
|
+
<path d="M8 5v14l11-7z"/>
|
|
75
|
+
</svg>
|
|
76
|
+
</button>
|
|
77
|
+
</Play>
|
|
78
|
+
</Timegroup>
|
|
79
|
+
```
|
|
80
|
+
<!-- /react-only -->
|
|
81
|
+
|
|
82
|
+
## Auto-Hide Behavior
|
|
83
|
+
|
|
84
|
+
The play button automatically sets `display: none` when playback starts. It becomes visible again when paused.
|
|
85
|
+
|
|
86
|
+
<!-- react-only -->
|
|
87
|
+
This allows you to create a centered play overlay that disappears during playback without managing state manually.
|
|
88
|
+
<!-- /react-only -->
|
|
89
|
+
|
|
90
|
+
## Custom Slot Content
|
|
91
|
+
|
|
92
|
+
Slot any content as the play button:
|
|
93
|
+
|
|
94
|
+
<!-- html-only -->
|
|
95
|
+
```html live
|
|
96
|
+
<ef-timegroup mode="contain" class="w-[720px] h-[480px] bg-black relative">
|
|
97
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
98
|
+
|
|
99
|
+
<ef-play class="absolute bottom-4 left-4">
|
|
100
|
+
<button class="px-6 py-3 bg-blue-600 text-white rounded-lg font-bold hover:bg-blue-700">
|
|
101
|
+
▶ Start Video
|
|
102
|
+
</button>
|
|
103
|
+
</ef-play>
|
|
104
|
+
</ef-timegroup>
|
|
105
|
+
```
|
|
106
|
+
<!-- /html-only -->
|
|
107
|
+
<!-- react-only -->
|
|
108
|
+
```tsx
|
|
109
|
+
<Play className="absolute bottom-4 left-4">
|
|
110
|
+
<button className="px-6 py-3 bg-blue-600 text-white rounded-lg font-bold hover:bg-blue-700">
|
|
111
|
+
▶ Start Video
|
|
112
|
+
</button>
|
|
113
|
+
</Play>
|
|
114
|
+
```
|
|
115
|
+
<!-- /react-only -->
|
|
116
|
+
|
|
117
|
+
<!-- html-only -->
|
|
118
|
+
## With ef-controls
|
|
119
|
+
|
|
120
|
+
Use with `ef-controls` to control a non-ancestor element:
|
|
121
|
+
|
|
122
|
+
```html
|
|
123
|
+
<ef-timegroup id="my-video" mode="contain" class="w-full h-96">
|
|
124
|
+
<ef-video src="video.mp4" class="size-full"></ef-video>
|
|
125
|
+
</ef-timegroup>
|
|
126
|
+
|
|
127
|
+
<ef-controls target="my-video">
|
|
128
|
+
<ef-play>
|
|
129
|
+
<button class="px-4 py-2 bg-green-600 text-white rounded">Play</button>
|
|
130
|
+
</ef-play>
|
|
131
|
+
</ef-controls>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Target Attribute
|
|
135
|
+
|
|
136
|
+
Directly target an element by ID without `ef-controls`:
|
|
137
|
+
|
|
138
|
+
```html
|
|
139
|
+
<ef-timegroup id="video-1" mode="contain">
|
|
140
|
+
<ef-video src="video.mp4"></ef-video>
|
|
141
|
+
</ef-timegroup>
|
|
142
|
+
|
|
143
|
+
<ef-play target="video-1">
|
|
144
|
+
<button>Play</button>
|
|
145
|
+
</ef-play>
|
|
146
|
+
```
|
|
147
|
+
<!-- /html-only -->
|
|
148
|
+
|
|
149
|
+
## Styled Play Overlay
|
|
150
|
+
|
|
151
|
+
Center a large play button over video:
|
|
152
|
+
|
|
153
|
+
<!-- html-only -->
|
|
154
|
+
```html live
|
|
155
|
+
<ef-timegroup mode="contain" class="w-[720px] h-[480px] bg-black relative">
|
|
156
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
157
|
+
|
|
158
|
+
<ef-play class="absolute inset-0 flex items-center justify-center bg-black/30">
|
|
159
|
+
<button class="w-24 h-24 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center shadow-2xl hover:scale-110 transition">
|
|
160
|
+
<svg width="40" height="40" viewBox="0 0 24 24" fill="white">
|
|
161
|
+
<path d="M8 5v14l11-7z"/>
|
|
162
|
+
</svg>
|
|
163
|
+
</button>
|
|
164
|
+
</ef-play>
|
|
165
|
+
</ef-timegroup>
|
|
166
|
+
```
|
|
167
|
+
<!-- /html-only -->
|
|
168
|
+
<!-- react-only -->
|
|
169
|
+
```tsx
|
|
170
|
+
import { Play, Timegroup, Video } from "@editframe/react";
|
|
171
|
+
|
|
172
|
+
export const VideoWithPlayButton = () => {
|
|
173
|
+
return (
|
|
174
|
+
<Timegroup mode="contain" className="w-[720px] h-[480px] bg-black relative">
|
|
175
|
+
<Video src="/assets/video.mp4" className="size-full object-contain" />
|
|
176
|
+
|
|
177
|
+
<Play className="absolute inset-0 flex items-center justify-center bg-black/30">
|
|
178
|
+
<button className="w-24 h-24 rounded-full bg-gradient-to-br from-blue-500 to-purple-600 flex items-center justify-center shadow-2xl hover:scale-110 transition">
|
|
179
|
+
<svg width="40" height="40" viewBox="0 0 24 24" fill="white">
|
|
180
|
+
<path d="M8 5v14l11-7z"/>
|
|
181
|
+
</svg>
|
|
182
|
+
</button>
|
|
183
|
+
</Play>
|
|
184
|
+
</Timegroup>
|
|
185
|
+
);
|
|
186
|
+
};
|
|
187
|
+
```
|
|
188
|
+
<!-- /react-only -->
|
|
189
|
+
|
|
190
|
+
## With Text Label
|
|
191
|
+
|
|
192
|
+
<!-- html-only -->
|
|
193
|
+
```html live
|
|
194
|
+
<ef-timegroup mode="contain" class="w-[720px] h-[480px] bg-black relative">
|
|
195
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
196
|
+
|
|
197
|
+
<ef-play class="absolute inset-0 flex items-center justify-center">
|
|
198
|
+
<button class="flex flex-col items-center gap-3 text-white hover:scale-105 transition">
|
|
199
|
+
<div class="w-20 h-20 rounded-full bg-white/20 backdrop-blur flex items-center justify-center">
|
|
200
|
+
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">
|
|
201
|
+
<path d="M8 5v14l11-7z"/>
|
|
202
|
+
</svg>
|
|
203
|
+
</div>
|
|
204
|
+
<span class="text-sm font-semibold">Click to play</span>
|
|
205
|
+
</button>
|
|
206
|
+
</ef-play>
|
|
207
|
+
</ef-timegroup>
|
|
208
|
+
```
|
|
209
|
+
<!-- /html-only -->
|
|
210
|
+
<!-- react-only -->
|
|
211
|
+
```tsx
|
|
212
|
+
<Play className="absolute inset-0 flex items-center justify-center">
|
|
213
|
+
<button className="flex flex-col items-center gap-3 text-white hover:scale-105 transition">
|
|
214
|
+
<div className="w-20 h-20 rounded-full bg-white/20 backdrop-blur flex items-center justify-center">
|
|
215
|
+
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">
|
|
216
|
+
<path d="M8 5v14l11-7z"/>
|
|
217
|
+
</svg>
|
|
218
|
+
</div>
|
|
219
|
+
<span className="text-sm font-semibold">Click to play</span>
|
|
220
|
+
</button>
|
|
221
|
+
</Play>
|
|
222
|
+
```
|
|
223
|
+
<!-- /react-only -->
|
|
224
|
+
|
|
225
|
+
## Separate Play and Pause
|
|
226
|
+
|
|
227
|
+
<!-- html-only -->
|
|
228
|
+
Combine `ef-play` and `ef-pause` for independent buttons that show based on state:
|
|
229
|
+
|
|
230
|
+
```html live
|
|
231
|
+
<ef-timegroup mode="contain" class="w-[720px] h-[480px] bg-black relative">
|
|
232
|
+
<ef-video src="https://assets.editframe.com/bars-n-tone.mp4" class="size-full object-contain"></ef-video>
|
|
233
|
+
|
|
234
|
+
<div class="absolute bottom-4 left-4 flex gap-2">
|
|
235
|
+
<ef-play>
|
|
236
|
+
<button class="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">
|
|
237
|
+
▶ Play
|
|
238
|
+
</button>
|
|
239
|
+
</ef-play>
|
|
240
|
+
|
|
241
|
+
<ef-pause>
|
|
242
|
+
<button class="px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700">
|
|
243
|
+
⏸ Pause
|
|
244
|
+
</button>
|
|
245
|
+
</ef-pause>
|
|
246
|
+
</div>
|
|
247
|
+
</ef-timegroup>
|
|
248
|
+
```
|
|
249
|
+
<!-- /html-only -->
|
|
250
|
+
<!-- react-only -->
|
|
251
|
+
Combine `Play` and `Pause` for independent buttons that show based on state:
|
|
252
|
+
|
|
253
|
+
```tsx
|
|
254
|
+
import { Play, Pause, Timegroup, Video } from "@editframe/react";
|
|
255
|
+
|
|
256
|
+
<Timegroup mode="contain" className="w-[720px] h-[480px] bg-black relative">
|
|
257
|
+
<Video src="/assets/video.mp4" className="size-full object-contain" />
|
|
258
|
+
|
|
259
|
+
<div className="absolute bottom-4 left-4 flex gap-2">
|
|
260
|
+
<Play>
|
|
261
|
+
<button className="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">
|
|
262
|
+
▶ Play
|
|
263
|
+
</button>
|
|
264
|
+
</Play>
|
|
265
|
+
|
|
266
|
+
<Pause>
|
|
267
|
+
<button className="px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700">
|
|
268
|
+
⏸ Pause
|
|
269
|
+
</button>
|
|
270
|
+
</Pause>
|
|
271
|
+
</div>
|
|
272
|
+
</Timegroup>
|
|
273
|
+
```
|
|
274
|
+
<!-- /react-only -->
|
|
275
|
+
|
|
276
|
+
<!-- react-only -->
|
|
277
|
+
## Corner Play Button
|
|
278
|
+
|
|
279
|
+
Position play button in a corner:
|
|
280
|
+
|
|
281
|
+
```tsx
|
|
282
|
+
<Play className="absolute bottom-4 right-4">
|
|
283
|
+
<button className="flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-full hover:bg-blue-700 shadow-lg transition">
|
|
284
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
285
|
+
<path d="M8 5v14l11-7z"/>
|
|
286
|
+
</svg>
|
|
287
|
+
<span className="text-sm font-semibold">Play</span>
|
|
288
|
+
</button>
|
|
289
|
+
</Play>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Minimal Play Icon
|
|
293
|
+
|
|
294
|
+
Simple icon-only play button:
|
|
295
|
+
|
|
296
|
+
```tsx
|
|
297
|
+
<Play className="absolute top-4 left-4">
|
|
298
|
+
<button className="w-10 h-10 rounded-full bg-black/50 backdrop-blur flex items-center justify-center text-white hover:bg-black/70">
|
|
299
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
300
|
+
<path d="M8 5v14l11-7z"/>
|
|
301
|
+
</svg>
|
|
302
|
+
</button>
|
|
303
|
+
</Play>
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## With Preview Component
|
|
307
|
+
|
|
308
|
+
Use inside Preview for non-ancestor element control:
|
|
309
|
+
|
|
310
|
+
```tsx
|
|
311
|
+
import { Preview, Play } from "@editframe/react";
|
|
312
|
+
|
|
313
|
+
<div className="flex flex-col gap-2">
|
|
314
|
+
<Preview className="w-full h-[600px]" />
|
|
315
|
+
|
|
316
|
+
<Play>
|
|
317
|
+
<button className="w-full px-4 py-2 bg-green-600 text-white rounded">
|
|
318
|
+
Play Timeline
|
|
319
|
+
</button>
|
|
320
|
+
</Play>
|
|
321
|
+
</div>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
The Preview component provides context that Play automatically consumes.
|
|
325
|
+
|
|
326
|
+
## Custom Play Icon
|
|
327
|
+
|
|
328
|
+
Use any icon library:
|
|
329
|
+
|
|
330
|
+
```tsx
|
|
331
|
+
import { Play } from "@editframe/react";
|
|
332
|
+
import { PlayCircle } from "lucide-react";
|
|
333
|
+
|
|
334
|
+
<Play className="absolute inset-0 flex items-center justify-center">
|
|
335
|
+
<button className="text-white hover:text-blue-400 transition">
|
|
336
|
+
<PlayCircle size={64} strokeWidth={1.5} />
|
|
337
|
+
</button>
|
|
338
|
+
</Play>
|
|
339
|
+
```
|
|
340
|
+
<!-- /react-only -->
|
|
341
|
+
|
|
342
|
+
## Combining Play and Pause
|
|
343
|
+
|
|
344
|
+
<!-- html-only -->
|
|
345
|
+
Use `ef-toggle-play` if you want a single button that switches between play and pause. Use separate `ef-play` and `ef-pause` buttons if you want independent buttons that auto-hide based on state.
|
|
346
|
+
<!-- /html-only -->
|
|
347
|
+
<!-- react-only -->
|
|
348
|
+
- Use `TogglePlay` for a single button that switches icons
|
|
349
|
+
- Use separate `Play` and `Pause` for independent buttons that show/hide based on state
|
|
350
|
+
- Choose based on your UI design - both approaches work equally well
|
|
351
|
+
<!-- /react-only -->
|
|
352
|
+
|
|
353
|
+
<!-- react-only -->
|
|
354
|
+
## Accessibility
|
|
355
|
+
|
|
356
|
+
Ensure the button inside Play has proper labels:
|
|
357
|
+
|
|
358
|
+
```tsx
|
|
359
|
+
<Play className="absolute inset-0 flex items-center justify-center">
|
|
360
|
+
<button
|
|
361
|
+
aria-label="Play video"
|
|
362
|
+
className="w-20 h-20 rounded-full bg-white/90 flex items-center justify-center"
|
|
363
|
+
>
|
|
364
|
+
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
365
|
+
<path d="M8 5v14l11-7z"/>
|
|
366
|
+
</svg>
|
|
367
|
+
</button>
|
|
368
|
+
</Play>
|
|
369
|
+
```
|
|
370
|
+
<!-- /react-only -->
|