Skip to content

Commit 9ddc93d

Browse files
authored
Update api.md
1 parent 114bb73 commit 9ddc93d

File tree

1 file changed

+32
-44
lines changed
  • packages/docs/docs/player

1 file changed

+32
-44
lines changed

packages/docs/docs/player/api.md

+32-44
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ _optional_
114114

115115
A boolean property defining whether you can play or pause a video using space key. If enabled, playing the video and subsequently pressing the space key pauses and resumes the video. Only works if `controls` is true. Default `true`.
116116

117-
### `moveToBeginningWhenEnded`
117+
### `moveToBeginningWhenEnded` <AvailableFrom v="3.1.3" />
118118

119-
_optional, available from v3.1.3_
119+
_optional_
120120

121121
A boolean property defining whether the video position should go back to zero once the video has ended. Only works if `loop` is disabled. Default `true`.
122122

@@ -132,21 +132,21 @@ _optional_
132132

133133
A regular `style` prop for a HTMLDivElement. You can pass a different height and width if you would like different dimensions for the player than the original composition dimensions.
134134

135-
### `className`
135+
### `className` <AvailableFrom v="3.1.3" />
136136

137-
_optional - available since v3.1.3_
137+
_optional_
138138

139139
A HTML class name to be applied to the container.
140140

141-
### `initialFrame`
141+
### `initialFrame` <AvailableFrom v="3.1.14" />
142142

143-
_optional - available since v3.1.14_
143+
_optional_
144144

145145
Start the playback from a specific frame. Default `0`. Once the player is mounted, this property cannot be changed.
146146

147-
### `numberOfSharedAudioTags`
147+
### `numberOfSharedAudioTags` <AvailableFrom v="2.3.1" />
148148

149-
_optional - available since v.2.3.1_
149+
_optional_
150150

151151
If you use an [`<Audio />`](/docs/audio) tag, it might not play in some browsers (specifically iOS Safari) due to browser autoplay policies. This is why the Remotion Player pre-mounts a set of audio tags with silent audio that get played upon user interaction. These audio tags can then be used to play real audio later and will not be subject to the autoplay policy of the browser.
152152

