简要描述:

播放次数查询及计数接口

涉及到的数据表:

enet_cms_user_info // 用户信息(token来源)

请求URL:

  1. http://localhost:8081/service/api/opencms/tencentCloudProxy/getVideoPlayCount

请求方式:

  • POST
  • 参数

    • curl -POST
      http://localhost:8081/service/api/opencms/tencentCloudProxy/getVideoPlayCount??accessKey=mini_profile__app6546d23ef636e_a449006c-a570-4ec5-9082-179660a795c3&userFlag=5d55e70ee071a533b06770291f388eb0_357
      

      表头:

      Content-Type:application/json
      

      URL参数:

      | 参数名 | 类型 | 说明 | | —- | —- | —- | | accessKey | String | 用户token | | userFlag | String | 用户唯一标识 |
  • 以上参数用作用户Token校验。

    请求参数:

    | 参数名 | 是否必须 | 类型 | 说明 | | —- | —- | —- | —- | | fileId | true | String | 视频文件标识, 例如:5285890799725235746 | | videoSite | false | String | 视频站点,默认为:腾讯视频 | | videoClass | false | String | A/B测试分类, RjOperation=count时必填 | | basicInfo | false | JSONToString | 必须是JSON转字符串,视频基本信息, 当RjOperation=count必填 | | operation | false | String | query-查询播放次数,count-播放计数 |

输入实例:

{
    "fileId": "5285890815242989534",
    "videoSite":"腾讯视频",
    "videoClass":"S2B2C-抖音视频",
    "basicInfo":"/MediaInfoSet/:[{/MetaData/:{/VideoStreamSet/:[{/Width/:1920,/Bitrate/:16203808,/Height/:1080,/Codec/:/hevc/,/Fps/:26}],/Container/:/mov,mp4,m4a,3gp,3g2,mj2/,/VideoDuration/:645.283,/Width/:1920,/Rotate/:0,/AudioDuration/:645.279,/AudioStreamSet/:[{/SamplingRate/:44100,/Codec/:/aac/,/Bitrate/:120861}],/Duration/:645.329,/Height/:1080,/Bitrate/:16324669,/Size/:1317047231},/RjPlayCount/:1,/BasicInfo/:{/StorageRegion/:/ap-chongqing/,/Type/:/mov/,/Vid/:/5285890815242989534/,/MediaUrl/:/http://1301408934.vod2.myqcloud.com/d9f1f7c3vodcq1301408934/244883d65285890815242989534/XVwv7BZoM50A.mov/,/Category/:/Video/,/Description/://,/Name/:/第五节-如何预防网络环路.mov/,/SourceInfo/:{/SourceContext/://,/SourceType/:/Upload/},/CoverUrl/:/http://1301408934.vod2.myqcloud.com/b0dbe56bvodtranscq1301408934/244883d65285890815242989534/coverBySnapshot/coverBySnapshot_10_0.jpg/,/UpdateTime/:/2021-03-10T08:15:20Z/,/ClassId/:788844,/CreateTime/:/2021-03-09T10:14:14Z/,/ClassName/:/小企业办公网建设/,/ClassPath/:/网络工程师认证-初级网络工程师认证-小企业办公网建设/,/TagSet/:[],/ExpireTime/:/9999-12-31T23:59:59Z/},/TranscodeInfo/:{/TranscodeSet/:[{/Md5/://,/Height/:1080,/Url/:/http://1301408934.vod2.myqcloud.com/d9f1f7c3vodcq1301408934/244883d65285890815242989534/XVwv7BZoM50A.mov/,/AudioStreamSet/:[{/Bitrate/:120861,/Codec/:/aac/,/SamplingRate/:44100}],/Size/:1317047231,/Width/:1920,/Definition/:0,/VideoStreamSet/:[{/Bitrate/:16203808,/Fps/:26,/Height/:1080,/Width/:1920,/Codec/:/hevc/}],/Container/:/mov,mp4,m4a,3gp,3g2,mj2/,/Duration/:645.329,/Bitrate/:16324669},{/Width/:640,/Size/:22402857,/VideoStreamSet/:[{/Height/:360,/Bitrate/:207034,/Codec/:/h264/,/Width/:640,/Fps/:25}],/Height/:360,/Md5/:/b9d7849299d322e6470a7991e84c6166/,/Container/:/mov,mp4,m4a,3gp,3g2,mj2/,/AudioStreamSet/:[{/SamplingRate/:44100,/Codec/:/aac/,/Bitrate/:64007}],/Definition/:100010,/Url/:/http://1301408934.vod2.myqcloud.com/b0dbe56bvodtranscq1301408934/244883d65285890815242989534/v.f100010.mp4/,/Duration/:645.28,/Bitrate/:271041},{/Md5/:/3faf894ebffdd29a37944f8f321043b3/,/Bitrate/:1231826,/Container/:/mov,mp4,m4a,3gp,3g2,mj2/,/Definition/:100800,/Url/:/http://1301408934.vod2.myqcloud.com/b0dbe56bvodtranscq1301408934/244883d65285890815242989534/v.f100800.mp4/,/AudioStreamSet/:[{/Bitrate/:64007,/SamplingRate/:44100,/Codec/:/aac/}],/Duration/:645.28,/Size/:99865573,/Height/:1080,/VideoStreamSet/:[{/Height/:1080,/Codec/:/h264/,/Bitrate/:1167819,/Fps/:25,/Width/:1920}],/Width/:1920},{/AudioStreamSet/:[{/SamplingRate/:44100,/Bitrate/:128013,/Codec/:/aac/}],/Bitrate/:997100,/Definition/:100030,/Url/:/http://1301408934.vod2.myqcloud.com/b0dbe56bvodtranscq1301408934/244883d65285890815242989534/v.f100030.mp4/,/VideoStreamSet/:[{/Bitrate/:869087,/Width/:1280,/Codec/:/h264/,/Height/:720,/Fps/:25}],/Duration/:645.28,/Width/:1280,/Size/:80965884,/Container/:/mov,mp4,m4a,3gp,3g2,mj2/,/Md5/:/4f5dd7cae887d8f6e0f9eb0a2639907b/,/Height/:720}]},/FileId/:/5285890815242989534/,/RjPlayPage/://adminywl/config/video/}]",
   "operation":""
}

返回参数:

参数名 是否必须 类型 说明
msg true String 错误信息
appid true String 默认:1301408934
RjPlayCount true String 无用,直接忽略
code true String 错误代码
-0正确
-1001未找到模块对应的栏目信息

返回示例:

{
    "code": 0,
    "appid": "1301408934",
    "msg": "调用成功",
    "RjPlayCount": 0
}

修改代码部分:
image.png**这里代码有改动,如果operation=query,则存入信息,并且数据库这两个字段不可以为空
image.png