CameraEnhancer - UI
Name | Description |
---|---|
convertToPageCoordinates | Converts coordinates from the video’s coordinate system to coordinates relative to the whole page. |
convertToClientCoordinates | Converts coordinates from the video’s coordinate system to coordinates relative to the viewport. |
setCameraView | Sets the CameraView instance to be used with the CameraEnhancer . |
getCameraView | Retrieves the current CameraView instance associated with the CameraEnhancer . |
getVideoEl | Retrieves the HTMLVideoElement used by the CameraEnhancer for displaying the camera feed. |
convertToPageCoordinates
Converts coordinates from the video’s coordinate system to coordinates relative to the whole page.
This is useful for overlaying HTML elements on top of specific points in the video, aligning with the page’s layout.
convertToPageCoordinates(point: Point): Point;
Parameters
point
: a Point
object representing the x and y coordinates within the video’s coordinate system.
Return value
A Point
object representing the converted x and y coordinates relative to the page.
Code Snippet
cameraEnhancer.convertToPageCoordinates({x: 0, y: 0});
See also
convertToClientCoordinates
Converts coordinates from the video’s coordinate system to coordinates relative to the viewport.
This is useful for positioning HTML elements in relation to the video element on the screen, regardless of page scrolling.
convertToClientCoordinates(point: Point): Point;
Parameters
point
: a Point
object representing the x and y coordinates within the video’s coordinate system.
Return value
A Point
object representing the converted x and y coordinates relative to the viewport.
Code Snippet
cameraEnhancer.convertToClientCoordinates({x: 0, y: 0});
See also
setCameraView
Sets the CameraView
instance to be used with the CameraEnhancer
.
This method allows for specifying a custom camera view, which can be used to display the camera feed and interface elements.
setCameraView(cameraView: CameraView): void;
Parameters
cameraView
: a CameraView
instance that will be used to display the camera’s video feed and any associated UI components.
Return value
None.
Code Snippet
let cameraView = await Dynamsoft.DCE.CameraView.createInstance();
cameraEnhancer.setCameraView(cameraView);
See also
getCameraView
Retrieves the current CameraView
instance associated with the CameraEnhancer
.
This method allows for accessing the camera view, which can be useful for manipulating the view or accessing its properties and methods.
getCameraView(): CameraView;
Parameters
None.
Return value
The current CameraView
instance used by the CameraEnhancer
.
Code Snippet
let cameraView = cameraEnhancer.getCameraView();
cameraView.getVisibleRegionOfVideo();
See also
getVideoEl
Retrieves the HTMLVideoElement used by the CameraEnhancer
for displaying the camera feed.
This method provides direct access to the video element, enabling further customization or interaction with the video stream.
getVideoEl(): HTMLVideoElement;
Parameters
None.
Return value
The HTMLVideoElement
that is being used to display the camera’s video feed.
Code Snippet
let videoElement = cameraEnhancer.getVideoEl();