@@ -216,9 +216,9 @@ const MyApp: React.FC = () => {
216216
A player needs to be loaded if it contains elements that use React Suspense, or if the `lazyComponent` prop is being used.
217217
:::
218218

219-
### `renderPoster`
219+
### `renderPoster` <AvailableFrom v="3.2.14" />
220220

221-
_optional, available from v3.2.14_
221+
_optional_
222222

223223
A callback function that allows you to return a custom UI that gets overlayed over the player.
224224

@@ -259,45 +259,45 @@ const MyApp: React.FC = () => {
259259
};
260260
```
261261

262-
### `showPosterWhenUnplayed`
262+
### `showPosterWhenUnplayed` <AvailableFrom v="3.2.14" />
263263

264-
_optional, available from v3.2.14_
264+
_optional_
265265

266266
Render the poster when the video is in its initial state and has not been played yet. Requires [`renderPoster()`](#renderposter) to be set. Default: `false`.
267267

268-
### `showPosterWhenPaused`
268+
### `showPosterWhenPaused` <AvailableFrom v="3.2.14" />
269269

270-
_optional, available from v3.2.14_
270+
_optional_
271271

272272
Render the poster when the video is paused. Although considered a paused state, the poster will not render while the user is scrubbing through the video. Requires [`renderPoster()`](#renderposter) to be set. Default: `false`.
273273

274-
### `showPosterWhenEnded`
274+
### `showPosterWhenEnded` <AvailableFrom v="3.2.14" />
275275

276-
_optional, available from v3.2.14_
276+
_optional_
277277

278278
Render the poster when the video has ended. Requires [`moveToBeginning`](#movetobeginningwhenended) to be set to `false`. [`renderPoster()`](#renderposter) to be set. Default: `false`.
279279

280-
### `inFrame`
280+
### `inFrame` <AvailableFrom v="3.2.15" />
281281

282-
_optional, available from v3.2.15_
282+
_optional_
283283

284284
Limit playback to only play after a certain frame. The video will start from this frame and move to this position once it has ended. Must be an integer, not smaller than `0`, not bigger than [`outFrame`](#outframe) and not bigger than `durationInFrames - 1`. Default `null`, which means the beginning of the video.
285285

286-
### `outFrame`
286+
### `outFrame` <AvailableFrom v="3.2.15" />
287287

288-
_optional, available from v3.2.15_
288+
_optional_
289289

290290
Limit playback to only play before a certain frame. The video will end at this frame and move to the beginning once it has ended. Must be an integer, not smaller than `1`, not smaller than [`inFrame`](#inframe) and not bigger than `durationInFrames - 1`. Default `null`, which means the end of the video.
291291

292-
### `initiallyShowControls`
292+
### `initiallyShowControls` <AvailableFrom v="3.2.24" />
293293

294-
_optional, available from v3.2.24_
294+
_optional_
295295

296296
If true, the controls flash when the player enters the scene. After 2 seconds without hover, the controls fade out. This is similar to how YouTube does it, and signals to the user that the player is in fact controllable. You can also pass a `number`, with which you can customize the duration in milliseconds. Default `true` since `v3.2.24`, before that unsupported.
297297

298-
### `renderPlayPauseButton`
298+
### `renderPlayPauseButton` <AvailableFrom v="3.2.32" />
299299

300-
_optional, available from v3.2.32_
300+
_optional_
301301

302302
Allows you to customize the Play/Pause button of the controls, must be a callback function that returns a valid React element.
303303

@@ -334,9 +334,9 @@ export const App: React.FC = () => {
334334
};
335335
```
336336

337-
### `renderFullscreenButton`
337+
### `renderFullscreenButton` <AvailableFrom v="3.2.32" />
338338

339-
_optional, available from v3.2.32_
339+
_optional_
340340

341341
Allows you to customise the fullscreen button of the player controls, must return a valid React element. If fullscreen is disabled or not available in a browser, it will not be rendered.
342342

@@ -418,9 +418,7 @@ The following methods are available on the player ref:
418418

419419
Pause the video. Nothing happens if the video is already paused.
420420

421-
### `pauseAndReturnToPlayStart()`
422-
423-
_Availabe from v3.0.30_
421+
### `pauseAndReturnToPlayStart()` <AvailableFrom v="3.0.30" />
424422

425423
If the video is playing, pause it and return to the playback position where the video has last been played.
426424

@@ -442,15 +440,11 @@ Gets the current position expressed as the current frame. Divide by the `fps` yo
442440

443441
[Special considerations must be made](https://www.remotion.dev/docs/player/current-time) if you want to display a component that synchronizes with the time of the player.
444442

445-
### `isPlaying()`
446-
447-
_Available from v2.5.7_
443+
### `isPlaying()` <AvailableFrom v="2.5.7" />
448444

449445
Returns a boolean indicating whether the video is playing.
450446

451-
### `getContainerNode()`
452-
453-
_Available from v2.4.2_
447+
### `getContainerNode()` <AvailableFrom v="2.4.2" />
454448

455449
Gets the container `HTMLDivElement` of the player. Useful if you'd like to manually attach listeners to the player element.
456450

@@ -526,9 +520,7 @@ Requests the video to go to fullscreen. This method throws if the `allowFullscre
526520

527521
Exit fullscreen mode.
528522

529-
### `getScale()`
530-
531-
_available since v3.2.24_
523+
### `getScale()` <AvailableFrom v="3.2.24" />
532524

533525
Returns a number which says how much the content is scaled down compared to the natural composition size. For example, if the composition is `1920x1080`, but the player is 960px in width, this method would return `0.5`.
534526

@@ -643,9 +635,7 @@ Prefer the [`seeked`](#seeked) event if you only want to get time updates during
643635

644636
Prefer the [`frameupdate`](#frameupdate) event if you need an update for every single frame.
645637

646-
### `frameupdate`
647-
648-
_Available from v3.2.27_
638+
### `frameupdate` <AvailableFrom v="3.2.27" />
649639

650640
Fires whenever the current time has changed, during both playback and seeking.
651641

@@ -666,9 +656,7 @@ Prefer the [`seeked`](#seeked) event if you only want to get time updates during
666656

667657
Prefer the [`timeupdate`](#timeupdate) event if you only need periodical updates (at most every 250ms).
668658

669-
### `fullscreenchange`
670-
671-
_Available from v3.2.0_
659+
### `fullscreenchange` <AvailableFrom v="3.2.0" />
672660

673661
Fires when the player enters or exits fullscreen. By reading `e.detail.isFullscreen` or calling `playerRef.isFullscreen()` you can determine if the player is currently in fullscreen or not.
674662

0 commit comments

Comments
 (0)