From 5b9994ecf0addff0fa9c0093dc6e69b01f26a170 Mon Sep 17 00:00:00 2001 From: Justin Date: Fri, 28 Aug 2026 10:25:29 +0800 Subject: [PATCH] Update setVideoFit method to use 'fit' parameter and clarify supported values --- programming/javascript/api-reference/cameraview.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/programming/javascript/api-reference/cameraview.md b/programming/javascript/api-reference/cameraview.md index 3c7737c1..72d25b4d 100644 --- a/programming/javascript/api-reference/cameraview.md +++ b/programming/javascript/api-reference/cameraview.md @@ -353,15 +353,15 @@ let videoElement = cameraView.getVideoElement(); ## setVideoFit -Sets the `object-fit` CSS property of the `HTMLVideoElement` used by this `CameraView` instance. The `object-fit` property specifies how the video content should be resized to fit the container in a way that maintains its aspect ratio. +Sets the `object-fit` CSS property of the `HTMLVideoElement` used by this `CameraView` instance. The `fit` property specifies how the video content should be resized to fit the container in a way that maintains its aspect ratio. ```typescript -setVideoFit(objectFit: string): void; +setVideoFit(fit: 'contain' | 'cover' | 'fill'): void; ``` **Parameters** -The value for the `object-fit` property. At present, only "cover" and "contain" are allowed and the default is "contain". Check out more on [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit). +The value for the `fit` property. Currently, 'contain' , 'cover' and 'fill' are supported, and the default is "contain". Check out more on [object-fit](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit). **Return value**