Package railo.runtime.functions.video

Source Code of railo.runtime.functions.video.IsVideoFile

package railo.runtime.functions.video;


import railo.commons.lang.StringUtil;
import railo.runtime.PageContext;
import railo.runtime.config.ConfigWeb;
import railo.runtime.exp.PageException;
import railo.runtime.op.Caster;
import railo.runtime.video.VideoExecuter;
import railo.runtime.video.VideoInputImpl;
import railo.runtime.video.VideoUtilImpl;

public class IsVideoFile {

  public static boolean call(PageContext pc, String path) throws PageException {
    try {
      ConfigWeb config = pc.getConfig();
      VideoExecuter ve = VideoUtilImpl.createVideoExecuter(config);
      ve.info(config,new VideoInputImpl(Caster.toResource(pc,path, true)));
    }
    catch (Exception e) {
     
      if(StringUtil.contains(e.getMessage(),"missing ffmpeg installation"))
        throw Caster.toPageException(e);
      return false;
    }
    return true;
  }
}
TOP

Related Classes of railo.runtime.functions.video.IsVideoFile

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.