轉場元素

轉場在兩個連續的視頻或圖像元素之間創造平滑的視覺效果。

時間限制

  • 重疊要求:轉場通過重疊一個元素的結尾(preNodeId)與另一個元素的開始(postNodeId)來運作
  • 最大持續時間:轉場持續時間不能超過兩個元素之間可用的重疊時間
  • 定位:轉場的 start 時間應與重疊期間對齊

轉場持續時間限制

轉場的最大持續時間由以下公式確定:

maxDuration = min(
  availableEndTime_of_preNode,
  availableStartTime_of_postNode
)

如果您設置的持續時間超過此值,轉場可能無法正確呈現。

屬性類型必要範例值範圍描述
preNodeIdstringtrue--轉場開始的前一元素的唯一標識符。
postNodeIdstringtrue--轉場結束的後一元素的唯一標識符。
transitionTypestringtrue-directionalwarp, directionalwipe, Bounce, BowTieHorizontal, BowTieVertical, ButterflyWaveScrawler, CircleCrop, ColourDistance, CrazyParametricFun, Directional, DoomScreenTransition, Dreamy, DreamyZoom, GridFlip, InvertedPageCurl, LinearBlur, Mosaic, PolkaDotsCurtain, Radial, SimpleZoom, StereoViewer, Swirl, WaterDrop, ZoomInCircles, angular, burn, cannabisleaf, circle, colorphase, crosshatch, crosswarp, cube, displacement, doorway, fade, fadecolor, fadegrayscale, flyeye, heart, hexagonalize, kaleidoscope, luma, luminance_melt, morph, multiply_blend, pinwheel, pixelize, polar_function, ripple, rotate_scale_fade, squareswire, squeeze, swap, undulatingBurnOut, wind, windowblinds, windowslice, wipeDown, wipeLeft, wipeRight, wipeUp應用的轉場效果類型。名稱區分大小寫。

重要說明:

  • preNodeIdpostNodeId 必須引用 view 陣列中現有的元素
  • 區分大小寫:轉場類型名稱區分大小寫。使用上述列出的確切名稱
  • 命名約定:一些轉場使用 PascalCase(例如,BounceCircleCrop),其他則使用小寫(例如,fadewipeLeft)。使用顯示的確切名稱
  • 持續時間限制:確保轉場持續時間不超過元素之間的重疊時間
  • 轉場元素本身不需要 trackIndex - 它從引用的元素中獲取時間

示例用例:

  • fade 轉場提供經典的交叉溶解效果,適用於兩個視頻
  • wipeLeft 創造從右到左的滑動擦拭效果
  • Bounce 在轉場期間增添了俏皮的彈跳效果
  • 自定義轉場如 directionalwarp 創造扭曲效果

示例:視頻轉場

兩個視頻有 2 秒的轉場重疊:

transitionElement.json
{
"view": [
  {
    "id": "435862f1-2358-464d-b379-26f4b63b12e3",
    "type": "Video",
    "start": 0,
    "duration": 10.218542,
    "trackIndex": 0,
    "externalUrl": "https://example.com/video1.mp4",
    "ext": "mp4"
  },
  {
    "id": "2b82ffe3-7c6e-4d28-9c11-9e3de94c5a49",
    "type": "Video",
    "start": 8.218542,
    "duration": 15,
    "trackIndex": 0,
    "externalUrl": "https://example.com/video2.mp4",
    "ext": "mp4"
  }
],
"transition": [
  {
    "id": "52b20852-e260-41aa-afab-70c22e20f62b",
    "type": "Transition",
    "start": 8.218542,
    "duration": 2,
    "preNodeId": "435862f1-2358-464d-b379-26f4b63b12e3",
    "postNodeId": "2b82ffe3-7c6e-4d28-9c11-9e3de94c5a49",
    "transitionType": "directionalwarp"
  }
]
}