CDN加速

视频转码回调

更新时间:2021-01-27 16:09:14

描述

通过该回调配置知悉视频转码结果。

请求说明

POST请求

请求参数

返回参数

同接口: 获取视频播放代码

通用返回结果详见返回结果
成功时返回的data参数的数据结构

参数名 类型 描述
videoId string 视频ID
encrypt int 视频是否加密
取值范围 :
  • 0(不加密)
  • 1(加密)
  • swfCode string 视频swf代码
    htmlCode string 视频html代码,非加密视频为空
    autoCode string 视频自适应代码,加密视频为空
    tryWatchAutoCode string 试看视频自适应代码,加密视频为空
    customCode string 客户定制的播放代码。默认为空。如有个性化需求,请与客服联系。
    videoUrl array 视频url列表
    tryWatchVideoUrl array 试看视频url列表

    videoUrl和tryWatchVideoUrl数组元素的数据结构

    参数名 类型 描述
    urlType string PC端/移动端
    originUrl string 原画视频url
    fluentUrl string 流畅码率视频url
    sdUrl string 标清码率视频url
    highUrl string 高清码率视频url
    hdPullUrl string 超清码率视频url

    示例

    输入示例

    输出示例

    URL安全的Base64编码返回示例:

    {
        "code": 200,
    "data": {
    "videoId ": 8731c067016b1000d7d05b5600000000,
            "encrypt": 0,
            "htmlCode": "<!DOCTYPE html>\r\n<html >\r\n<body style=\"margin:0px\">\r\n<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\r\n        codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\"\r\n        width=\"800\" height=\"450\"\r\n        id=\"6A313F452ADC20F7_9B0F7BA8BCB9D056D4C24ADDBF821D10_true_11\">\r\n    <param name=\"movie\" value=\"https://cloudv.chinanetcenter.com/swf/player/6A313F452ADC20F7_9B0F7BA8BCB9D056D4C24ADDBF821D10_true_11/StrobeMediaPlayback.swf\"  />\r\n    <param name=\"allowFullScreen\" value=\"true\" />\r\n    <param name=\"allowScriptAccess\" value=\"always\" />\r\n    <param name=\"wmode\" value=\"transparent\" />\r\n\r\n    <embed src=\"https://cloudv.chinanetcenter.com/swf/player/6A313F452ADC20F7_9B0F7BA8BCB9D056D4C24ADDBF821D10_true_11/StrobeMediaPlayback.swf\"\r\n           width=\"800\" height=\"450\" name=\"6A313F452ADC20F7_9B0F7BA8BCB9D056D4C24ADDBF821D10_true_11\" allowFullScreen=\"true\" wmode=\"transparent\" allowScriptAccess=\"always\"\r\n           pluginspage=\"https://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"/>\r\n\r\n</object>\r\n<script type=\"text/javascript\">\r\n  //播放加密视频时,播放器会调用此方法,获取校验参数的值,${check},${t},${k}需要由客户自己生成相应的值\r\n   function jsClientCookieValue(cookieName){\r\n        var cookieArr= {};\r\n        cookieArr[\"check\"] = \"${check}\";\r\n        cookieArr[\"t\"] = \"${t}\";\r\n        cookieArr[\"k\"] = \"${k}\";\r\n        return cookieArr;\r\n\r\n    }\r\n     // range拖拉模式下,播放器视频正片播放结束时会触发此接口\r\n    function wsJsVodCompleted(){\r\n        //dosomething\r\n    }\r\n\r\n    //非加密视频播放结束(假如有后贴广告,后贴广告播放完)会回调此接口\r\n    function vodCompleted(){\r\n    }\r\n\r\n</script>\r\n</body>\r\n</html>",
            “autoCode”:” https://cloudv.chinanetcenter.com/player/auto-play.action?videoId=9B0F7BA8BCB9D056D4C24ADDBF821D10&userId=6A313F452ADC20F7&playerType=11”,
            "swfCode": "https://cloudv.chinanetcenter.com/swf/player/6A313F452ADC20F7_9B0F7BA8BCB9D056D4C24ADDBF821D10_true_11/StrobeMediaPlayback.swf",
            "customCode": "",	
            "videoUrl": [
                {
                    "fluentUrl": "",
                    "hdPullUrl": "",
                    "highUrl": "",
                    "originUrl": "http://live.ovptest.haplat.net/live/201708/4101630234a74ee8864e56ea88e5d290_20170801171220/4101630234a74ee8864e56ea88e5d290_20170801171220_live2vod.mp4",
                    "sdUrl": "",
                    "urlType": "PC端"
                },
                {
                    "fluentUrl": "",
                    "hdPullUrl": "",
                    "highUrl": "",
                    "originUrl": "http://live.ovptest.haplat.net/live/201708/4101630234a74ee8864e56ea88e5d290_20170801171220/4101630234a74ee8864e56ea88e5d290_20170801171220_live2vod.mp4",
                    "sdUrl": "",
                    "urlType": "移动端"
                }
            ]
        },
        "message": "操作成功"
    }
    
    

    错误码

    通用错误码详见 返回结果