feature (transcoding): don't transcode video formats well supported by browsers

This commit is contained in:
Mickael Kerjean
2019-12-18 12:29:41 +11:00
parent cb519d7d24
commit 6799e4dc78

View File

@ -78,6 +78,9 @@ func init(){
res.Write([]byte(`
window.overrides["video-map-sources"] = function(sources){
return sources.map(function(source){
if(source.type == "video/mp4") return source;
else if(source.type == "video/webm") return source;
else if(source.type == "application/ogg") return source;
source.src = source.src + "&transcode=hls";
source.type = "application/x-mpegURL";
return source;