视频拉流

This commit is contained in:
tangzh 2025-06-11 15:52:42 +08:00
parent be740def8d
commit 6e440900e8

View File

@ -1,30 +1,30 @@
//package com.gc.easy.flv.controller;
//
//import com.gc.easy.flv.config.FlvConfig;
//import me.zhengjie.annotation.rest.AnonymousGetMapping;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//
//import java.io.UnsupportedEncodingException;
//
///**
// * FLV流转换
// *
// * @author gc.x
// */
//@Controller
//public class FLVPlayController {
// @Autowired
// private FlvConfig flvConfig;
//
// @AnonymousGetMapping(value = "/flv/hls/stream")
// public String getAppHtml1(String url, Model model) throws UnsupportedEncodingException {
// String decodedUrl = java.net.URLDecoder.decode(url, "UTF-8");
// String videoPath="/api/front/flv/get/stream?url="+decodedUrl;
// model.addAttribute("videoPath", videoPath);
// model.addAttribute("wight", flvConfig.getWight());
// model.addAttribute("height", flvConfig.getHeight());
// return "video";
// }
//}
package com.gc.easy.flv.controller;
import com.gc.easy.flv.config.FlvConfig;
import me.zhengjie.annotation.rest.AnonymousGetMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import java.io.UnsupportedEncodingException;
/**
* FLV流转换
*
* @author gc.x
*/
@Controller
public class FLVPlayController {
@Autowired
private FlvConfig flvConfig;
@AnonymousGetMapping(value = "/flv/hls/stream")
public String getAppHtml1(String url, Model model) throws UnsupportedEncodingException {
String decodedUrl = java.net.URLDecoder.decode(url, "UTF-8");
String videoPath="/api/front/flv/get/stream?url="+decodedUrl;
model.addAttribute("videoPath", videoPath);
model.addAttribute("wight", flvConfig.getWight());
model.addAttribute("height", flvConfig.getHeight());
return "video";
}
}