Examples of IStreamableFileService


Examples of org.red5.server.api.service.IStreamableFileService

    double duration = 0;
    IProviderService provider = (IProviderService) ScopeUtils.getScopeService(scope, IProviderService.class, ProviderService.class);
    File file = provider.getVODProviderFile(scope, name);
    if (file != null && file.canRead()) {
      IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class, StreamableFileFactory.class);
      IStreamableFileService service = factory.getService(file);
      if (service != null) {
        ITagReader reader = null;
        try {
          IStreamableFile streamFile = service.getStreamableFile(file);
          reader = streamFile.getReader();
          duration = (double) reader.getDuration() / 1000;
        } catch (IOException e) {
          log.error("Error read stream file {}. {}", file.getAbsolutePath(), e);
        } finally {
View Full Code Here

Examples of org.red5.server.api.service.IStreamableFileService

  /**
   * Initializes file provider. Creates streamable file factory and service, seeks to start position
   */
  private void init() throws IOException {
    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils.getScopeService(scope, IStreamableFileFactory.class, StreamableFileFactory.class);
    IStreamableFileService service = factory.getService(file);
    if (service == null) {
      log.error("No service found for {}", file.getAbsolutePath());
      return;
    }
    IStreamableFile streamFile = service.getStreamableFile(file);
    reader = streamFile.getReader();
    if (start > 0) {
      seek(start);
    }
  }
View Full Code Here

Examples of org.red5.server.api.service.IStreamableFileService

        // Maybe the (previously existing) file has been deleted
        file.createNewFile();
      } else if (!file.canWrite()) {
        throw new IOException("The file is read-only");
      }
      IStreamableFileService service = factory.getService(file);
      IStreamableFile flv = service.getStreamableFile(file);
      if (mode == null || mode.equals(IClientStream.MODE_RECORD)) {
        writer = flv.getWriter();
        //write the decoder config tag if it exists
        if (videoConfigurationTag != null) {
          writer.writeTag(videoConfigurationTag);
View Full Code Here
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.