Jump to content
  • 0

Get error while importing WebRTCAdaptor from @antmedia/webrtc_adaptor


Tahmid Khandokar
 Share

Question

Hello,
I'm facing error while I importing WebRTCAdaptor from @antmedia/webrtc_adaptor. Here I attached the screenshot of the error. I've checked the package.json file of @antmedia. In that, all are OK, but I don't know why I'm getting this error.

Thanks in advance.

Error while importing through require()

image.png.a9ed20c799271482f23884c49a2e2d8c.png

My code using require statement:

const express = require("express");
const app = express();

const webRTCAdapter = require("@antmedia/webrtc_adaptor");

app.listen(3000, () => console.log("server is running at port 3000"));

package.json

{
  "name": "node_ams",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.18.1"
  },
  "devDependencies": {
    "@antmedia/webrtc_adaptor": "^2.4.3"
  }
}

 

Error while importing through import statement:

image.png.63db7edbaf32ae2005de8500b56fbb18.png

My code using import statement

import express from "express";
const app = express();

import { WebRTCAdaptor } from "@ant-media/webrtc_adaptor";

app.listen(3000, () => console.log("server is running at port 3000"));

package.json

{
  "name": "node_ams",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "type": "module",
  "scripts": {
    "start": "node index.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.18.1"
  },
  "devDependencies": {
    "@antmedia/webrtc_adaptor": "^2.4.3"
  }
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Tahmid Khandokar

It looks like there are some problems with the NPM package. I created an issue and you can follow the status from the link.

https://github.com/ant-media/Ant-Media-Server/issues/4402

By the way, until we fix the issue, you can manually download and import the webrtc adaptor.

https://github.com/ant-media/StreamApp/blob/master/src/main/webapp/js/webrtc_adaptor.js

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...