• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# XComponent
2
3**XComponent** provides a surface for graphics rendering and media data input into your view. You can customize the position and size of the surface as needed.
4
5> **NOTE**
6>
7> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
8>
9> This topic describes only system APIs provided by the module. For details about its public APIs, see [XComponent](ts-basic-components-xcomponent.md).
10
11## Attributes
12
13### hdrBrightness<sup>14+</sup>
14
15hdrBrightness(brightness: number)
16
17Sets the brightness of HDR video playback for the component.
18
19**System API**: This attribute can be used in system APIs since API version 14.
20
21**System capability**: SystemCapability.ArkUI.ArkUI.Full
22
23**Parameters**
24
25| Name  | Type   | Mandatory| Description                  |
26| -------- | ------- | ---- | ---------------------- |
27| brightness | number | Yes  | Brightness of HDR video playback.<br>Value range: 0.0 to 1.0.<br>Values less than 0 are equivalent to 0, and values greater than 1 are equivalent to 1.<br>**0** indicates the brightness of the SDR video, and **1** indicates the brightness of the HDR video.|
28
29  > **NOTE**
30  >
31  > This attribute is effective only when **type** is set to **SURFACE**.
32  >
33  > It is not supported for **XComponent** components created using the [ArkUI NDK API](../../../ui/ndk-build-ui-overview.md).
34
35### enableTransparentLayer<sup>18+</sup>
36
37enableTransparentLayer(enabled: boolean)
38
39Sets whether to enable an independent layer for the **XComponent** component when its background is transparent.
40
41**System API**: This attribute can be used in system APIs since API version 18.
42
43**System capability**: SystemCapability.ArkUI.ArkUI.Full
44
45**Parameters**
46
47| Name  | Type    | Mandatory| Description                  |
48| ------- | ------- | ---- | ---------------------- |
49| enabled | boolean | Yes  | Whether to enable an independent layer for the **XComponent** component when its background is transparent.|
50
51  > **NOTE**
52  >
53  > This attribute is effective only when **type** is set to **SURFACE**.
54  >
55  > It is not supported for **XComponent** components created using the [ArkUI NDK API](../../../ui/ndk-build-ui-overview.md).
56