如何从控制器导轨中的相机标签获取回调值?
如何在教程服务器回调的控制器导轨中使用以下代码?
data = JSON.parse(request.raw_post)
video_uuid = data["uuid"]
如何从控制器导轨中的相机标签获取回调值?
如何在教程服务器回调的控制器导轨中使用以下代码?
data = JSON.parse(request.raw_post)
video_uuid = data["uuid"]
使用链接https://cameratag.com/docs/setup#callback中给出的所需参数发出 HTTPpost 请求。然后从响应中你需要执行数据线。前任 :
data_map = {
"uuid": "6611a310-72c4-0130-04c5-123139045d73",
"camera_uuid": "63f9c870-72c4-0130-04c5-123139045d73",
"created_at": "2013-03-19T13:11:13Z",
"percent_complete": 0,
"short_code": null,
"metadata": {
},
"state": "published",
"recorded_from": "https://cameratag.com/",
"publish_type": null,
"formats": [
{
"name": "360p",
"width": 480,
"height": 360,
"video_url": "http://cameratag.com/videos/6611a310-72c4-0130-04c5-123139045d73/360p/mp4",
"mp4_url": "http://cameratag.com/videos/6611a310-72c4-0130-04c5-123139045d73/360p/mp4",
"webm_url": "http://cameratag.com/videos/6611a310-72c4-0130-04c5-123139045d73/360p/webm",
"thumbnail_url": "http://cameratag.com/videos/6611a310-72c4-0130-04c5- 123139045d73/360p/thumb",
"small_thumbnail_url": "http://cameratag.com/videos/6611a310-72c4-0130-04c5- 123139045d73/360p/small_thumb",
"state": "COMPLETED",
"completed_at": null
}
]
}
path = -- give the path for the post request.
http = Net::HTTP.new('site-name.com')
resp = http.post(path,data_map)
data = JSON.parse(resp)
video_uuid = data["uuid"]
还有许多其他方法可以发出发布请求。关键是您需要在发布请求的响应上使用 JSON.parse() ,然后获取 uuid。