腾讯视频云点播  传送门

  项目在腾讯云点播服务之视频的上传(上)【附源码】的基础上添加了两个html页面

  此视频  播放传送门

 

JavaWeb-SpringBoot_(下)腾讯云点播服务之视频的显示-demo

(播放视频GIF会超过10M。。。)

 

package com.Gary.videodemo.controller;

import java.util.Random;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import com.Gary.videodemo.utils.Signature;

@RestController
public class IndexController {
    
    @RequestMapping("/start2")
    public ModelAndView start2() {
        return new ModelAndView("/start2.html");
    }
    
    @RequestMapping("/start")
    public ModelAndView start() {
        return new ModelAndView("/start.html");
    }
    
    @RequestMapping("/plus")
    public ModelAndView plus()
    {
        return new ModelAndView("/video-plus.html");
    }
    
    @RequestMapping("/")
    public ModelAndView index(){
        return new ModelAndView("/video.html");
    }
    
    @RequestMapping("/sign")
    @ResponseBody
    public String getSign()
    {
        //得到Sign
            Signature sign = new Signature();
            //个人API密钥中的Secret Id
            sign.setSecretId("AKIDkNsDQWZOYYVSHu49kDh9Uh1FSoxxxxxx");
            //个人API密钥中的Secret Key
            sign.setSecretKey("XDn1a3NWzN0Tp4vH3zpSp5fEX2xxxxxx");
            sign.setCurrentTime(System.currentTimeMillis() / 1000);
            sign.setRandom(new Random().nextInt(java.lang.Integer.MAX_VALUE));
            sign.setSignValidDuration(3600 * 24 * 2);
            
            String signature = null;    
            try {
                signature = sign.getUploadSignature();
                System.out.println("signature : " + signature);
            } catch (Exception e) {
                System.out.print("获取签名失败");
                e.printStackTrace();
            }
            
            return signature;
    }
    
    
    
}
IndexController.java

相关文章:

  • 2021-12-29
  • 2021-12-04
  • 2021-12-29
  • 2022-01-06
  • 2021-12-10
  • 2021-12-13
猜你喜欢
  • 2021-12-06
  • 2021-11-28
  • 2021-12-04
  • 2021-12-30
  • 2021-09-10
  • 2021-11-23
  • 2021-05-08
  • 2021-12-31
相关资源
相似解决方案