Closed hxhlb closed 5 years ago
TypeError: NodeMediaServer is not a constructor
这个是因为 node-media-server 版本不对, 请使用我代码里的版本 用 npm install 来安装
其他的错误, 看不出是哪里的问题
是使用npm install来安装的, 我确认了一下, package.json中有写版本号, 但是单独执行显示的是最新版本, 很纠结. 不知您可否告知您的服务器系统版本, npm版本, 我去搭建一套环境试试.
事实证明是因为我是后来更新了nodejs到lts版导致的node-media-server的异常. 现在NodeMediaServer没有问题了, 但是还是崩溃. 我在看看是什么参数在搞怪.
服务器是 ubuntu 16.04 node v8.9.1 npm 5.8.0
开发环境是 macOS 10.13
另外如果你要部署在服务器上的话 https://github.com/notedit/rtmp-to-webrtc/blob/master/server.js#L10
这里的ip要填写你服务器的公网ip
应该不是node版本的问题, 我本地开发都用最新的node
另外可以说一下你的需求 看是否能帮助到
感谢, 我就是因为rtmp的延迟还挺高, 并且越播延迟越大, 看到你这个方案想尝试一下. 最近想看看什么方式能够解决这种延迟, 正在广泛的收集资料.
webrtc可以用来做直播的 我们内部已经研发了 但还没产品化
技术能力不够, 请求帮助. 在ubuntu18.04上, node server.js 直接报错, TypeError: NodeMediaServer is not a constructor 但是我在本目录下新建一个单独的文件test.js, 确认NodeMediaServer是没问题的, 代码就是复制的server.js中的, 除了回调没加, 其他代码都一样. node版本10.14.2 LTS版.
在ubuntu16.04上可以运行成功, 但是看不到图像, 然后很快就整个挂掉了, 日志:
请求帮助. 我看您这示例网站挺好的, 为什么我就不行呢?