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

Event Handling Broken in v4.x (nms.on() Undefined) #660

Open
Felix-Skytro opened this issue Jan 21, 2025 · 4 comments
Open

Event Handling Broken in v4.x (nms.on() Undefined) #660

Felix-Skytro opened this issue Jan 21, 2025 · 4 comments

Comments

@Felix-Skytro
Copy link

In Node-Media-Server v4.0.7, event handling seems to be broken. In previous versions (e.g., v2.7.4), I was able to use:

nms.on("prePublish", (id, streamPath, args) => {
  console.log(`Stream started: ${streamPath}`);
});

In v4.0.7, nms.on() seems to not exist.
This results in: TypeError: NMS.on is not a function

However, when I downgraded to v2.7.4, everything worked correctly.

To reproduce:

  1. Install v4.0.7:
    npm install [email protected]

  2. Try registering an event:

    const NodeMediaServer = require('node-media-server');
    const nms = new NodeMediaServer({});
    nms.run();
    nms.on("prePublish", (id, streamPath, args) => {
      console.log(`Stream started: ${streamPath}`);
    });
  1. Error occurs:
    TypeError: nms.on is not a function

Expected Behavior
nms.on() should exist and work as expected.

Actual Behavior
nms.on() seems to not exist in v4.
Downgrading to [email protected] restores normal behavior.

Environment
Node.js Version: v20.17.0
node-media-server Version: 4.0.7
OS: Windows 10 Pro 22H2 (Build: 19045.5371)

@koko1313
Copy link

#658 - Please check out this issue.
It seems they have decided to develop a new version in the master branch.
v4 is still in the early development phase and doesn't seem likely to stabilize anytime soon.
The last commit was made almost two months ago.

@General-kp
Copy link

hi did they remove the support for transcoding using ffmpeg

@Felix-Skytro
Copy link
Author

#658 - Please check out this issue. It seems they have decided to develop a new version in the master branch. v4 is still in the early development phase and doesn't seem likely to stabilize anytime soon. The last commit was made almost two months ago.

Oh I see, thanks for the info

1 similar comment
@Felix-Skytro
Copy link
Author

#658 - Please check out this issue. It seems they have decided to develop a new version in the master branch. v4 is still in the early development phase and doesn't seem likely to stabilize anytime soon. The last commit was made almost two months ago.

Oh I see, thanks for the info

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

3 participants