H5与APP交互说明文档

交互业务逻辑:

  • h5请求播放知识,发起协议请求
  • 协议组件,解析协议,事件事件通知APP
  • APP播放知识

参数说明:

名称 类型 是否必须 描述
type string 知识类别 视频video/文档doc/炫页xuanye/图片photo/文章article
id string 知识ID
pid string 学习计划ID
cid string 课程ID
type int 1-计划学习 2-岗位学习3-自主学习
genscore bool 是否产生学分记录
allowdown bool 是否允许下载
url string 优先使用这个url播放 为空,由api获取播放地址
workshopId string 专题ID
userId string 用户ID
token string 身份

打开视频播放器示例:
方式1:

  1. uri = yxtapp: //biz.player.open?param={
  2. "id":"84fc557e-acbc-44b8-a094-f01b6e89a024",
  3. "pid":"",
  4. "cid":"",
  5. "type":"video",
  6. "genscore":true,
  7. "path":"",
  8. "isNew":1,
  9. "origin":1}
  10. &success=s999&fail=f598, host='biz.player.open',
  11. param='{"id":"84fc557e-acbc-44b8-a094-f01b6e89a024","pid":"","cid":"","type":"video","genscore":true,"path":"","isNew":1,"origin":1}', success='s999', fail='f598', mark='', protocoljson='null'}}

方式2:(下面各种知识打开方式2,参考该格式)

  1. js _callShell: callYunKeTang {
  2. "id":"1389f808-dfd4-4fb6-8cef-62b189d271c4",
  3. "pid":"",
  4. "cid":"",
  5. "type":"video",
  6. "genscore":true,
  7. "workshopId":"xx",
  8. "userId":"0899ee16-870d-43a8-bd6e-6693359f28e1",
  9. "path":"",
  10. "isNew":1,
  11. "origin":1,
  12. "token":"AAAAAOpiNwfU1pT6yCtmGUc9tTdFGhZSPf59KZBOTh0ohJRCKyp8IUOTeC_OVW8TG4PhsVV0CAw9cGaHrRh3nWFI7D27-Z7ug3Egc1l3xqHaR7oLbvHtga4Kvz4vblgtLSY0g_8vaoICcZJPgUodIooJB70"}

打开文档示例:

  1. uri = yxtapp: //biz.player.open?param=
  2. {"id":"7a256522-c97d-42c1-8c90-4c4110ab3987",
  3. "pid":"",
  4. "cid":"",
  5. "type":"doc",
  6. "path":"",
  7. "isNew":1,
  8. "origin":1}
  9. &success=s170&fail=f413, host='biz.player.open',
  10. param='{"id":"7a256522-c97d-42c1-8c90-4c4110ab3987","pid":"","cid":"","type":"doc","path":"","isNew":1,"origin":1}', success='s170', fail='f413', mark='', protocoljson='null'}

打开图片示例:

  1. uri = yxtapp: //biz.player.open?param={
  2. "id":"383f1203-281d-41a1-a888-5a6830b58463",
  3. "pid":"",
  4. "cid":"",
  5. "type":"photo",
  6. "path":"",
  7. "isNew":1,
  8. "origin":1}
  9. &success=s174&fail=f967, host='biz.player.open',
  10. param='{"id":"383f1203-281d-41a1-a888-5a6830b58463","pid":"","cid":"","type":"photo","path":"","isNew":1,"origin":1}', success='s174', fail='f967', mark='', protocoljson='null'}

打开微课示例:

  1. uri = yxtapp: //biz.player.open?param={
  2. "id":"e73fc87d-d28b-44f7-8e79-9284119e428a",
  3. "pid":"",
  4. "cid":"",
  5. "type":"xuanye",
  6. "path":"",
  7. "origin":1}
  8. &success=s763&fail=f18, host='biz.player.open',
  9. param='{"id":"e73fc87d-d28b-44f7-8e79-9284119e428a","pid":"","cid":"","type":"xuanye","path":"","origin":1}', success='s763', fail='f18', mark='', protocoljson='null'}

打开课程包示例:

  1. uri = yxtapp: //biz.player.open?param={
  2. "id":"878d32bb-bad5-4eaa-8dd6-72558f75fb1d",
  3. "pid":"",
  4. "cid":"",
  5. "type":"package",
  6. "path":"",
  7. "upid":"",
  8. "origin":1}
  9. &success=s605&fail=f938, host='biz.player.open',
  10. param='{"id":"878d32bb-bad5-4eaa-8dd6-72558f75fb1d","pid":"","cid":"","type":"package","path":"","upid":"","origin":1}', success='s605', fail='f938', mark='', protocoljson='null'}