AngularJS 1.x: mediasoup-client v3 inclusion

Hi Inaki,

Note: I’m not an expert in frontend / AngularJS

I have been using MediaSoup v2 in my application with frontend in AngularJS. The mediasoup-client is included using a script tag in say index.html and able to use the client.

Now, I’m trying to migrate to MediaSoup V3 and kind of blocked at client inclusion. The “import” is not recognized.

import {Device} from ‘mediasoup-client’;
import * as mediaSoupClient from ‘mediasoup-client’;
import {Device} from ‘…/nodemodules/mediasoup-client/lib/index.js’;

Throws exception like:

"SyntaxError: Unexpected token { "
“SyntaxError: Unexpected token *”

If I’m correct, v2 client is a minified js file suitable to include as script tag.
How can I include mediasoup-client v3 as script tag and/or smoothly transistion AngularJS frontend to v3?

Please check the docs. mediasoup-client v3 comes unbundled. You must bundle the library if required before using.

Hi, let’s please avoid direct naming when asking for support. There are more developers doing mediasoup and I’d like that other users also contribute here :slight_smile:

As @jmillan said, we no longer provide a ES5 minified/bundled single-file. We don’t want to enter that game anymore.

In theory, modern web apps development means that people build their apps using React, Angular, etc, by loading dependencies managed with NPM or similar, using ES6 import, and then transpiling their application to “browsers suitable code”. There is tons of ddocumentation and different practices about it in Google and we don’t want to take that responsibility. The user is provided with a unbundled ES6 version of mediasoup-client. It’s up to him how to build or include it within its project.

NOTE: since mediasoup-client v3 must run on both browser and Node, it internally uses CommonJS (require() calls to load internal modules/files).