【发布时间】:2021-03-31 22:26:06
【问题描述】:
我想从我的视频开始播放的时间获取秒数。
我可以使用 youtube API 获得actualStartTime:
https://www.googleapis.com/youtube/v3/videos?part=liveStreamingDetails&id=WAGNjrjJ_hg&key="api_key"
{
"kind": "youtube#videoListResponse",
"etag": "cNrmxjhTwAaA7H3Gt42xWf1njbU",
"items": [
{
"kind": "youtube#video",
"etag": "PQbK4Z_LITQoQh3vsdycdCNvD-E",
"id": "WAGNjrjJ_hg",
"liveStreamingDetails": {
"actualStartTime": "2020-12-22T05:29:43Z",
"scheduledStartTime": "2020-12-22T05:26:58Z",
"concurrentViewers": "16",
"activeLiveChatId": "Cg0KC1dBR05qcmpKX2hnKicKGFVDX2NyM3RPa2dyLWwwVzlNUm1QUWJHQRILV0FHTmpyakpfaGc"
}
}
],
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
}
}
但格式actualStartTime": "2020-12-22T05:29:43Z"
我要做的是按下按钮并将actualStartTime 格式与当前请求datetime 转换为秒,并将其显示在我的文本框中,这样我就可以通过比较@来查看我的流已经运行了多长时间987654326@ 针对当前请求datetime 并划分时间。
【问题讨论】:
标签: vb.net api datetime youtube type-conversion