openvidu-browser and openvidu-node-client generate-docs.sh

pull/431/head
pabloFuente 2020-04-05 21:34:10 +02:00
parent b182b8b30e
commit 9aee3eaf44
14 changed files with 63 additions and 25 deletions

View File

@ -0,0 +1,19 @@
#!/bin/bash
if [[ -z "$BASEHREF_VERSION" ]]; then
echo "Example of use: \"BASEHREF_VERSION=2.12.0 ${0}\"" 1>&2
exit 1
fi
# Replace version from "stable" to the specified one in all TypeDoc links
grep -rl '/en/stable/' src | xargs sed -i -e 's|/en/stable/|/en/'${BASEHREF_VERSION}'/|g'
# Generate TypeDoc
./node_modules/typedoc/bin/typedoc --options ./config/typedoc.js ./src
# Return links to "stable" version
grep -rl '/en/'${BASEHREF_VERSION}'/' src | xargs sed -i -e 's|/en/'${BASEHREF_VERSION}'/|/en/stable/|g'
# Clean previous docs from openvidu.io-docs repo and copy new ones
rm -rf ../../openvidu.io-docs/docs/api/openvidu-browser/*
cp -R ./docs/. ../../openvidu.io-docs/docs/api/openvidu-browser

View File

@ -38,7 +38,7 @@
"browserify": "VERSION=${VERSION:-dev}; cd src && ../node_modules/browserify/bin/cmd.js Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/openvidu-browser-$VERSION.js -v",
"browserify-prod": "VERSION=${VERSION:-dev}; cd src && ../node_modules/browserify/bin/cmd.js --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | ../node_modules/uglify-js/bin/uglifyjs --source-map content=inline --output ../static/js/openvidu-browser-$VERSION.min.js",
"build": "cd src/OpenVidu && ./../../node_modules/typescript/bin/tsc && cd ../.. && ./node_modules/typescript/bin/tsc --declaration src/index.ts --outDir ./lib --sourceMap --lib dom,es5,es2015.promise,scripthost",
"docs": "./node_modules/typedoc/bin/typedoc --options ./config/typedoc.js ./src && rm -rf ../../openvidu.io-docs/docs/api/openvidu-browser/* && cp -R ./docs/. ../../openvidu.io-docs/docs/api/openvidu-browser"
"docs": "./generate-docs.sh"
},
"types": "lib/index.d.ts",
"version": "2.12.0"

View File

@ -216,12 +216,12 @@ export class OpenVidu {
* The [[Publisher]] object will dispatch an `accessAllowed` or `accessDenied` event once it has been granted access to the requested input devices or not.
*
* The [[Publisher]] object will dispatch a `videoElementCreated` event once a HTML video element has been added to DOM (only if you
* [let OpenVidu take care of the video players](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.
* [let OpenVidu take care of the video players](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.
*
* The [[Publisher]] object will dispatch a `streamPlaying` event once the local streams starts playing. See [[StreamManagerEvent]] to learn more.
*
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher will be inserted (see [[PublisherProperties.insertMode]]). If *null* or *undefined* no default video will be created for this Publisher.
* You can always call method [[Publisher.addVideoElement]] or [[Publisher.createVideoElement]] to manage the video elements on your own (see [Manage video players](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos) section)
* You can always call method [[Publisher.addVideoElement]] or [[Publisher.createVideoElement]] to manage the video elements on your own (see [Manage video players](/en/stable/cheatsheet/manage-videos) section)
* @param completionHandler `error` parameter is null if `initPublisher` succeeds, and is defined if it fails.
* `completionHandler` function is called before the Publisher dispatches an `accessAllowed` or an `accessDenied` event
*/

View File

