Codec for <ReplayByTimeV2>.
Read a <ReplayByTimeV2> element with recorded periods
Read a <ReplayByTimeV2> element with recorded periods
import { assertEquals } from "@std/assert"; import { parse } from "@std/xml"; import { replayByTimeV2 } from "@hertzg/reolink-api/protocol/params"; const root = parse( '<ReplayByTimeV2 version="1.1"><seq>2</seq><durationList>' + "<year>2026</year><month>10</month><day>9</day>" + "<duration><channelId>0</channelId><times><i><s>3600</s><e>7200</e></i>" + "</times></duration></durationList></ReplayByTimeV2>", ).root; assertEquals(replayByTimeV2.decode(root).durationList?.duration, [ { channelId: 0, times: [{ s: 3600, e: 7200 }] }, ]);
XmlParam<"ReplayByTimeV2", ReplayByTimeV2>