From c29bb15f2bbef5b8a2c356a2919f08668084a05d Mon Sep 17 00:00:00 2001 From: MathieuPoux Date: Thu, 18 Apr 2024 12:23:12 +0200 Subject: [PATCH 1/4] docs(README): fix links, shortened a TIP description --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 73fe368..f860586 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,9 @@ Then [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modu import * as WebRTC from '@ceeblue/webrtc-client'; ``` > 💡 **TIP** -> - If your project uses [TypeScript](https://www.typescriptlang.org/), it is recommended to set `"target": "ES6"` in your configuration. This setting aligns with our usage of ES6 features and ensures that your build will succeed. For those requiring a backwards-compatible UMD (Universal Module Definition) version, a [local build](#development) is advised. -> Defining the compiler option `"moduleResolution": "Node"` in **tsconfig.json** helps with import errors by ensuring that TypeScript uses the correct strategy for resolving imports based on the targeted Node.js version. +> +> If your project uses [TypeScript](https://www.typescriptlang.org/), it is recommended to set `"target": "ES6"` in your configuration to align with our usage of ES6 features and ensures that your build will succeed (for those requiring a backwards-compatible [UMD](https://github.com/umdjs/umd) version, a [local build](#building-locally) is advised). +> Then Defining the compiler option `"moduleResolution": "Node"` in **tsconfig.json** helps with import errors by ensuring that TypeScript uses the correct strategy for resolving imports based on the targeted Node.js version. > ```json > { > "compilerOptions": { @@ -107,13 +108,13 @@ To understand how to use the library through examples, we provide three illustra - [/examples/player.html](./examples/player.html) → Play a stream - [/examples/player-with-timed-metadata.html](./examples/player-with-timed-metadata.html) → Play a stream with timed metadata -1. In your project directory, [if you have installed the simple-http package](/#requirements), execute the following command from the Terminal prompt by navigating to: +1. In your project directory, if you have installed the [http-server package](#requirements), execute the following command from the Terminal prompt by navigating to: ```shell http-server . -p 8081 ``` -2. Navigate to the specified address in your browser, making sure to replace any placeholders in the URL with the variables you have copied during the [stream setup](/#requirements) in the dashboard. +2. Navigate to the specified address in your browser, making sure to replace any placeholders in the URL with the variables you have copied during the [stream setup](#requirements) in the dashboard. ```html http://localhost:8081/examples/streamer.html?host=&stream= @@ -121,7 +122,7 @@ To understand how to use the library through examples, we provide three illustra 3. Click on **Start streaming**. Upon doing so, a live stream from your webcam will initiate. Should your browser request permission to access your camera, ensure to grant it. -4. In the address bar of a separate browser window, enter the following address, making sure to replace the placeholders in the URL with the variables you have copied while configuring the [stream setup](/#requirements) in the dashboard. +4. In the address bar of a separate browser window, enter the following address, making sure to replace the placeholders in the URL with the variables you have copied while configuring the [stream setup](#requirements) in the dashboard. ```html http://localhost:8081/examples/player.html?host=&stream= From 159396892f62708e1c540587aadb7eb3b22f89d7 Mon Sep 17 00:00:00 2001 From: MathieuPoux Date: Thu, 18 Apr 2024 16:34:29 +0200 Subject: [PATCH 2/4] docs(README): fix a link and sentence in docs part --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f860586..b5a7899 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ This monorepo also contains built-in documentation about the APIs in the library ``` npm run build:docs ``` -You can access the documentation by opening the index.html file in the docs folder with your browser (`./docs/index.html`), or, if you have [installed and started the http-server](/#requirements), by navigating to: +You can access the documentation by opening the index.html file in the docs folder with your browser (`./docs/index.html`), or if you have installed and started the [http-server service](#requirements) by navigating to: ``` http://localhost:8081/docs/ ``` From 6eff672f9b4b2ac8df3b1c5e8b9612fc527a2543 Mon Sep 17 00:00:00 2001 From: MathieuPoux Date: Fri, 26 Apr 2024 00:15:48 +0200 Subject: [PATCH 3/4] fix(README): fix error in the code examples --- README.md | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index b5a7899..3e9a2e1 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ import * as WebRTC from '@ceeblue/webrtc-client'; To publish the stream `` to ``, use the [Streamer](./src/Streamer.ts) class and the variables you saved while setting up the stream in the dashboard [Requirements](#requirements). For a full example, see push.html in [Examples](#examples). ```javascript -import Streamer as WebRTC from '@ceeblue/webrtc-client'; +import { Streamer } from '@ceeblue/webrtc-client'; const streamer = new Streamer(); streamer.onStart = stream => { @@ -60,16 +60,13 @@ streamer.onStart = stream => { streamer.onStop = _ => { console.log('stop streaming'); } -navigator.mediaDevices -.getUserMedia({ audio: true, video: true }) -.then(stream => { - streamer.start(stream, { - host: , - streamName: , - iceServer: { - urls: ['turn:' + + ':3478?transport=tcp', 'turn:' + + ':3478'], - username: 'csc_demo', credential: 'UtrAFClFFO' - } +const stream = await navigator.mediaDevices.getUserMedia({ audio: true, video: true }); +streamer.start(stream, { + host: , + streamName: , + iceServer: { + urls: ['turn:' + + ':3478?transport=tcp', 'turn:' + + ':3478'], + username: 'csc_demo', credential: 'UtrAFClFFO' } }); ``` @@ -79,7 +76,7 @@ navigator.mediaDevices To play the stream `` from ``, use the [Player](./src/Player.ts) class and the variables you saved while setting up the stream in the dashboard [Requirements](#requirements). For a full example, see play.html in [Examples](#examples). ```javascript -import Player as WebRTC from '@ceeblue/webrtc-client'; +import { Player } from '@ceeblue/webrtc-client'; const player = new Player(); @@ -90,14 +87,14 @@ player.onStart = stream => { player.onStop = _ => { console.log('stop playing'); } -streamer.start(stream, { +player.start({ host: , - streamName: , - iceServer: { + streamName: , + iceServer: { urls: ['turn:' + + ':3478?transport=tcp', 'turn:' + + ':3478'], username: 'csc_demo', credential: 'UtrAFClFFO' } -} +}); ``` ## Examples From 60a96930d0a18c9f5a36fb688ea1017e1c4c2568 Mon Sep 17 00:00:00 2001 From: Thomas Jammet Date: Fri, 26 Apr 2024 09:58:42 +0200 Subject: [PATCH 4/4] docs(readme): small changes to readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3e9a2e1..420d5c2 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ import * as WebRTC from '@ceeblue/webrtc-client'; > 💡 **TIP** > > If your project uses [TypeScript](https://www.typescriptlang.org/), it is recommended to set `"target": "ES6"` in your configuration to align with our usage of ES6 features and ensures that your build will succeed (for those requiring a backwards-compatible [UMD](https://github.com/umdjs/umd) version, a [local build](#building-locally) is advised). -> Then Defining the compiler option `"moduleResolution": "Node"` in **tsconfig.json** helps with import errors by ensuring that TypeScript uses the correct strategy for resolving imports based on the targeted Node.js version. +> Then defining the compiler option `"moduleResolution": "Node"` in **tsconfig.json** helps with import errors by ensuring that TypeScript uses the correct strategy for resolving imports based on the targeted Node.js version. > ```json > { > "compilerOptions": { @@ -105,7 +105,7 @@ To understand how to use the library through examples, we provide three illustra - [/examples/player.html](./examples/player.html) → Play a stream - [/examples/player-with-timed-metadata.html](./examples/player-with-timed-metadata.html) → Play a stream with timed metadata -1. In your project directory, if you have installed the [http-server package](#requirements), execute the following command from the Terminal prompt by navigating to: +1. In your project directory, if you have installed the [http-server service](#requirements), execute the following command from the Terminal prompt by navigating to: ```shell http-server . -p 8081