@ -200,20 +200,20 @@ export class Session implements EventDispatcher {
*
* The [[Session]] object of the local participant will dispatch a `sessionDisconnected` event.
* This event will automatically unsubscribe the leaving participant from every Subscriber object of the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and also deletes any HTML video element associated to each Subscriber (only those [created by OpenVidu Browser](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* and also deletes any HTML video element associated to each Subscriber (only those [created by OpenVidu Browser](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, each Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` upon event `sessionDisconnected` to avoid this behavior and take care of disposing and cleaning all the Subscriber objects yourself.
* See [[SessionDisconnectedEvent]] and [[VideoElementEvent]] to learn more to learn more.
*
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event if there is a [[Publisher]] object publishing to the session.
* This event will automatically stop all media tracks and delete any HTML video element associated to it (only those [created by OpenVidu Browser](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* This event will automatically stop all media tracks and delete any HTML video element associated to it (only those [created by OpenVidu Browser](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` upon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session (to do so it is a mandatory requirement to call `Session.unpublish()`
* or/and `Session.disconnect()` in the previous session). See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
*
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event if the disconnected participant was publishing.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks)
* and also deletes any HTML video element associated to that Subscriber (only those [created by OpenVidu Browser](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* and also deletes any HTML video element associated to that Subscriber (only those [created by OpenVidu Browser](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` upon event `streamDestroyed` to avoid this default behavior and take care of disposing and cleaning the Subscriber object yourself.
* See [[StreamEvent]] and [[VideoElementEvent]] to learn more.
@ -235,13 +235,13 @@ export class Session implements EventDispatcher {
* #### Events dispatched
*
* The [[Subscriber]] object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM (only if you
* [let OpenVidu take care of the video players](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.
* [let OpenVidu take care of the video players](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)). See [[VideoElementEvent]] to learn more.
*
* The [[Subscriber]] object will dispatch a `streamPlaying` event once the remote stream starts playing. See [[StreamManagerEvent]] to learn more.
*
* @param stream Stream object to subscribe to
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Subscriber will be inserted (see [[SubscriberProperties.insertMode]]). If *null* or *undefined* no default video will be created for this Subscriber.
* You can always call method [[Subscriber.addVideoElement]] or [[Subscriber.createVideoElement]] to manage the video elements on your own (see [Manage video players](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos) section)
* You can always call method [[Subscriber.addVideoElement]] or [[Subscriber.createVideoElement]] to manage the video elements on your own (see [Manage video players](/en/stable/cheatsheet/manage-videos) section)
* @param completionHandler `error` parameter is null if `subscribe` succeeds, and is defined if it fails.
*/
subscribe(stream: Stream, targetElement: string | HTMLElement, param3?: ((error: Error | undefined) => void) | SubscriberProperties, param4?: ((error: Error | undefined) => void)): Subscriber {
@ -324,7 +324,7 @@ export class Session implements EventDispatcher {
* #### Events dispatched
*
* The [[Subscriber]] object will dispatch a `videoElementDestroyed` event for each video associated to it that was removed from DOM.
* Only videos [created by OpenVidu Browser](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)) will be automatically removed
* Only videos [created by OpenVidu Browser](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)) will be automatically removed
*
* See [[VideoElementEvent]] to learn more
*/
@ -406,13 +406,13 @@ export class Session implements EventDispatcher {
*
* The [[Publisher]] object of the local participant will dispatch a `streamDestroyed` event.
* This event will automatically stop all media tracks and delete any HTML video element associated to this Publisher
* (only those videos [created by OpenVidu Browser](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* (only those videos [created by OpenVidu Browser](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Publisher object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` upon event `streamDestroyed` if you want to clean the Publisher object on your own or re-publish it in a different Session.
*
* The [[Session]] object of every other participant connected to the session will dispatch a `streamDestroyed` event.
* This event will automatically unsubscribe the Subscriber object from the session (this includes closing the WebRTCPeer connection and disposing all MediaStreamTracks) and
* delete any HTML video element associated to it (only those [created by OpenVidu Browser](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* delete any HTML video element associated to it (only those [created by OpenVidu Browser](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)).
* For every video removed, the Subscriber object will dispatch a `videoElementDestroyed` event.
* Call `event.preventDefault()` upon event `streamDestroyed` to avoid this default behavior and take care of disposing and cleaning the Subscriber object on your own.
*

View File

@ -234,7 +234,7 @@ export class StreamManager implements EventDispatcher {
/**
* Makes `video` element parameter display this [[stream]]. This is useful when you are
* [managing the video elements on your own](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos/#you-take-care-of-the-video-players)
* [managing the video elements on your own](/en/stable/cheatsheet/manage-videos/#you-take-care-of-the-video-players)
*
* Calling this method with a video already added to other Publisher/Subscriber will cause the video element to be
* disassociated from that previous Publisher/Subscriber and to be associated to this one.

View File

@ -45,7 +45,7 @@ export class RecordingEvent extends Event {
* For 'recordingStopped' event:
* - "recordingStoppedByServer": the recording has been gracefully stopped by the application
* - "sessionClosedByServer": the Session has been closed by the application
* - "automaticStop": see [Automatic stop of recordings](https://docs.openvidu.io/en/stable/advanced-features/recording/#automatic-stop-of-recordings)
* - "automaticStop": see [Automatic stop of recordings](/en/stable/advanced-features/recording/#automatic-stop-of-recordings)
* - "mediaServerDisconnect": OpenVidu Media Node has crashed or lost its connection. A new Media Node instance is active and the recording has been stopped (no media streams are available in the new Media Node)
*
* For 'recordingStarted' empty string

View File

@ -22,7 +22,7 @@ import { StreamManager } from '../../OpenVidu/StreamManager';
/**
* Defines the following events:
* - `videoElementCreated`: dispatched by [[Publisher]] and [[Subscriber]] whenever a new HTML video element has been inserted into DOM by OpenVidu Browser library. See
* [Manage video players](https://docs.openvidu.io/en/stable/cheatsheet/manage-videos) section.
* [Manage video players](/en/stable/cheatsheet/manage-videos) section.
* - `videoElementDestroyed`: dispatched by [[Publisher]] and [[Subscriber]] whenever an HTML video element has been removed from DOM by OpenVidu Browser library.
*/
export class VideoElementEvent extends Event {

View File

@ -6,7 +6,7 @@ if [[ -z "$BASEHREF_VERSION" ]]; then
fi
# Replace version from "stable" to the specified one in all Javadoc links
grep -rl '"/en/stable/' ./src | xargs sed -i -e 's|"/en/stable/|"/en/'${BASEHREF_VERSION}'/|g'
grep -rl '/en/stable/' ./src | xargs sed -i -e 's|/en/stable/|/en/'${BASEHREF_VERSION}'/|g'
# Generate JavaDoc
mvn javadoc:javadoc
@ -14,7 +14,7 @@ rm -rf ../../openvidu.io/api/openvidu-java-client/*
cp -R ./target/site/apidocs/. ../../openvidu.io-docs/docs/api/openvidu-java-client
# Return links to "stable" version
grep -rl '"/en/'${BASEHREF_VERSION}'/' ./src | xargs sed -i -e 's|"/en/'${BASEHREF_VERSION}'/|"/en/stable/|g'
grep -rl '/en/'${BASEHREF_VERSION}'/' ./src | xargs sed -i -e 's|/en/'${BASEHREF_VERSION}'/|/en/stable/|g'
# Add favicon to index.html
sed -i -e 's/<head>/<head><link rel=\"shortcut icon\" href=\"\/img\/favicon.ico\" type=\"image\/x-icon\">/g' ../../openvidu.io-docs/docs/api/openvidu-java-client/index.html

View File

@ -108,7 +108,7 @@ public class KurentoOptions {
* Defines the maximum number of Kbps that the client owning the token will be
* able to receive from Kurento Media Server. 0 means unconstrained. Giving a
* value to this property will override the global configuration set in <a
* href=/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server"
* href="/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server"
* target="_blank">OpenVidu Server configuration</a> (parameter
* <code>openvidu.streams.video.max-recv-bandwidth</code>) for every incoming
* stream of the user owning the token. <br>

View File

@ -0,0 +1,19 @@
#!/bin/bash
if [[ -z "$BASEHREF_VERSION" ]]; then
echo "Example of use: \"BASEHREF_VERSION=2.12.0 ${0}\"" 1>&2
exit 1
fi
# Replace version from "stable" to the specified one in all TypeDoc links
grep -rl '/en/stable/' src | xargs sed -i -e 's|/en/stable/|/en/'${BASEHREF_VERSION}'/|g'
# Generate TypeDoc
./node_modules/typedoc/bin/typedoc --options ./config/typedoc.js ./src
# Return links to "stable" version
grep -rl '/en/'${BASEHREF_VERSION}'/' src | xargs sed -i -e 's|/en/'${BASEHREF_VERSION}'/|/en/stable/|g'
# Clean previous docs from openvidu.io-docs repo and copy new ones
rm -rf ../../openvidu.io-docs/docs/api/openvidu-node-client/*
cp -R ./docs/. ../../openvidu.io-docs/docs/api/openvidu-node-client

View File

@ -30,7 +30,7 @@
},
"scripts": {
"build": "./node_modules/typescript/bin/tsc",
"docs": "./node_modules/typedoc/bin/typedoc --options ./config/typedoc.js ./src && rm -rf ../../openvidu.io-docs/docs/api/openvidu-node-client/* && cp -R ./docs/. ../../openvidu.io-docs/docs/api/openvidu-node-client"
"docs": "./generate-docs.sh"
},
"typings": "lib/index.d.ts",
"version": "2.12.0"

View File

@ -41,7 +41,7 @@ export enum RecordingLayout {
HORIZONTAL_PRESENTATION = 'VERTICAL_PRESENTATION',
/**
* Use your own custom recording layout. See [Custom recording layouts](https://docs.openvidu.io/en/stable/advanced-features/recording#custom-recording-layouts) to learn more
* Use your own custom recording layout. See [Custom recording layouts](/en/stable/advanced-features/recording#custom-recording-layouts) to learn more
*/
CUSTOM = 'CUSTOM'
}

View File

@ -44,7 +44,7 @@ export interface RecordingProperties {
/**
* The relative path to the specific custom layout you want to use.<br>
* Will only have effect if [[RecordingProperties.outputMode]] is `COMPOSED` and [[RecordingProperties.recordingLayout]] is `CUSTOM`<br>
* See [Custom recording layouts](https://docs.openvidu.io/en/stable/advanced-features/recording#custom-recording-layouts) to learn more
* See [Custom recording layouts](/en/stable/advanced-features/recording#custom-recording-layouts) to learn more
*/
customLayout?: string;

View File

@ -41,20 +41,20 @@ export interface TokenOptions {
* Some advanced properties setting the configuration that the WebRTC streams of the user owning the token will have in Kurento Media Server.
* You can adjust:
* - `videoMaxRecvBandwidth`: maximum number of Kbps that the client owning the token will be able to receive from Kurento Media Server. 0 means unconstrained. Giving a value to this property will override
* the global configuration set in [OpenVidu Server configuration](https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server)
* the global configuration set in [OpenVidu Server configuration](/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server)
* (parameter `openvidu.streams.video.max-recv-bandwidth`) for every incoming stream of the user owning the token.
* _**WARNING**: the lower value set to this property limits every other bandwidth of the WebRTC pipeline this server-to-client stream belongs to. This includes the user publishing the stream and every other user subscribed to the stream_
* - `videoMinRecvBandwidth`: minimum number of Kbps that the client owning the token will try to receive from Kurento Media Server. 0 means unconstrained. Giving a value to this property will override
* the global configuration set in [OpenVidu Server configuration](https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server)
* the global configuration set in [OpenVidu Server configuration](/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server)
* (parameter `openvidu.streams.video.min-recv-bandwidth`) for every incoming stream of the user owning the token
* - `videoMaxSendBandwidth`: maximum number of Kbps that the client owning the token will be able to send to Kurento Media Server. 0 means unconstrained. Giving a value to this property will override
* the global configuration set in [OpenVidu Server configuration](https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server)
* the global configuration set in [OpenVidu Server configuration](/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server)
* (parameter `openvidu.streams.video.max-send-bandwidth`) for every outgoing stream of the user owning the token.
* _**WARNING**: this value limits every other bandwidth of the WebRTC pipeline this client-to-server stream belongs to. This includes every other user subscribed to the stream_
* - `videoMinSendBandwidth`: minimum number of Kbps that the client owning the token will try to send to Kurento Media Server. 0 means unconstrained. Giving a value to this property will override
* the global configuration set in [OpenVidu Server configuration](https://docs.openvidu.io/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server)
* the global configuration set in [OpenVidu Server configuration](/en/stable/reference-docs/openvidu-server-params/#configuration-parameters-for-openvidu-server)
* (parameter `openvidu.streams.video.min-send-bandwidth`) for every outgoing stream of the user owning the token
* - `allowedFilters`: names of the filters the user owning the token will be able to apply. See [Voice and video filters](https://docs.openvidu.io/en/stable/advanced-features/filters/)
* - `allowedFilters`: names of the filters the user owning the token will be able to apply. See [Voice and video filters](/en/stable/advanced-features/filters/)
*/
kurentoOptions?: {
videoMaxRecvBandwidth?: number,