时间:2019-05-07 来源:小程序工厂
这是支持的格式
但是我们在腾讯云上已经转为MP4了啊
提供下代码片段以及视频链接试试?
开发者回复:
//生成当前时间的十六进制数String t = getT();//生成随机请求标识String us = generateUS();//获取签名String sign = getSign(video.getVideoUrl(), t, us);//获取原始URL的防盗链URLvideo.setVideoUrl(video.getVideoUrl()+"?t="+t+"&us="+us+"&sign="+sign);private static String getT(){ Long time = System.currentTimeMillis() / 1000 + 5 * 3600; String fiveHoursLaterHexTime = Long.toHexString(time); return fiveHoursLaterHexTime;}private static String generateUS() { return RandomStringUtils.randomAlphanumeric(RandomUtils.nextInt(5, 20));}private static String getSign(String url,String time, String us){ StringBuffer sb = new StringBuffer(); sb.append(TENCENT_CLOUD_KEY); sb.append("/"); for(int i = 0; i < 3; i++){ url = url.substring(url.indexOf("/")+1 ); } url = url.substring(0,url.lastIndexOf("/")+1); sb.append(url); sb.append(time); sb.append(us); String encodeStr= DigestUtils.md5Hex(sb.toString()); return encodeStr;}生成的防盗链URL例:
mp4格式生成的防盗链URL:
http://1255877643.vod2.myqcloud.com/d1876a4fvodgzp1255877643/183922d05285890780845345712/vIenSs1J6hQA.mp4?t=5bdfe73f&us=fcveFN6LlnJh&sign=9bd1edabadccd2055f2c0514e35ddb79
mpg格式生成的防盗链URL:http://1255877643.vod2.myqcloud.com/d1876a4fvodgzp1255877643/98a8c1f95285890782762132979/lqlcF8PqOGwA.mpg?t=5bdfe828&us=vCWFUAljy6fkv0jQS&sign=6dffe0bc400cea4d62f74d96afe0eac4
https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html,按照教程提供前端的代码片段
不好意思,今天前端人员休假了,使用的video组建,src中传入的值便是上面的防盗链URL