Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Playback directory not working #342

Open
azizairo opened this issue Nov 17, 2023 · 1 comment
Open

Custom Playback directory not working #342

azizairo opened this issue Nov 17, 2023 · 1 comment

Comments

@azizairo
Copy link

###CustomFileNameGenerator not working

Short description

I have been developed demo app for streaming vod from custom directory. I've implemented CustomFileNameGenerator as described in documentation, but it is not working. App always searches file in root file.

Environment

[] Operating system and version: Windows
[] Java version: Java 17
[] Red5 version: 1.3.25

Expected behavior

I expect that app would search files in directory wich i described via CustomFileNameGenerator:

@slf4j
public class CustomStreamFileNameGenerator implements IStreamFilenameGenerator {

private final String streamsDirectory = "\\streams\\videos";
private boolean resolvesAbsolutePath = false;

public CustomStreamFileNameGenerator() {

    log.info("Instance is crated");
}

@Override
public String generateFilename(IScope iScope,
                               String name, GenerationType generationType) {

    return generateFilename(iScope, name, null, generationType);
}

@Override
public String generateFilename(IScope iScope, String name,
                               String extension, GenerationType generationType) {

    log.info(
            "generateFilename() method is called. Input: {}, {}.",
            kv("name", name), kv("extension", extension)
    );
    String generatedFileName = streamsDirectory + name;
    if (extension != null && !extension.equals("")) {
        generatedFileName += extension;
    }
    return generatedFileName;
}

@Override
public boolean resolvesToAbsolutePath() {

    return resolvesAbsolutePath;
}

}

Actual behavior

Video files has to be located in root folder.

@chushiyun2015
Copy link

chushiyun2015 commented Nov 17, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants