{"id":34667774,"url":"https://github.com/red5pro/example-plugin","last_synced_at":"2026-05-28T09:33:13.203Z","repository":{"id":320631181,"uuid":"1082834798","full_name":"red5pro/example-plugin","owner":"red5pro","description":"Red5 Pro Server Plugin Example","archived":false,"fork":false,"pushed_at":"2025-10-24T21:09:07.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-24T23:13:27.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/red5pro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-24T21:02:01.000Z","updated_at":"2025-10-24T21:09:11.000Z","dependencies_parsed_at":"2025-10-24T23:13:36.658Z","dependency_job_id":"a3614d48-d481-40ac-8b27-31fca5dd6dba","html_url":"https://github.com/red5pro/example-plugin","commit_stats":null,"previous_names":["red5pro/example-plugin"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/red5pro/example-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red5pro%2Fexample-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red5pro%2Fexample-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red5pro%2Fexample-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red5pro%2Fexample-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/red5pro","download_url":"https://codeload.github.com/red5pro/example-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red5pro%2Fexample-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28006715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T19:24:59.127Z","updated_at":"2025-12-24T19:25:00.080Z","avatar_url":"https://github.com/red5pro.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Red5 Pro Server Example Plugin\n\nThis project serves as a template and example for developers who want to build custom plugins for Red5 Pro Server. It demonstrates the core plugin architecture, stream listener integration, servlet configuration, and best practices for extending Red5 Pro functionality.\n\n## Overview\n\nRed5 Pro plugins allow you to extend the server with custom functionality such as:\n- Custom stream processing and manipulation\n- HTTP endpoints and REST APIs\n- Integration with external services\n- Custom authentication and authorization\n- Recording and transcoding workflows\n- Analytics and monitoring\n\nThis example includes:\n- **MyRed5ProPlugin**: Main plugin class demonstrating lifecycle management\n- **MyProStreamListener**: Stream listener for intercepting and processing media packets\n- **MyServlet**: HTTP servlet integration example\n\n## Prerequisites\n\n- **Java 21** or higher\n- **Maven 3.6.0** or higher\n- **Red5 Pro Server** installation (for deployment and testing)\n\n## Setting Up Red5 Pro Dependencies\n\nSince Red5 Pro's Maven repository (https://red5pro.jfrog.io) requires authentication, you'll need to install the Red5 Pro JARs from your server distribution into your local Maven repository.\n\n### Option 1: Install JARs from Red5 Pro Server Distribution\n\nNavigate to your Red5 Pro Server installation and run these commands to install the required JARs to your local Maven repository:\n\n```bash\n# Set your Red5 Pro version\nRED5PRO_VERSION=15.0.0\nRED5PRO_COMMON_VERSION=14.3.0.5\nRED5PRO_NOTIFICATIONS_VERSION=14.3.1\nRED5_VERSION=2.0.22\n\n# Navigate to your Red5 Pro Server lib directory\ncd /path/to/red5pro/lib\n\n# Install red5pro-internal\nmvn install:install-file \\\n  -Dfile=red5pro-internal-${RED5PRO_VERSION}.jar \\\n  -DgroupId=com.red5pro \\\n  -DartifactId=red5pro-internal \\\n  -Dversion=${RED5PRO_VERSION} \\\n  -Dpackaging=jar\n\n# Install red5pro-common\nmvn install:install-file \\\n  -Dfile=red5pro-common-${RED5PRO_COMMON_VERSION}.jar \\\n  -DgroupId=com.red5pro \\\n  -DartifactId=red5pro-common \\\n  -Dversion=${RED5PRO_COMMON_VERSION} \\\n  -Dpackaging=jar\n\n# Install red5pro-notifications\nmvn install:install-file \\\n  -Dfile=red5pro-notifications-${RED5PRO_NOTIFICATIONS_VERSION}.jar \\\n  -DgroupId=com.red5pro \\\n  -DartifactId=red5pro-notifications \\\n  -Dversion=${RED5PRO_NOTIFICATIONS_VERSION} \\\n  -Dpackaging=jar\n\n# Install red5pro-mega\nmvn install:install-file \\\n  -Dfile=red5pro-mega-${RED5PRO_VERSION}.jar \\\n  -DgroupId=com.red5pro \\\n  -DartifactId=red5pro-mega \\\n  -Dversion=${RED5PRO_VERSION} \\\n  -Dpackaging=jar\n\n# Install red5pro-restreamer-plugin\nmvn install:install-file \\\n  -Dfile=red5pro-restreamer-plugin-${RED5PRO_VERSION}.jar \\\n  -DgroupId=com.red5pro \\\n  -DartifactId=red5pro-restreamer-plugin \\\n  -Dversion=${RED5PRO_VERSION} \\\n  -Dpackaging=jar\n\n# Install red5pro-whip-plugin\nmvn install:install-file \\\n  -Dfile=red5pro-whip-plugin-${RED5PRO_VERSION}.jar \\\n  -DgroupId=com.red5pro \\\n  -DartifactId=red5pro-whip-plugin \\\n  -Dversion=${RED5PRO_VERSION} \\\n  -Dpackaging=jar\n\n# Install Red5 Server dependencies\nmvn install:install-file \\\n  -Dfile=red5-server-${RED5_VERSION}.jar \\\n  -DgroupId=org.red5 \\\n  -DartifactId=red5-server \\\n  -Dversion=${RED5_VERSION} \\\n  -Dpackaging=jar\n\nmvn install:install-file \\\n  -Dfile=red5-io-${RED5_VERSION}.jar \\\n  -DgroupId=org.red5 \\\n  -DartifactId=red5-io \\\n  -Dversion=${RED5_VERSION} \\\n  -Dpackaging=jar\n\nmvn install:install-file \\\n  -Dfile=red5-server-common-${RED5_VERSION}.jar \\\n  -DgroupId=org.red5 \\\n  -DartifactId=red5-server-common \\\n  -Dversion=${RED5_VERSION} \\\n  -Dpackaging=jar\n```\n\n### Option 2: Remove Private Repository (If You Have Local JARs)\n\nAfter installing the JARs locally, you can remove or comment out the Red5 Pro JFrog repository in `pom.xml`:\n\n```xml\n\u003c!-- Comment out or remove this repository --\u003e\n\u003c!--\n\u003crepository\u003e\n    \u003cid\u003ered5pro-ext-release\u003c/id\u003e\n    \u003curl\u003ehttps://red5pro.jfrog.io/red5pro/ext-release-local\u003c/url\u003e\n    \u003csnapshots\u003e\n        \u003cenabled\u003etrue\u003c/enabled\u003e\n    \u003c/snapshots\u003e\n\u003c/repository\u003e\n--\u003e\n```\n\n### Option 3: Configure Maven Settings with Credentials (If You Have Access)\n\nIf you have Red5 Pro repository credentials, add them to `~/.m2/settings.xml`:\n\n```xml\n\u003csettings\u003e\n  \u003cservers\u003e\n    \u003cserver\u003e\n      \u003cid\u003ered5pro-ext-release\u003c/id\u003e\n      \u003cusername\u003eYOUR_USERNAME\u003c/username\u003e\n      \u003cpassword\u003eYOUR_PASSWORD\u003c/password\u003e\n    \u003c/server\u003e\n  \u003c/servers\u003e\n\u003c/settings\u003e\n```\n\n## Building the Plugin\n\nOnce dependencies are configured:\n\n```bash\n# Clean and build\nmvn clean package\n\n# The output JAR will be in: target/red5pro-example-plugin-1.0.0.jar\n```\n\n### Code Formatting\n\nThe project uses Red5 Pro's code formatting standards:\n\n```bash\n# Format all Java files\nmvn formatter:format\n```\n\n## Deploying the Plugin\n\n1. **Build the plugin** (see above)\n\n2. **Copy the JAR** to your Red5 Pro Server plugins directory:\n   ```bash\n   cp target/red5pro-example-plugin-1.0.0.jar /path/to/red5pro/plugins/\n   ```\n\n3. **Restart Red5 Pro Server**:\n   ```bash\n   cd /path/to/red5pro\n   ./red5-shutdown.sh\n   ./red5.sh\n   ```\n\n4. **Verify the plugin loaded** by checking the logs:\n   ```bash\n   tail -f /path/to/red5pro/log/red5.log\n   ```\n\n   You should see: `Starting MyRed5ProPlugin version 1.0.0`\n\n## Project Structure\n\n```\nexample-plugin/\n├── src/main/java/com/example/\n│   ├── MyRed5ProPlugin.java          # Main plugin class\n│   ├── listener/\n│   │   └── MyProStreamListener.java  # Stream listener example\n│   └── servlet/\n│       └── MyServlet.java            # HTTP servlet example\n├── src/main/webapp/WEB-INF/\n│   └── web.xml                       # Servlet configuration\n├── pom.xml                           # Maven build configuration\n└── Red5Pro-formatter.xml             # Code formatting rules\n```\n\n## Customizing for Your Plugin\n\n### 1. Update Project Identity\n\nEdit `pom.xml` and change:\n- `\u003cgroupId\u003e` - Your organization/package name\n- `\u003cartifactId\u003e` - Your plugin name\n- `\u003cname\u003e` - Display name\n- `\u003cdescription\u003e` - What your plugin does\n\n### 2. Rename Plugin Class\n\n1. Rename `MyRed5ProPlugin.java` to your plugin name (e.g., `MyAwesomePlugin.java`)\n2. Update the `NAME` constant inside the class\n3. Update the manifest entry in `pom.xml`:\n   ```xml\n   \u003cRed5Pro-Plugin-Main-Class\u003ecom.yourpackage.YourPluginName\u003c/Red5Pro-Plugin-Main-Class\u003e\n   \u003cYourPluginName-Version\u003e${project.version} - ${buildNumber} (on: ${timestamp})\u003c/YourPluginName-Version\u003e\n   ```\n\n### 3. Update Package Names\n\nRename packages from `com.example` to your organization's package structure.\n\n### 4. Implement Your Functionality\n\n- **Add stream processing**: Implement or extend `MyProStreamListener`\n- **Add HTTP endpoints**: Extend `MyServlet` or create new servlets\n- **Add startup logic**: Put initialization code in `doStartProPlugin()`\n- **Add cleanup logic**: Put shutdown code in `doStopProPlugin()`\n\n## Key Concepts\n\n### Plugin Lifecycle\n\n1. **Initialization**: Red5 Pro calls `doStartProPlugin()` when loading\n2. **Runtime**: Your plugin can access Red5 Pro APIs, register listeners, start background tasks\n3. **Shutdown**: Red5 Pro calls `doStopProPlugin()` before unloading\n\n### Stream Listeners\n\nStream listeners intercept media packets (audio/video/data) as they flow through the server:\n\n```java\nProStream proStream = ProStreamService.getProStream(scope, streamName);\nproStream.addStreamListener(myListener);\n```\n\n### Background Tasks\n\nUse the plugin's executor service for async work:\n\n```java\nMyRed5ProPlugin.submit(() -\u003e {\n    // Your background task\n});\n\n// Or scheduled tasks\nMyRed5ProPlugin.schedule(task, initialDelay, repeatDelay);\n```\n\n### Servlet Integration\n\nServlets provide HTTP endpoints for your plugin:\n1. Create servlet class extending `HttpServlet` or `MyServlet`\n2. Register in `src/main/webapp/WEB-INF/web.xml`\n3. Access plugin via `PluginRegistry.getPlugin()`\n\n## Dependencies\n\nAll Red5 Pro and Red5 Server dependencies use `\u003cscope\u003eprovided\u003c/scope\u003e` because they're supplied by the server at runtime. Only include dependencies in your plugin JAR that are NOT already in the Red5 Pro Server.\n\nCommon provided dependencies:\n- Red5 Pro core libraries\n- Red5 Server\n- Spring Framework (6.2.x)\n- Apache MINA\n- SLF4J/Logback\n- Apache Commons libraries\n- Tomcat servlet API\n\n## Troubleshooting\n\n### Plugin Not Loading\n\n- Check `log/red5.log` for errors\n- Verify the `Red5Pro-Plugin-Main-Class` in the JAR manifest points to your plugin class\n- Ensure your plugin class extends `Red5ProPlugin`\n- Check for missing dependencies or version conflicts\n\n### Build Failures\n\n- Verify Java version: `java -version` (must be 21+)\n- Verify Maven version: `mvn -version` (must be 3.6.0+)\n- Check that Red5 Pro JARs are in your local Maven repository: `ls ~/.m2/repository/com/red5pro/`\n- Run with debug output: `mvn clean package -X`\n\n### ClassNotFoundException at Runtime\n\nThe dependency scope is likely wrong. Red5 Pro-provided libraries should use `\u003cscope\u003eprovided\u003c/scope\u003e`. Only third-party libraries not in Red5 Pro should be bundled (default scope or `\u003cscope\u003ecompile\u003c/scope\u003e`).\n\n## Version Compatibility\n\nThis example is configured for:\n- **Red5 Pro Server**: 15.0.0\n- **Red5 Server**: 2.0.22\n- **Spring Framework**: 6.2.10\n- **Java**: 21+\n\nAdjust versions in `pom.xml` to match your Red5 Pro Server installation.\n\n## Resources\n\n- Red5 Pro Documentation: https://www.red5.net/docs/\n- Red5 Pro Support: https://account.red5.net/\n- Example Plugin Source: https://github.com/red5pro/example-plugin\n\n## License\n\nUpdate with your license information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred5pro%2Fexample-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fred5pro%2Fexample-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred5pro%2Fexample-plugin/lists"}