

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

# 輸入切換動作 – 承載
<a name="cli-schedule-fields-for-input-switch"></a>

下列各節顯示輸入切換動作的承載。

在此承載中，`ScheduleActionStartSettings` 僅包含 `FixedModeScheduleActionStartSettings`、`ImmediateModeScheduleActionStartSettings` 或 `FollowModeScheduleActionStartSettings` 其中之一。

請參閱以下範例，以取得每個標籤的範例。

如需下列 JSON 中欄位的意義和值的相關資訊，請參閱 [輸入切換的欄位](schedule-fields-for-ips.md)。

```
{
"ChannelId": "string",
"Creates": {
 "ScheduleActions": [
  {
   "ScheduleActionStartSettings": {
    "FixedModeScheduleActionStartSettings": {
     "Time": "string"
    },
    "FollowModeScheduleActionStartSettings": {
     "FollowPoint": "enum",
     "ReferenceActionName": "string"
    },
    "ImmediateModeScheduleActionStartSettings": {
    }
   },
   "ActionName": "string",
   "ScheduleActionSettings": {
    "InputSwitchSettings": {
     "InputAttachmentNameReference": "string",
     "InputClippingSettings": {
      "InputTimecodeSource": "enum",
      "StartTimecode": {
       "Timecode": "string"
      },
      "StopTimecode": {
       "LastFrameClippingBehavior": "enum",
       "Timecode": "string"
      }
     },
     "UrlPath": ["string", ...]
    }
   }
  ]
 }
}
```

## 切換到具有固定開始時間之即時輸入的範例
<a name="json-switch-example-1"></a>

此請求範例是在固定開始時間切換到即時輸入。切換動作稱為 `studio-feed`，會切換到連接稱為 `live-studio-feed` 之輸入附件的輸入。它會在指定的 UTC 時間切換到此輸入。

```
{
  "ChannelId": "999999",
  "Creates": {
    "ScheduleActions": [
      {
       "ScheduleActionStartSettings": {
          "FixedModeScheduleActionStartSettings": {
            "Time": "2018-05-21T20:42:19.000Z"
           }
          },
      "ActionName": "studio-feed",
      "ScheduleActionSettings": {
        "InputSwitchSettings": {
          "InputAttachmentNameReference": "live-studio-feed" 
     }
    }
   }
  ]
 }
}
```

## 靜態檔案切換的範例如下
<a name="json-switch-example"></a>

此請求的範例是切換到靜態檔案輸入，以跟隨前一個輸入的結尾。切換動作稱為 `action-ad-003`，會切換到連接稱為 `zel-cafe` 之輸入附件的輸入。呼叫的動作 `action-ad-002` 結束時，它會切換到此輸入。此動作的檔案會遭到裁切，使其在 30 秒和 11 個影格後結束：

```
{
  "ChannelId": "999999",
  "Creates": {
      "ScheduleActions": [
          {
            "ScheduleActionStartSettings": {
              "FollowModeScheduleActionStartSettings": {
                "FollowPoint": "END",
                "ReferenceActionName": "action-ad-002"
              }
            },
            "ActionName": "action-ad-003",
              "ScheduleActionSettings": {
                 "InputSwitchSettings": {
                    "InputAttachmentNameReference": "zel-cafe",
                      "InputClippingSettings": {
                          "InputTimecodeSource": "ZEROBASED",
               "StopTimecode":{
                 "Timecode": "00:00:30:11",
                 "LastFrameClippingBehavior": "INCLUDE_LAST_FRAME"
       }
      }
     }
    }
   }
  ]
 }
}
```

## 切換到具有立即開始時間的動態輸入的範例
<a name="json-switch-example2"></a>

此請求的範例是立即切換到動態檔案輸入。切換動作稱為 `action-unscheduled-standby`，會切換到連接稱為 `dynamic-unscheduled-standby` 之輸入附件的輸入。對於動態輸入的這種用法，要使用的檔案為 `oceanwaves.mp4`。

```
{
  "ChannelId": "999999",
  "Creates": {
    "ScheduleActions": [
      {
        "ScheduleActionStartSettings": 
          {
          "ImmediateModeScheduleActionStartSettings": {
          }
         },
       "ActionName": "action-unscheduled-slate",
        "ScheduleActionSettings": {
          "InputSwitchSettings": {
            "InputAttachmentNameReference": "slate",
            "UrlPath":[
              "main/oceanwaves.mp4",
              "redundant/oceanwaves.mp4"]
     }
    }
   }
  ]
 }
}
```