视频接口

视频详情

接口:

  1. /api/v1/video/{id}

请求方法:GET

请求参数:

返回参数:

  1. {
  2. "data": {
  3. "id": 1,
  4. "title": "Crystel Collier",
  5. "slug": "quia-voluptatibus-eaque-debitis-placeat-iusto-libero-nulla-quibusdam",
  6. "view_num": 4,
  7. "charge": 179,
  8. "short_description": "<p>Prof.</p>",
  9. "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>",
  10. "published_at": 389614221
  11. }
  12. }

参数说明:

字段 说明
data[].id 视频ID
data[].title 视频名
data[].slug 视频标识符
data[].view_num 视频播放次数
data[].charge 视频收费
data[].short_description 视频简单介绍
data[].description 视频详细介绍
data[].published_at 视频上线时间

视频播放地址

接口:

  1. /api/v1/video/{id}/play_url

请求方法:GET

请求参数:

返回参数:

  1. [
  2. {
  3. "format": "m3u8",
  4. "url": "https://out-28ede7b0519f11e8a49700163e1c7.oss-cn-shanghai.aliyuncs.com/a7263cdb4bf74c8788dd1cee51ccfeb2/e199047b2caf4b7bbd78c148c5841481-75eeb683ab5b3a775309b9a34866fb64-fd.m3u8?Expires=1539074336&OSSAccessKeyId=LTAInFumgYEtNMvC&Signature=yhRephewfFOnoZFrfmYgTvMiFTc%3D",
  5. "duration": "269.3665"
  6. },
  7. {
  8. "format": "m3u8",
  9. "url": "https://out-28ede7b0519f11e8a49700163e1c7.oss-cn-shanghai.aliyuncs.com/a7263cdb4bf74c8788dd1cee51ccfeb2/e199047b2caf4b7bbd78c148c5841481-ebd83bcf80577f8aac188460265ca8d7-ld.m3u8?Expires=1539074336&OSSAccessKeyId=LTAInFumgYEtNMvC&Signature=io7g7fV6B2SI9zkvV%2BT5c2NmMOg%3D",
  10. "duration": "269.3665"
  11. }
  12. ]

参数说明:

字段 说明
format 视频格式
url 播放地址
duration 时长

视频评论列表

接口:

  1. /api/v1/video/{id}/comments

请求方法:GET

请求参数:

字段 默认值 说明
page_size 10 每页显示条数
page 1 页码

返回参数:

  1. {
  2. "data": [
  3. {
  4. "user": {
  5. "avatar": "/images/default_avatar.jpg",
  6. "nick_name": "小滕",
  7. "mobile": "13675626825",
  8. "role": {
  9. "role": "年度会员",
  10. "expired_at": 1550196621
  11. },
  12. "unread_notification_num": 0
  13. },
  14. "content": "<p>hahahahhahahah</p>",
  15. "created_at": 1539569678
  16. },
  17. {
  18. "user": {
  19. "avatar": "/images/default_avatar.jpg",
  20. "nick_name": "小滕",
  21. "mobile": "13675626825",
  22. "role": {
  23. "role": "年度会员",
  24. "expired_at": 1550196621
  25. },
  26. "unread_notification_num": 0
  27. },
  28. "content": "<p>123123</p>",
  29. "created_at": 1539569666
  30. }
  31. ],
  32. "links": {
  33. "first": "http://127.0.0.1:8000/api/v1/video/1/comments?page=1",
  34. "last": "http://127.0.0.1:8000/api/v1/video/1/comments?page=1",
  35. "prev": null,
  36. "next": null
  37. },
  38. "meta": {
  39. "current_page": 1,
  40. "from": 1,
  41. "last_page": 1,
  42. "path": "http://127.0.0.1:8000/api/v1/video/1/comments",
  43. "per_page": 10,
  44. "to": 2,
  45. "total": 2
  46. }
  47. }

字段见名知意,这里不做解释了 :smile: ,对我就是懒了 :joy:

视频评论提交

接口:

  1. /api/v1/video/{id}/comment

请求方法:POST

请求参数:

字段 默认值 说明
content 评论内容

返回参数:

  1. {
  2. "data": {
  3. "user": {
  4. "avatar": "/images/default_avatar.jpg",
  5. "nick_name": "小滕",
  6. "mobile": "13675626825",
  7. "role": {
  8. "role": "年度会员",
  9. "expired_at": 1550196621
  10. },
  11. "unread_notification_num": 0
  12. },
  13. "content": "<p>123123 &#x1f604;</p>",
  14. "created_at": 1539569747
  15. }
  16. }

评论成功返回评论相关内容。