

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 為 Amazon Chime SDK 建立VideoFxConfig物件
<a name="create-videofxconfig"></a>

您可以在同一個物件`backgroundReplacement`中定義 `backgroundBlur`和 的組態。不過，您無法同時`true`針對兩個篩選條件`isEnabled`將 設定為 。這是無效的組態。

`VideoFxConfig` 類別不會自行驗證。驗證會在下一個步驟中進行。

下列範例顯示有效的 `VideoFxConfig`。

```
const videoFxConfig: VideoFxConfig = {
    backgroundBlur: {
        isEnabled: false,
        strength: 'medium'
    },
    backgroundReplacement: {
        isEnabled: false,
        backgroundImageURL: 'space.jpg',
        defaultColor: undefined,
    }
}
```

下表列出您可以在 `VideoFxConfig` 物件中指定的`VideoFxProcessor`屬性。

**背景模糊篩選條件屬性**


| 屬性 | Type | 說明 | 
| --- | --- | --- | 
| `isEnabled` | `boolean` |  當 時`true`，篩選條件會模糊背景。 | 
| `strength` | `string` | 決定模糊的程度。有效值：`low` \$1`medium` \$1 `high`。 | 

**背景取代篩選條件屬性**


| 屬性 | Type | 說明 | 
| --- | --- | --- | 
| `isEnabled` | `boolean` |  當 時`true`，篩選條件會取代背景\$1。 | 
| `backgroundImageURL` | `string` | 背景映像的 URL。篩選條件會將影像動態調整為目前畫面的維度。您可以使用字串，例如 `https://...`或資料 URL，例如 `data:image/jpeg;base64`。 | 
| `defaultColor` | `string` | 十六進位顏色字串，例如 `000000`或 `FFFFFF`，或字串，例如 `black`或 `white`。如果您未指定映像 URL，處理器會使用 `defaultColor`做為背景。如果您未指定 `defaultColor`，處理器預設為黑色。 | 