[关闭]
@chengxuyuan 2019-12-16T08:52:29.000000Z 字数 1501 阅读 1147

获取视频

橙旭园儿童编程


获取视频列表

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/course/videos/ 获取视频列表 NO

Request Parameters

Name Description Required Default
category 分类ID NO
course 课程ID NO
page_size 每次返回个数 NO 10

Request

  1. {
  2. "category": 1,
  3. "course": 3,
  4. "page_size": 10
  5. }

cURL Example

  1. curl http://localhost:8000/server/course/videos/?page_size=3&category=3

Response Data

Name Description
title 标题
duration 时长
video 视频地址
banner 封面
pk id

Response

  1. {
  2. "count": 34,
  3. "next": "http://localhost:8001/server/course/videos/?page=2&page_size=3",
  4. "previous": null,
  5. "results": [
  6. {
  7. "pk": 34,
  8. "title": "第一课:EV3入门",
  9. "duration": "5分钟",
  10. "video": "https://static1.bcjiaoyu.com/EV3-1%E6%A4%85%E5%AD%90.mp4",
  11. "banner": "https://resource.bcgame-face2face.haorenao.cn/1.png"
  12. },
  13. {
  14. "pk": 29,
  15. "title": "第一课:电灯和开关",
  16. "duration": "5分钟",
  17. "video": "https://static1.bcjiaoyu.com/snap1.1.mp4",
  18. "banner": "https://resource.bcgame-face2face.haorenao.cn/snap1.png"
  19. },
  20. {
  21. "pk": 25,
  22. "title": "第一节:谁动了我的空格键",
  23. "duration": "5分钟",
  24. "video": "https://static1.bcjiaoyu.com/makey-1.mp4",
  25. "banner": "http://resource.bcgame-face2face.haorenao.cn/%E7%AC%AC%E4%B8%80%E8%AF%BE.jpg"
  26. }
  27. ]
  28. }

获取视频详情

Method and URL Structure

Method Method Resource URL Descriptions Authentications Required
GET /server/course/videos/${pk}/ 获取视频详情 NO

cURL Example

  1. curl http://localhost:8000/server/course/videos/123/

Response Data

Name Description
title 标题
duration 时长
video 视频地址
banner 封面
pk id

Response

  1. {
  2. "pk": 123,
  3. "title": "第一课:EV3入门",
  4. "duration": "5分钟",
  5. "video": "https://static1.bcjiaoyu.com/EV3-1%E6%A4%85%E5%AD%90.mp4",
  6. "banner": "https://resource.bcgame-face2face.haorenao.cn/1.png"
  7. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注