视频接口
视频详情
接口:
/api/v1/video/{id}
请求方法:GET
请求参数:
无
返回参数:
{
"data": {
"id": 1,
"title": "Crystel Collier",
"slug": "quia-voluptatibus-eaque-debitis-placeat-iusto-libero-nulla-quibusdam",
"view_num": 4,
"charge": 179,
"short_description": "<p>Prof.</p>",
"description": "<p>Eum quia ut iusto asperiores enim est et. Voluptas non voluptates nostrum sunt quia. Placeat temporibus fugiat quos delectus. Quia totam alias eum sit aspernatur.</p>",
"published_at": 389614221
}
}
参数说明:
字段 | 说明 |
---|---|
data[].id |
视频ID |
data[].title |
视频名 |
data[].slug |
视频标识符 |
data[].view_num |
视频播放次数 |
data[].charge |
视频收费 |
data[].short_description |
视频简单介绍 |
data[].description |
视频详细介绍 |
data[].published_at |
视频上线时间 |
视频播放地址
接口:
/api/v1/video/{id}/play_url
请求方法:GET
请求参数:
无
返回参数:
[
{
"format": "m3u8",
"url": "https://out-28ede7b0519f11e8a49700163e1c7.oss-cn-shanghai.aliyuncs.com/a7263cdb4bf74c8788dd1cee51ccfeb2/e199047b2caf4b7bbd78c148c5841481-75eeb683ab5b3a775309b9a34866fb64-fd.m3u8?Expires=1539074336&OSSAccessKeyId=LTAInFumgYEtNMvC&Signature=yhRephewfFOnoZFrfmYgTvMiFTc%3D",
"duration": "269.3665"
},
{
"format": "m3u8",
"url": "https://out-28ede7b0519f11e8a49700163e1c7.oss-cn-shanghai.aliyuncs.com/a7263cdb4bf74c8788dd1cee51ccfeb2/e199047b2caf4b7bbd78c148c5841481-ebd83bcf80577f8aac188460265ca8d7-ld.m3u8?Expires=1539074336&OSSAccessKeyId=LTAInFumgYEtNMvC&Signature=io7g7fV6B2SI9zkvV%2BT5c2NmMOg%3D",
"duration": "269.3665"
}
]
参数说明:
字段 | 说明 |
---|---|
format |
视频格式 |
url |
播放地址 |
duration |
时长 |
视频评论列表
接口:
/api/v1/video/{id}/comments
请求方法:GET
请求参数:
字段 | 默认值 | 说明 |
---|---|---|
page_size |
10 | 每页显示条数 |
page |
1 | 页码 |
返回参数:
{
"data": [
{
"user": {
"avatar": "/images/default_avatar.jpg",
"nick_name": "小滕",
"mobile": "13675626825",
"role": {
"role": "年度会员",
"expired_at": 1550196621
},
"unread_notification_num": 0
},
"content": "<p>hahahahhahahah</p>",
"created_at": 1539569678
},
{
"user": {
"avatar": "/images/default_avatar.jpg",
"nick_name": "小滕",
"mobile": "13675626825",
"role": {
"role": "年度会员",
"expired_at": 1550196621
},
"unread_notification_num": 0
},
"content": "<p>123123</p>",
"created_at": 1539569666
}
],
"links": {
"first": "http://127.0.0.1:8000/api/v1/video/1/comments?page=1",
"last": "http://127.0.0.1:8000/api/v1/video/1/comments?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http://127.0.0.1:8000/api/v1/video/1/comments",
"per_page": 10,
"to": 2,
"total": 2
}
}
字段见名知意,这里不做解释了 ,对我就是懒了
视频评论提交
接口:
/api/v1/video/{id}/comment
请求方法:POST
请求参数:
字段 | 默认值 | 说明 |
---|---|---|
content |
评论内容 |
返回参数:
{
"data": {
"user": {
"avatar": "/images/default_avatar.jpg",
"nick_name": "小滕",
"mobile": "13675626825",
"role": {
"role": "年度会员",
"expired_at": 1550196621
},
"unread_notification_num": 0
},
"content": "<p>123123 😄</p>",
"created_at": 1539569747
}
}
评论成功返回评论相关内容。