All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.antmedia.webresource.StreamWebRoot Maven / Gradle / Ivy

package io.antmedia.webresource;

import org.apache.catalina.WebResource;
import org.apache.catalina.webresources.StandardRoot;

public class StreamWebRoot extends StandardRoot {

	 boolean streamingResource = false;
	
	 @Override
	 public WebResource getResource(String path) {
		 streamingResource = false;
		 if (path.endsWith(".m3u8") || path.endsWith(".ts") || path.endsWith(".mpd") || path.endsWith(".m4s") || (path.endsWith(".png") && path.contains("/previews/"))) {
			 streamingResource = true;
			 return getResourceInternal(path, true);
		 }
		 else {
			 return getResourceDefault(path);
		 }
		 
	 }
	 
	 
	 public WebResource getResourceDefault(String path) {
		 return super.getResource(path);
	 }
	 
	 public boolean isStreamingResource() {
		return streamingResource;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy