Compare commits

...

1313 Commits

Author SHA1 Message Date
Carlos Santos f92ee9b886 ov-components: Improve prejoin card styles 2025-08-21 13:08:31 +02:00
Carlos Santos 68d855a245 ov-components: Enhanced camera track handling and processor application in virtual background service 2025-08-21 13:08:31 +02:00
Carlos Santos 72e7469012 ov-components: Enhanced prejoin component
- Introduced background effect feature with options for 'none', 'blur', 'office', and 'nature'.
- Enhanced error handling during device initialization with retry logic and user feedback.
- Updated participant name handling to trim whitespace and clear errors on input change.

style(audio-devices): refactor audio device selection UI

- Redesigned audio device selection to use buttons instead of dropdowns for better UX.
- Improved styling for audio toggle button and device selection menu.

style(video-devices): refactor video device selection UI

- Updated video device selection to use buttons for toggling camera and selecting devices.
- Enhanced styling for video toggle button and device selection menu.

style(lang-selector): improve language selection UI

- Redesigned language selector for better usability with compact and full versions.
- Enhanced styling for language selection buttons and menu items.

style(participant-name-input): refactor participant name input field

- Updated participant name input to use a custom styled input field instead of mat-form-field.
- Improved styling for input field and error handling.

style: general UI improvements across components

- Enhanced overall styling for better consistency and user experience across various components.
2025-08-21 13:08:31 +02:00
cruizba 622a2f6707 openvidu-deployment: Change MinIO and Mimir images to use OpenVidu registry instead of bitnami. 2025-08-20 22:38:37 +02:00
Carlos Santos 72697bafa5 ov-components:Enhance logging by adding verbose level and updating log calls in TemplateManagerService 2025-08-19 11:25:56 +02:00
Carlos Santos 4fb4878342 ov-components: Refactor LoggerService to improve logger function creation and cache handling 2025-08-19 10:50:13 +02:00
Carlos Santos 57e76fe69b ov-components: Update participant name handling in Session and Toolbar components 2025-08-18 18:28:13 +02:00
Carlos Santos e1f16a6179 ov-components: Update MATERIAL_ICONS_URL to remove unnecessary icon names 2025-08-18 14:28:20 +02:00
Carlos Santos 9e9684c4db ov-components: Update RecordingActivityComponent to avoid showing recordings when not expanded 2025-08-18 14:00:16 +02:00
Carlos Santos efada4c166 ov-components: (test) Add check for speaker element when local participant is muted 2025-08-14 12:54:30 +02:00
Carlos Santos 3fc0193260 Revert "ov-components: (test) Enhance element counting method to handle timeouts gracefully"
This reverts commit 61a3589dd7.
2025-08-14 12:53:31 +02:00
Carlos Santos 61a3589dd7 ov-components: (test) Enhance element counting method to handle timeouts gracefully 2025-08-14 12:43:10 +02:00
Carlos Santos 8d1c2468f5 ov-components: Refactor VideoconferenceComponent to use private properties for external structural directives, enhancing encapsulation and template setup 2025-08-14 12:16:54 +02:00
Carlos Santos 020413257f ov-components: Implement toolbar room name directive and update toolbar to display room name dynamically 2025-08-13 12:49:03 +02:00
Carlos Santos 6c78abdcc0 ov-components: Remove unnecessary mic button interaction in stream UI tests 2025-08-11 14:17:36 +02:00
Carlos Santos e31a78d153 ov-components: refactor(storage): Enhance tab management and cleanup mechanisms in StorageService 2025-08-11 13:57:23 +02:00
Carlos Santos b1d0269211 ov-components: Add participant badges directive for enhanced participant panel functionality 2025-08-05 17:39:29 +02:00
Carlos Santos 00fcb0b115 ov-components: Revamp participant panel item for improved UI/UX and accessibility; add mute/unmute functionality and translations 2025-08-05 16:35:20 +02:00
Carlos Santos 4bf351b2df ov-components: Add layout additional elements directive for customizable UI extensions 2025-07-31 13:50:47 +02:00
Carlos Santos e9ecceeb77 ov-components: Add participant panel directive for enhanced user experience 2025-07-30 19:37:40 +02:00
Carlos Santos 413dec3e0f ov-components: Close connection dialog on room disconnection event 2025-07-30 12:38:09 +02:00
Carlos Santos 414c26c31b ov-components: Enhance recording status messages with improved styling and structure for starting and stopping states 2025-07-30 12:26:19 +02:00
Carlos Santos fce026766b ov-components: Enhance recording activity component: update view recordings button visibility based on recording status and improve toolbar button text for active recording state 2025-07-29 19:10:35 +02:00
Carlos Santos fe3f90d266 ov-components: Implement error handling for recording start failures and enhance UI interactions 2025-07-29 18:19:16 +02:00
Carlos Santos 5f6b404576 ov-components: Enhance error handling UI in recording activity component with modern styling 2025-07-29 17:50:15 +02:00
Carlos Santos 9b8348bc04 ov-components: Enhance recording activity component with improved status handling and styling 2025-07-29 17:35:28 +02:00
Carlos Santos 1403d062e9 ov-components: Fixed wrong initialize value in show recordings directive 2025-07-29 15:50:31 +02:00
Carlos Santos 7bf0e0036c ov-components: optimize participant name subscription with filter and tap operators 2025-07-29 15:46:05 +02:00
Carlos Santos 76c957903f ov-components: Refactors config service to use RxJS Subjects
Updates the configuration service to use RxJS BehaviorSubjects and Observables for managing configuration values.

This change improves the reactivity and maintainability of the configuration system by providing a consistent and type-safe way to manage application settings.

Specifically, it introduces a helper method to create configuration items with BehaviorSubject and Observable, and uses distinctUntilChanged and shareReplay operators to optimize the observable streams.

ov-components: Refactor configuration management in OpenVidu components

- Updated directive methods to use centralized configuration updates for general, stream, and toolbar settings.
- Replaced individual setter methods with batch update methods for improved performance and maintainability.
- Introduced specific comparison methods for configuration objects to optimize change detection.
- Enhanced the structure of configuration interfaces for better clarity and organization.
- Removed redundant code and streamlined the configuration service for better readability.

ov-components: Enhance participant name handling in PreJoin and Videoconference components
2025-07-29 14:05:14 +02:00
Carlos Santos 68ea8001f1 ci: Update Selenium Chrome version to 138.0 and add internal directives tests workflow 2025-07-29 11:42:56 +02:00
Carlos Santos 5a249fc3e1 ov-components: Add internal directives tests and update related components for recording functionality 2025-07-29 11:38:46 +02:00
Carlos Santos 9bac0f6490 ov-components: Add directive to control visibility of recording list and update related services and components 2025-07-29 10:47:22 +02:00
Carlos Santos fa664c97f1 ov-components: Add view recordings button functionality and related directives 2025-07-29 10:26:25 +02:00
Carlos Santos 8e218ade3c ov-components: Add start/stop recording button directive and update related components 2025-07-28 18:51:20 +02:00
Carlos Santos 22af5c7df6 ov-components: Implement centralized template management for videoconference components 2025-07-22 19:24:07 +02:00
Carlos Santos 04b8b741e2 ov-components: Refactor videoconference component to use centralized state management 2025-07-22 18:17:57 +02:00
Carlos Santos 8af9f75a10 ov-components: Prevent prejoin from showing again after user initiates join process 2025-07-22 17:45:03 +02:00
Carlos Santos fabeaf1471 ov-components: Add ID to external view recording buttons for better accessibility 2025-07-22 17:05:33 +02:00
Carlos Santos 1ffd7ea9d6 ov-components: Fixed bug showing prejoin
- Rename joinSession method to join and update related calls for consistency
refactor
- Change isPrejoin method to showPrejoin in directive config service
2025-07-22 16:23:33 +02:00
cruizba 3af490522e openvidu-deployment: Change DefaultApp string literals to Meet in templates. 2025-07-22 14:08:25 +02:00
cruizba 0280b64084 openvidu-deployment: Azure HA - Replace Default App (OpenVidu Call) with OpenVidu Meet 2025-07-22 14:00:56 +02:00
cruizba 83aad06574 openvidu-deployment: Azure HA - Fix port priority rules. 2025-07-22 13:52:54 +02:00
cruizba 892c6efed2 openvidu-deployment: Azure Elastic - Fix port priority rules. 2025-07-21 21:21:04 +02:00
cruizba 5b888aafc0 openvidu-deployment: Build azure bicep of Elastic. 2025-07-21 21:02:53 +02:00
cruizba d918e8059a openvidu-deployment: Azure Elastic - Replace Default App (OpenVidu Call) with OpenVidu Meet 2025-07-21 21:00:23 +02:00
Carlos Santos 82ddca6b50 ov-components: Add IDs to action buttons in recording activity component for improved accessibility 2025-07-21 17:36:11 +02:00
Carlos Santos 6fb7d9583c ov-components: Enhance recording activity UI with additional status indicators and style adjustments 2025-07-21 17:03:22 +02:00
Carlos Santos 181c5f0789 ov-components: Improves recording activity UI
Refactors the recording activity component's template and styles
to use cards for displaying recording information.

Enhances the display of recording metadata, including duration,
size, and date, with appropriate icons.

Adds visual cues for active recordings and improves overall
responsiveness of the recording list.
2025-07-21 14:12:28 +02:00
Carlos Santos e486665efd ov-components: Updated recording activity component 2025-07-21 14:11:40 +02:00
Carlos Santos b659400c88 ov-components: implement read-only mode and customizable controls for recording activity 2025-07-21 14:11:40 +02:00
cruizba 98c7e3f751 openvidu-deployment: Build azure bicep of Single Node - PRO 2025-07-20 22:56:50 +02:00
cruizba 5e1df8b511 openvidu-deployment: Fix wrong environment variable in Azure Single Node - PRO 2025-07-20 22:42:23 +02:00
cruizba 16ec1f3920 openvidu-deployment: Replace Default App (OpenVidu Call) with OpenVidu Meet in Single Node Pro 2025-07-20 22:23:19 +02:00
cruizba b01e8f4d23 openvidu-deployment: update enabled modules to include openviduMeet in deployment script 2025-07-20 20:59:56 +02:00
cruizba 2413a0bb6d openvidu-deployment: Generate json from bicep Single Node - Community 2025-07-20 20:12:10 +02:00
cruizba bf6091e997 openvidu-deployment: Replace Default App (OpenVidu Call) with OpenVidu Meet in Single Node - Community 2025-07-20 20:10:25 +02:00
cruizba 9e0034dfac openvidu-deployment: Replace Default App (OpenVidu Call) with OpenVidu Meet 2025-07-18 21:53:32 +02:00
Carlos Santos 637142cec6 ov-components: add room initialization checks and error handling in SessionComponent 2025-07-17 17:03:18 +02:00
Carlos Santos c304c9c761 ov-components: add PreJoin directive to support custom pre-join templates in VideoconferenceComponent 2025-07-17 16:53:17 +02:00
Carlos Santos 4dd007395f ov-components: Refactor components to use takeUntil for unsubscribing from observables
- Replaced manual subscription management with takeUntil pattern
- Introduced a destroy$ Subject in each component to handle unsubscriptions on component destruction.
- Improved memory management and code readability by eliminating multiple subscription variables.
2025-07-17 15:44:37 +02:00
Carlos Santos 7573656060 ov-components: refactor VideoconferenceComponent to improve template setup and icon management 2025-07-17 14:00:51 +02:00
Carlos Santos 8407363aaf ov-components: add track subscription and manage room tracks published state 2025-07-17 13:29:17 +02:00
Carlos Santos 55fd64c254 ov-components: enhance recording functionality with track checks and UI updates 2025-07-17 13:29:17 +02:00
cruizba d151834048 openvidu-deployment: Replace OPENVIDU_CALL_SERVER_IMAGE with OPENVIDU_MEET_SERVER_IMAGE in deployment scripts 2025-07-16 12:36:15 +02:00
pabloFuente ce47224400 openvidu-testapp: make update interval for dialog optional 2025-07-14 22:18:12 +02:00
cruizba 61fbf9850b Add TCP port rules for WebRTC traffic on port 7881 and 50000-60000 across multiple deployment configurations 2025-07-11 21:33:05 +02:00
Piwccle ba1df4660c openvidu-testapp: RTCIceCandidate stats for publisher and subscriber peer connections fixed in firefox 2025-07-10 16:12:08 +02:00
pabloFuente d44e24592d openvidu-testapp: RTCIceCandidate stats for publisher and subscriber peer connections 2025-07-09 18:24:00 +02:00
Carlos Santos 91aa127dad ov-components: replace and improve recordingElapsedTime logic 2025-07-04 17:51:30 +02:00
Carlos Santos 1be876678c ov-components: add subscription for virtual background effects management 2025-07-04 15:55:22 +02:00
Carlos Santos 388981be31 ov-components: reorder imports and add ShowDisconnectionDialogDirective to ApiDirectiveModule 2025-07-04 12:51:57 +02:00
Carlos Santos 6497751375 ov-component: add showDisconnectionDialog directive and update service for disconnection dialog management 2025-07-04 12:45:34 +02:00
pabloFuente 5f0639c157 openvidu-test-e2e: adapted egress test to tolerate mediasoup limitation 2025-07-03 14:23:10 +02:00
pabloFuente e435a1a937 openvidu-test-e2e: fix signalTest 2025-07-02 21:53:45 +02:00
pabloFuente 932eda8115 openvidu-test-e2e: include event RoomEvent.ParticipantActive 2025-07-02 18:35:44 +02:00
pabloFuente 5d91f4d343 openvidu-testapp: add RoomEvent.ParticipantActive 2025-07-02 18:14:45 +02:00
pabloFuente 703698b25f openvidu-components-angular: fix comment links 2025-07-02 18:14:07 +02:00
pabloFuente b884e924b6 openvidu-test-e2e: added Egress tests 2025-06-30 14:34:37 +02:00
pabloFuente ee8847c5cb openvidu-testapp: add checkbox to force relay from browser 2025-06-30 12:11:09 +02:00
GitHub Actions 99c787c4f5 Revert "Bump version to 3.3.0"
This reverts commit 2083c078fd.
2025-06-26 20:02:58 +00:00
GitHub Actions 2083c078fd Bump version to 3.3.0 2025-06-26 20:02:55 +00:00
github-actions bc42a72836 openvidu-components-angular: Bumped version to 3.3.0 2025-06-26 18:43:30 +00:00
cruizba c3b7c6f4bb openvidu-deployment: Shutdown gracefully agents in aws and azure. 2025-06-25 19:03:10 +02:00
pabloFuente b913dbb3b8 openvidu-testapp: updated dependencies 2025-06-25 13:26:42 +02:00
pabloFuente f16eefa9df openvidu-testapp: differ between final and non-final transcription events 2025-06-25 13:26:28 +02:00
pabloFuente 96132553ae openvidu-testapp: add lk.transcription handler 2025-06-24 17:26:38 +02:00
Carlos Santos 709779b7fd ov-components: Remove debugger statement from setRecordingStarted method in RecordingService 2025-06-24 16:18:18 +02:00
cruizba 11ac3d32eb openvidu-deployment: Fix wrong image 2025-06-24 11:34:54 +02:00
cruizba c8bbcfed56 openvidu-deployment: Add OPENVIDU_AGENT_SPEECH_PROCESSING_IMAGE environment variable to installation scripts 2025-06-24 11:33:21 +02:00
Piwccle 76a6f6c301 openvidu-deployment: azure - Add support for additional install flags in all the deployments 2025-06-18 16:26:50 +02:00
Carlos Santos 2de2920acf ov-components: Add check for existing Material Icons link in VideoconferenceComponent 2025-06-18 10:12:39 +02:00
cruizba fd8be9f23f openvidu-deployment: - AWS HA - Add experimental TURN TLS 2025-06-14 02:02:29 +02:00
cruizba e66e5a23e1 openvidu-deployment: - HA - Open port 5349 in media nodes for master nodes if Turn Domain is not configured 2025-06-13 22:02:13 +02:00
cruizba 335fd8e3c3 Remove unnecessary condition for SecurityGroupIngress in CloudFormation templates 2025-06-13 21:37:39 +02:00
cruizba 237ebe1d59 openvidu-deployment: Add "Additional Installer Flag" 2025-06-13 19:20:25 +02:00
cruizba 5e5e404d7d openvidu-deployment: Remove non official Cloudformation 2025-06-13 19:20:25 +02:00
Carlos Santos 16e869c5da ov-components: update API directive documentation 2025-06-11 12:50:08 +02:00
Carlos Santos c628b2ab68 ov-components: enhance directive table generation logic and improve error handling 2025-06-11 12:49:41 +02:00
Carlos Santos b7d9f822de ov-components: apply background from storage based on background effects button status 2025-06-10 17:28:00 +02:00
Piwccle fe606cbf15 openvidu-deployment: azure - added cluster data container for caddy and observability info 2025-06-10 16:30:41 +02:00
Piwccle 7c71f41d95 openvidu-deployment: azure - removed one '}' that was making TURN HA fail 2025-06-10 12:48:12 +02:00
Piwccle 9728d966ad openvidu-deployment: azure - bugfix: added dependsOn to remove possible race condition 2025-06-10 12:17:10 +02:00
Piwccle ce610cab03 openvidu-deployment: azure - removed parameter from HA CUID 2025-06-10 11:46:42 +02:00
Piwccle d8f14c6905 openvidu-deployment: azure - changes to let TURN work in HA deployment 2025-06-10 11:34:57 +02:00
Piwccle bdf4f07a28 openvidu-deployment: azure - removed one line of the install script that was there to try the new delete_media_node 2025-06-10 11:08:55 +02:00
Piwccle 206a51baf7 openvidu-deployment: azure - added scripts to delete media node if fails 2025-06-10 10:56:50 +02:00
Carlos Santos 94b51b9971 ov-components: Update language files to replace "session" with "room" for consistency across translations 2025-06-09 11:21:35 +02:00
github-actions 8984cfdcad openvidu-components-angular: Bumped version to 3.2.1 2025-06-05 11:01:42 +00:00
Carlos Santos 022d18578e ov-components: Remove unnecessary mat-line directive from settings panel options 2025-06-05 12:49:53 +02:00
GitHub Actions 9beb8b435a Revert "Bump version to 3.2.0"
This reverts commit 26b790bfd8.
2025-06-04 15:01:06 +00:00
GitHub Actions 26b790bfd8 Bump version to 3.2.0 2025-06-04 15:01:02 +00:00
github-actions 308315dee4 openvidu-components-angular: Bumped version to 3.2.0 2025-06-04 14:50:58 +00:00
cruizba 5fac396487 Update submodule openvidu-livekit for 3.2.0 2025-06-04 16:34:41 +02:00
Piwccle 99e36178a5 openvidu-deployment: builded .bicep 2025-06-04 13:29:32 +02:00
Piwccle 8999076291 openvidu-deployment: azure - HA fixed turn 2025-06-04 13:29:32 +02:00
cruizba 220c6d7d4a openvidu-deployment: Bump Redis server image version to 7.4.4. 2025-06-02 20:41:24 +02:00
cruizba f989dc26d2 openvidu-deployment: Force minimum docker and docker-compose version in update script. 2025-06-02 17:54:33 +02:00
cruizba 3107d504ce openvidu-deployment: Force minimum docker and docker-compose version. 2025-06-02 17:47:46 +02:00
cruizba b8c0bb3283 openvidu-deployment: azure - update signal for stopping media node services to SIGQUIT 2025-06-02 17:00:49 +02:00
Piwccle 4aa8739ee8 openvidu-deployment: compiled all .bicep and fixed roles 2025-05-29 17:43:37 +02:00
Piwccle bcfcfdd704 openvidu-deployment: added roles in HA to configure blob storage 2025-05-29 17:40:53 +02:00
Piwccle a59872c9e9 openvidu-deployment: fixed common arguments for openvidu single node pro 2025-05-29 17:33:37 +02:00
Piwccle cbf4bafa36 openvidu-deployment: added more validation in CUID 2025-05-29 17:21:47 +02:00
Piwccle 95584d7437 openvidu-deployment: CUID for azure deployments modified to work better 2025-05-29 17:17:59 +02:00
cruizba 20e348ed60 Revert redis to 7.4.3-alpine 2025-05-29 17:11:18 +02:00
Piwccle fbcc460f10 openvidu-deployment: fixed ha config_blobstorage in all master nodes 2025-05-29 16:51:59 +02:00
Piwccle e7e1a39e05 openvidu-deployment: added Openvidu Single Node PRO and added v2compatibility modules in HA and Elastic deployments 2025-05-29 15:58:41 +02:00
pabloFuente 18fd65350c openvidu-integration-tests: update start-openvidu-local-deployment action 2025-05-29 14:43:41 +02:00
cruizba 1551bf8244 openvidu-deployment: Bump docker image versions for 3.2.0 2025-05-28 23:39:14 +02:00
pabloFuente 882f9405db openvidu-test-e2e: put RTSP container in network mode host 2025-05-28 12:51:37 +02:00
Piwccle af3608c81c openvidu-deployment: azure - added optional automationAccountName 2025-05-27 11:18:05 +02:00
Carlos Santos 395d0c3ade ov-components: fix name getter in ParticipantModel to return participant's name 2025-05-26 19:09:19 +02:00
Carlos Santos f0bcb3ac03 ov-components:remove unnecessary screenshot logging in API directive tests 2025-05-26 18:38:25 +02:00
Carlos Santos 3579b9dc6a ov-components: update URL handling in API directive tests and improve error logging in leaveRoom method 2025-05-26 18:31:51 +02:00
Carlos Santos dbb45eaffd ov-components: improve leaveRoom method by adding fallback navigation on error 2025-05-26 18:24:14 +02:00
Carlos Santos fc7d7fef5a ov-components: replace fit with it for consistency in API directive tests 2025-05-26 17:52:55 +02:00
Carlos Santos 3f234276ee ov-components: enhance leaveRoom method with error handling and verification steps 2025-05-26 17:46:54 +02:00
GitHub Actions b10bc5f8c6 Revert "Bump version to 3.2.0-dev1"
This reverts commit a9e727fd51.
2025-05-26 14:34:37 +00:00
GitHub Actions a9e727fd51 Bump version to 3.2.0-dev1 2025-05-26 14:34:34 +00:00
cruizba c9b350eddc openvidu-deployment: Add single node PRO. Update,sh changes 2025-05-26 13:39:18 +02:00
Carlos Santos 21c297c73b ov-components: ensure room is left after each test in attribute and event directives 2025-05-26 10:33:17 +02:00
Carlos Santos 7df7b31d97 ov-components: add screenshot logging and delay in API directives tests 2025-05-23 18:13:35 +02:00
Carlos Santos d8d4870eb7 ov-components: add screenshot logging for video presence check 2025-05-23 17:18:02 +02:00
Carlos Santos aa15e8b713 ov-components: add delay before checking session presence in audio disabled test 2025-05-23 15:48:15 +02:00
Carlos Santos 621df40a7f ci: update cleanup action references in workflows to use official OpenVidu action 2025-05-23 15:37:13 +02:00
Carlos Santos 147f7078a0 ci: update action for building and serving openvidu-components-angular Testapp to use the latest version 2025-05-23 15:19:48 +02:00
Carlos Santos 55a67f191a ci: replace custom action for building and serving openvidu-components-angular Testapp with official OpenVidu action 2025-05-23 15:17:50 +02:00
Piwccle 31587d7181 openvidu-deployment: azure - added 2 'none' values missing in HA .bicep 2025-05-23 14:32:27 +02:00
Carlos Santos d0f714a5e2 ci: replace setup action for OpenVidu Call Backend with official action 2025-05-23 13:58:20 +02:00
Carlos Santos e4ed447009 ci: remove setup action for OpenVidu local deployment 2025-05-23 13:58:20 +02:00
Piwccle 57ea002953 openvidu-deployment: azure - compiled all new .bicep 2025-05-23 13:53:24 +02:00
Carlos Santos 1b5a230132 ci: uses OpenVidu local deployment action in integration tests 2025-05-23 13:29:06 +02:00
Carlos Santos 7348402364 ci: update openvidu-local-deployment action to use the official OpenVidu action 2025-05-23 13:27:22 +02:00
Piwccle 915a4598b1 openvidu-deployment: azure - CUID for elastic and ha deployments and adjustments to those .bicep to support the new CUID 2025-05-23 13:19:59 +02:00
Carlos Santos 0b017b2abb ci: update workflow to use OpenVidu action for local deployment setup 2025-05-23 12:55:36 +02:00
Carlos Santos c12dbf247c ov-components: refactor participant left and room disconnected handling to use a common disconnect method 2025-05-23 12:02:29 +02:00
pabloFuente f087c172fc openvidu-testapp: remove bold font weight from buttons 2025-05-23 11:49:25 +02:00
pabloFuente fe3e99e4e1 Find out RTSP container IP instead of using host.docker.internal 2025-05-23 11:49:25 +02:00
Carlos Santos 442b99771a ov-components: enhance error handling and add screenshot capture during room leave process 2025-05-23 11:41:56 +02:00
Carlos Santos 5f9fb06c2a ov-components: add error logging and screenshot capture on room leave failure 2025-05-23 11:35:21 +02:00
Carlos Santos dfae82d4cf ov-components: add event handling for participant left and update config state 2025-05-23 11:24:45 +02:00
Carlos Santos 549a822491 ov-components: rename redirectOnLeaves to redirectToHomeOnLeaves for clarity and update related logic 2025-05-23 11:09:07 +02:00
Carlos Santos b6f242107e ov-components: adjust max-width and padding for prejoin card styling 2025-05-22 13:29:16 +02:00
Carlos Santos 9023f03cee ov-components: center progress spinner in loading container 2025-05-22 13:26:11 +02:00
Carlos Santos 500b19d1b9 Revert "ov-components: change runner for API Directives and Events E2E tests to ov-actions-runner"
This reverts commit c275381cfd.
2025-05-22 13:06:59 +02:00
Carlos Santos 421c5ea29c ov-components: add participant left event handling and navigation in testapp 2025-05-22 12:47:13 +02:00
Carlos Santos cea8ce0def ov-components: update test descriptions for structural directives to improve clarity and consistency 2025-05-22 12:46:45 +02:00
Carlos Santos daf1349e75 ov-components: fixed panel toggle logic for external panels. Fixes #854
refactor togglePanel method for improved state management and clarity
2025-05-22 12:44:06 +02:00
Carlos Santos ffbc1f5e5d ov-components: update toolbar additional panel button count in tests and template 2025-05-22 12:42:26 +02:00
pabloFuente a02e23763a openvidu-testapp: updated all dependencies 2025-05-22 12:11:38 +02:00
Carlos Santos c275381cfd ov-components: change runner for API Directives and Events E2E tests to ov-actions-runner 2025-05-22 10:54:56 +02:00
Carlos Santos 34eb27dfe3 ov-components: update onRoomDisconnected event to reference onParticipantLeft for deprecation notice 2025-05-21 16:02:52 +02:00
Carlos Santos d3702ab6ac ov-components: update audio path for CI mode in Selenium configuration 2025-05-21 14:23:05 +02:00
Carlos Santos dafba8cdee ov-components: update audio capture path to use dynamic variable based on launch mode 2025-05-21 13:46:12 +02:00
Carlos Santos 995ce8c00b ov-components: add autoplay policy and file access arguments for CI chrome configuration 2025-05-21 13:45:04 +02:00
Carlos Santos 1e15fea5e4 ov-components: enable Toolbar E2E tests by removing conditional check 2025-05-21 13:33:12 +02:00
Carlos Santos 3139437bfe ov-components: remove OpenviduWebComponent and related files 2025-05-21 13:31:26 +02:00
Carlos Santos 59112b79fa ov-components: add initial E2E tests for captions functionality 2025-05-21 13:31:18 +02:00
Carlos Santos fd486270b9 ov-components: update audio capture file in E2E tests and remove unnecessary entry from .gitignore 2025-05-21 13:24:08 +02:00
Carlos Santos 042f9b5a89 ov-components: add E2E tests for toolbar 2025-05-21 13:22:29 +02:00
Carlos Santos 28e96647fa ci: Added stream tests 2025-05-21 13:15:30 +02:00
Carlos Santos 35eacb45a1 ov-components: update E2E tests for stream functionality and adjust audio capture file 2025-05-21 13:13:56 +02:00
Carlos Santos c42108bd22 ov-components: enable Panels E2E test by removing conditional check 2025-05-21 12:45:48 +02:00
Carlos Santos 63588148a7 ci: update screen sharing test command 2025-05-21 12:43:13 +02:00
Carlos Santos 52d253a1db ov-components: add E2E tests for screensharing features 2025-05-21 12:41:34 +02:00
Carlos Santos bf7d83134a ov-components: add panels E2E test suite 2025-05-21 12:11:01 +02:00
Carlos Santos 77bba7e587 ov-components: uncomment screen track replacement test 2025-05-21 12:06:36 +02:00
Carlos Santos fb999df526 ov-components: comment out headless mode in chrome arguments for local testing 2025-05-21 11:55:44 +02:00
Carlos Santos 314a3d1898 ov-components: change fit to it for video disabled prejoin page test 2025-05-21 11:55:31 +02:00
Carlos Santos 35f1085870 ov-components: remove obsolete events E2E tests 2025-05-21 11:55:10 +02:00
Carlos Santos cfdaabfc0b ov-components: remove unit tests and update media devices E2E tests 2025-05-21 11:54:36 +02:00
Carlos Santos 146aeed893 ov-components: assign participant name to observable on ready to join 2025-05-21 11:07:57 +02:00
Carlos Santos 02b594e405 ov-components: Added events e2e tests 2025-05-20 18:55:03 +02:00
Piwccle bd3504b818 openvidu-deployment: azure - fixed one thing left to be able to try the new .bicep 2025-05-20 18:49:39 +02:00
Piwccle 743b05911c openvidu-deployment: azure - fixing .bicep file to work with the new CUID 2025-05-20 18:46:31 +02:00
Piwccle 1b2af77196 openvidu-deployment: azure - CUID for Single Node Deployment ready 2025-05-20 18:29:22 +02:00
Carlos Santos 1f13b11f88 ov-components: enable Chat E2E tests in workflow 2025-05-20 17:38:44 +02:00
Carlos Santos 1cba6761bb ov-components: update E2E test names and add chat feature tests 2025-05-20 17:38:06 +02:00
Carlos Santos 920bba1bf3 ov-components: update test to focus on VIDEO DISABLED scenario in prejoin page 2025-05-20 17:33:09 +02:00
Piwccle 1d3cba9517 openvidu-deployment: azure - fixing SSH key parameter in Single Node CUID 2025-05-20 17:15:47 +02:00
Carlos Santos 331a102a19 ov-components: add end-to-end tests for structural directives in OpenVidu Components 2025-05-20 16:56:19 +02:00
Carlos Santos 6fe461dc0c ov-components: refactor workflow jobs for clarity and organization 2025-05-20 16:51:23 +02:00
Carlos Santos baf3da51c2 ov-components: add end-to-end tests for attribute and structural directives 2025-05-20 16:51:23 +02:00
Carlos Santos 48084544ba ov-components: remove debug console logs for query parameters and participant name in testapp 2025-05-20 16:51:23 +02:00
Piwccle 6a02f96af2 openvidu-deployment: azure - added UI definition to Single Node 2025-05-20 13:58:37 +02:00
Carlos Santos 3c72bc6c4d ov-components: update disconnect logic to handle client-initiated events in OpenViduService 2025-05-20 13:17:00 +02:00
Carlos Santos 3027ab6c5b ov-components: update parameter name for audio detection display in testapp 2025-05-20 12:51:19 +02:00
Carlos Santos ffc6bb4c41 ov-components: streamline E2E test setup by removing redundant steps and renaming jobs 2025-05-20 12:44:02 +02:00
Carlos Santos 5df42d5344 ov-components: refactor participant name retrieval logic in VideoconferenceComponent 2025-05-20 12:40:22 +02:00
Carlos Santos 4ad8c52c38 ov-components: enhance testapp with dynamic configuration options 2025-05-20 12:40:04 +02:00
Carlos Santos 741954ac2b OV-COMPONENTS: upgrade chromedriver to 136.0.2 and selenium-webdriver to 4.32.0 2025-05-20 12:39:19 +02:00
Carlos Santos 75d6576603 ov-components: add end-to-end tests for API directives and implement leaveRoom utility function 2025-05-20 12:38:20 +02:00
Carlos Santos 8a9e9e0d27 ov-components: fixed race condition with onTokenRequested event and participantName 2025-05-19 19:10:40 +02:00
Carlos Santos 1065f32a3a ov-components: add action for building and serving openvidu-components-angular Testapp 2025-05-19 18:08:49 +02:00
Carlos Santos 223c7473e5 ov-components: add setup action for OpenVidu Call Backend in workflows 2025-05-19 18:03:26 +02:00
Carlos Santos f951eddfe5 ov-components: add cleanup action to workflows for better resource management 2025-05-19 17:55:09 +02:00
Carlos Santos 8dfb513bb0 ov-components: add setup action for local deployment and streamline workflow steps 2025-05-19 17:52:29 +02:00
Carlos Santos ab7a453507 ov-components: remove unused active button styles and clean up SCSS variables 2025-05-19 17:08:50 +02:00
Carlos Santos 5b112286d9 ov-components: add material symbols support and improve toolbar symbols handling 2025-05-19 16:59:24 +02:00
Carlos Santos c4c5fb9866 ov-components: improve logging for participant disconnection event 2025-05-14 17:50:49 +02:00
Carlos Santos bd711b57f3 ov-components: simplify disconnect logic by removing callback. The participantLeft event will be fired by LK event handler 2025-05-14 13:48:53 +02:00
Piwccle 94f2e3e573 openvidu-deployment: azure - changed one description of a param to clarify the use of the param 2025-05-13 14:36:12 +02:00
Piwccle b7a94f4b03 openvidu-deployment: azure - compiled .bicep into .json 2025-05-13 11:59:15 +02:00
Piwccle 21b94bc4fd Merge branch 'master' of https://github.com/OpenVidu/openvidu 2025-05-13 11:55:40 +02:00
Carlos Santos 745e04baa6 ov-components: enhance recording URL handling for backward compatibility 2025-05-13 11:35:04 +02:00
Carlos Santos 4b611893e9 ov-components: enhance recording URL handling for backward compatibility 2025-05-13 11:14:40 +02:00
Piwccle b8fc003a4c openvidu-deployment: azure - added existing storage account support in CE, Elastic and HA deployments 2025-05-13 11:01:22 +02:00
Carlos Santos ed579b4e72 ov-components: update recording stream URL to use '/media' segment instead of '/stream' 2025-05-12 16:00:42 +02:00
Carlos Santos d8ce736cc0 ov-components: improve disconnect handling and manage client-initiated disconnect events 2025-05-12 13:39:45 +02:00
Carlos Santos cb8f11449f ov-components: add UNKNOWN_DISCONNECT message for various languages and handle participant disconnection reason 2025-05-06 15:43:56 +02:00
Piwccle efb691f481 openvidu-deployment: added config script of azure blob storage in elastic deployment and added a rol assignment in CE needed 2025-05-06 09:03:55 +02:00
Carlos Santos a8c2459d5f ov-components: implement OnPush change detection strategy and optimize change detection calls in prejoin component 2025-05-05 14:35:51 +02:00
Carlos Santos 0074b28d3a ov-components: Fix available langs for allowing custom ones 2025-05-05 13:52:10 +02:00
Carlos Santos 760cf604eb ov-components: update package dependencies and TypeScript configurations
- Added @types/dom-mediacapture-transform to package.json for type definitions.
- Changed hoveringTimeout type in StreamComponent to ReturnType<typeof setTimeout> for better type safety.
- Updated TypeScript lib version from ES2020 to ES2021 in tsconfig files for improved features.
- Included dom-mediacapture-transform in types for TypeScript configurations across various tsconfig files.
- Removed empty types array in tsconfig.app.json to ensure proper type checking.
- Adjusted skipLibCheck settings in tsconfig files to improve compatibility with Livekit track processors.
2025-05-05 12:15:16 +02:00
Carlos Santos 8ce155df6a ov-components: enhance recording status management and elapsed time calculation 2025-04-30 19:18:29 +02:00
Carlos Santos cff617b0c3 ov-components: disable webcomponent E2E tests 2025-04-30 18:12:36 +02:00
Carlos Santos 127fbbd4e1 ov-components: update build process and module definition for improved structure 2025-04-30 17:58:11 +02:00
Carlos Santos 3adfa91c54 fix(tsconfig): add skipLibCheck comment for Livekit track processors 2025-04-30 15:22:18 +02:00
Carlos Santos 7f00318cbb ov-components: update dependencies and TypeScript configuration
- Updated @livekit/track-processors from 0.3.2 to ^0.5.6
- Updated livekit-client from 2.5.2 to 2.11.4
- Changed TypeScript lib option from "dom" to "DOM" in tsconfig.lib.json
- Added skipLibCheck option in tsconfig.lib.json and tsconfig.base.json
- Updated TypeScript lib option from "dom" to "dom" in tsconfig.base.json
2025-04-30 14:57:47 +02:00
Carlos Santos 5433f516a9 ov-components: remove redundant background processor removal logic in virtual background service 2025-04-30 14:54:26 +02:00
Carlos Santos 81fcae2d4e ov-components: enhance virtual background service updating the switching logic for improving performance 2025-04-30 14:38:43 +02:00
Carlos Santos 0c1e1a7134 ov-components: Updated to Angular 19 2025-04-30 14:37:10 +02:00
Carlos Santos 518e1511d2 ov-components: add participant left handling and update room disconnection logic 2025-04-30 12:13:03 +02:00
Carlos Santos b92630ecd8 ov-components: enhance participant disconnection handling with reasons and refactor disconnect logic 2025-04-30 12:13:03 +02:00
Carlos Santos 11137a2a8f ov-components: add disconnect and error messages for various scenarios in multiple language files 2025-04-30 12:13:03 +02:00
Piwccle 9310ff3ea1 openvidu-deployment: azure - added blob storage resources and modified CE to support config blobStorage 2025-04-23 13:26:33 +02:00
Piwccle 37428c91b6 openvidu-deployment: azure - changed links that references de runbook 2025-04-22 12:06:04 +02:00
cruizba 9e04d59b61 Add openvidu-deployment scripts 2025-04-22 11:46:24 +02:00
Micael Gallego c1f2971881
Fix NewGenVidu project logo in README.md 2025-03-24 19:49:32 +01:00
Carlos Santos 8c28228357 ov-components: update default recording stream URL in directives and config service 2025-03-23 14:25:35 +01:00
Carlos Santos 90fd0ef44e ov-components: add recordingStreamBaseUrl directive and integrate with config service for dynamic stream URL construction 2025-03-14 19:08:34 +01:00
Carlos Santos 6137bdbbbc ov-components: add null check for participant name updates in pre-join component and participant name directive 2025-03-12 19:03:14 +01:00
Carlos Santos 2acf636842 ov-components: reduce max-width of pre-join component to improve layout 2025-03-12 18:41:42 +01:00
Carlos Santos 0ad51d6c58 ov-components: remove max-height constraint from pre-join component styles 2025-03-12 18:28:53 +01:00
Carlos Santos 6f97b9d8c2 ov-components: move loading state update to ngAfterContentChecked lifecycle hook 2025-03-12 18:28:47 +01:00
Carlos Santos a64cf1d577 ov-components: enhance pre-join component layout and add participant name visibility check 2025-03-12 18:05:37 +01:00
Carlos Santos e373d23cc9 ov-components: add participant name visibility control to pre-join component 2025-03-12 17:19:55 +01:00
Carlos Santos 72888e4ea9 ov-components: add camera and microphone button visibility controls in the E2E tests 2025-03-10 10:27:44 +01:00
Carlos Santos 2bf212ccfe ov-components: add camera and microphone button visibility controls in toolbar and settings panel 2025-03-10 10:11:38 +01:00
Carlos Santos 5fba250b1d ov-components: remove ServiceConfigService and update components to use LayoutService directly 2025-03-08 17:42:43 +01:00
Carlos Santos 7315360fbc ov-components: add onParticipantLeft event and disconnect callback to notify when local participant leaves 2025-03-07 19:25:27 +01:00
Carlos Santos d965e72822 ov-components: add OpenViduComponentsUiModule with component and pipe declarations 2025-03-07 18:52:12 +01:00
Carlos Santos 288a585809 ov-components: rename participantId to participantName in ParticipantLeftEvent and update disconnect method 2025-03-07 13:52:43 +01:00
Carlos Santos 272eb9002c ov-components: rename participant created event to participant connected and update documentation 2025-03-07 13:42:50 +01:00
Carlos Santos dee470609c ov-components: clarify event documentation for local participant actions 2025-03-07 13:36:10 +01:00
Carlos Santos ad8f368a91 ov-components: enhance documentation for room and participant events 2025-03-07 13:30:26 +01:00
Carlos Santos 5d855a1338 ov-components: log room name when a room is created 2025-03-07 13:04:22 +01:00
Carlos Santos 3defad20cc ov-components: emit room created event after participant connection 2025-03-07 13:04:06 +01:00
Carlos Santos 9b4f330c4a ov-components: clarify method documentation for local participant connection 2025-03-06 13:45:02 +01:00
pabloFuente 7d10ec6097 openvidu-testapp: fix webpack builder with custom configuration 2025-02-19 12:38:57 +01:00
pabloFuente 8d443ac506 openvidu-testapp: update rest of dependencies 2025-02-19 12:13:37 +01:00
pabloFuente 1521a766e5 openvidu-testapp: update minor upgrade change 2025-02-19 12:09:43 +01:00
pabloFuente a1edded5df openvidu-testapp: update to Angular Material 19 2025-02-19 12:04:21 +01:00
pabloFuente fa507d492f openvidu-testapp: update to Angular 19 2025-02-19 12:03:43 +01:00
pabloFuente 0ae67e8a87 openvidu-testapp: update Angular Material 18 2025-02-19 12:01:54 +01:00
pabloFuente 051b14c5b2 openvidu-testapp: update to Angular 18 2025-02-19 11:48:56 +01:00
pabloFuente f610f37ac3 openvidu-testapp: update pollyfils.ts 2025-02-19 11:47:11 +01:00
pabloFuente 501881c602 openvidu-testapp: update to Angular Material 17 2025-02-19 11:42:14 +01:00
pabloFuente ea8f0e2101 Upgrade to Angular 17 2025-02-19 11:41:31 +01:00
github-actions d3520e9098 openvidu-components-angular: Bumped version to 3.1.0 2025-02-17 14:42:29 +00:00
cruizba b29b9102a9 update openvidu-livekit subproject to latest commit 2025-02-17 15:23:37 +01:00
Carlos Santos 64fbaa2a42 ov-components: Fixed nested event test 2025-02-13 12:43:22 +01:00
Carlos Santos 4c4380a87f ov-components e2e: Added participantLeft listener 2025-02-13 12:33:04 +01:00
Carlos Santos d8452c42ad ov-components: Fired room and participantLeft events 2025-02-13 12:31:50 +01:00
cruizba 09ba39642e openvidu-test-e2e: Disable flaky audio ingress tests for RTSP 2025-02-11 13:35:20 +01:00
pabloFuente 11c6f2f965 openvidu-testapp: remove unused imports 2025-02-11 12:47:02 +01:00
cruizba 9a01c0e179 openvidu-test-e2e: Fix file URL selection logic for lossless video encoding 2025-02-11 12:33:44 +01:00
cruizba 06fc88f2b0 openvidu-test-e2e: Add lossless flag to getFileUrl method 2025-02-11 12:30:56 +01:00
cruizba f19a9129ba openvidu-test-e2e: Improve CPU performance by using losless codec ffv1 and flac. Fix some tests also because of mp3 used as source instead of flac. 2025-02-11 02:28:22 +01:00
Carlos Santos f785dfd7ad ov-components: subscribe to vc directives in constructor 2025-02-07 17:21:09 +01:00
pabloFuente 8185324a0a openvidu-test-e2e: disable audio only opus RTSP test 2025-02-07 11:14:06 +01:00
pabloFuente 88214676a8 openvidu-test-e2e: add -crf flags to video encodings with ffmpeg 2025-02-06 23:16:36 +01:00
pabloFuente 9f9eda5ce4 openvidu-test-e2e: improve waiters resilience 2025-02-06 20:49:42 +01:00
pabloFuente 75bb35d00a openvidu-test-e2e: fix opus codec with "-ac 2" flag 2025-02-06 20:43:47 +01:00
pabloFuente d4006421e9 openvidu-test-e2e: add AAC audio codec RTSP tests 2025-02-06 20:27:32 +01:00
pabloFuente 0fe47c4b13 openvidu-test-e2e: test RTSP with all codecs 2025-02-06 20:07:17 +01:00
pabloFuente 5c97301c6d openvidu-testapp: allow configuring URI for Ingress URL types 2025-02-06 18:59:29 +01:00
pabloFuente de5f67dd3c openvidu-test-e2e: parameterized rtsp/srt port 2025-02-03 19:17:50 +01:00
pabloFuente da108a4031 openvidu-test-e2e: update rtstp server container to network host 2025-02-03 19:10:44 +01:00
pabloFuente 5fb3be503c openvidu-test-e2e: add RTSP and SRT tests 2025-02-03 15:36:37 +01:00
pabloFuente 6ea42e82c0 openvidu-testapp: add ingress URL type selector 2025-02-03 15:35:52 +01:00
Carlos Santos 6e1d9c7ee7 ov-components: Updated logo directive 2025-01-28 21:37:53 +01:00
Carlos Santos 4cdb761737 ov-components: Allowed Angular 19 2025-01-27 17:09:13 +01:00
Carlos Santos 51e3abd483 ov-components: Updated npm script 2025-01-27 17:04:11 +01:00
pabloFuente 77f23512a6 openvidu-test-e2e: add comment 2025-01-20 14:48:09 +01:00
pabloFuente f2cb2fb252 openvidu-test-e2e: add tags @OnlyPion and @OnlyMediasoup. Fix customIngress test 2025-01-20 14:46:16 +01:00
pabloFuente d3b8214dcb openvidu-test-e2e: add signal test 2025-01-17 11:45:24 +01:00
pabloFuente 98a4b1b2cb openvidu-test-e2e: fix array outbound exception in customIngressTest 2025-01-15 18:31:39 +01:00
github-actions 9114f4fcc6 openvidu-components-angular: Bumped version to 3.0.1-beta1 2025-01-09 12:26:03 +00:00
Carlos Santos 2ea61d05a1 ov-components: Fixed message badge color 2025-01-07 09:17:20 +01:00
pabloFuente c82d7315ef Update all Java project dependencies 2025-01-03 13:52:33 +01:00
pabloFuente 6f3475fd94 openvidu-test-e2e: fix version.surefire.plugin pom.xml version 2025-01-03 13:17:43 +01:00
pabloFuente 7de722714e Update pom.xml to remove openvidu-parent dependency 2025-01-03 13:15:11 +01:00
pabloFuente d2a59f1193 openvidu-test-e2e: disable required tests 2025-01-03 12:38:02 +01:00
pabloFuente 36df6348d6 Update pom.xml to update openvidu-java-client versions 2025-01-02 20:43:56 +01:00
pabloFuente fa0392a0a3 openvidu-test-e2e: fix testcontainer usage 2025-01-02 18:10:45 +01:00
juancarmore b829142caf openvidu-components-angular: Update links in documentation to use the latest version 2024-12-18 15:32:17 +01:00
juancarmore dead4853aa integration-tests: Refactor utility code. Exec MongoDB disconnect method after running all tests 2024-12-12 15:42:09 +01:00
cruizba d320cb2bdd ci: Remove OpenVidu V2 Test from master 2024-12-10 12:54:51 +01:00
juancarmore 07ba255beb Update integration tests workflow to use "development" branch when checking out openvidu-local-deployment and install LiveKit CLI 2024-12-09 19:04:05 +01:00
cruizba 5e4cbadff1 ci: Rename v2 test job 2024-12-09 14:06:20 +01:00
cruizba ee876987c1 Update workflow name for OpenVidu CE V2 tests 2024-12-09 13:58:53 +01:00
cruizba 0fd0b6c11c Fixing v2 e2e tests 2024-12-09 13:58:17 +01:00
pabloFuente 01d01f3d00 openvidu-test-e2e: add simple Firefox subscriber tests 2024-12-09 12:32:36 +01:00
juancarmore 363d352c79 Increase timeout for active entities fixer integration test 2024-12-06 14:08:07 +01:00
juancarmore 40f6bd790d Add GitHub Actions workflow for OpenVidu integration tests 2024-12-06 13:54:45 +01:00
juancarmore a01b1e2a2f integration-tests: Add test for openvidu active entities fixer 2024-12-05 21:04:41 +01:00
juancarmore c2d7f01310 Add integration tests setup with Jest 2024-12-05 21:02:04 +01:00
pabloFuente 5e0af77913 openvidu-test-e2e: fix race condition on client event management 2024-12-05 19:21:21 +01:00
pabloFuente 40ffd97aca openvidu-testpp: fixed versions of livekit dependencies to avoid typescript error TS1046 2024-12-05 12:13:10 +01:00
pabloFuente 09132835fe openvidu-testapp: update package-lock.json 2024-12-05 11:36:23 +01:00
pabloFuente 8c18243c88 openvidu-testapp: print string reasons 2024-12-05 11:35:16 +01:00
pabloFuente 01530fef32 openvidu-test-browsers: fix h264 codec in Selenium-managed Firefox 2024-12-04 17:21:11 +01:00
pabloFuente d1cca5efac openvidu-test-e2e: added force codec and ingress tests 2024-12-02 17:26:21 +01:00
github-actions d7f1d859a0 openvidu-components-angular: Bumped version to 3.0.0 2024-11-29 11:27:08 +00:00
cruizba 235d586d0f Update submodule openvidu for 3.0.0 2024-11-29 11:53:28 +01:00
pabloFuente 57be57d892 openvidu-testapp: fix codec selector 2024-11-27 16:47:50 +01:00
pabloFuente a4b010faba Add enableTranscoding ingress option for WHIP 2024-11-21 16:11:33 +01:00
pabloFuente 18343fa47d openvidu-testapp: add CreateIngressOptions to dialog 2024-11-21 14:54:49 +01:00
pabloFuente 738431b6bf openvidu-testapp: fix error messages 2024-11-18 17:08:47 +01:00
pabloFuente d156db6051 openvidu-testapp: refactor room service to use Node SDKs 2024-11-18 13:59:56 +01:00
Carlos Santos e1634efe39 ov-components: Refactored lang selector template 2024-11-06 12:34:04 +01:00
Carlos Santos ee79e39d4b ov-components: Updated css 2024-11-06 12:33:26 +01:00
Carlos Santos 47ccaf58c7 ov-components: Fixed recording activity panel styles 2024-11-06 11:43:34 +01:00
pabloFuente 0a3129e818 openvidu-testapp: add auto refresh of video track information 2024-11-06 11:32:19 +01:00
pabloFuente baa753ac21 openvidu-test-e2e: add simulcastDisabledDynacastEnabled test 2024-11-06 11:31:46 +01:00
Carlos Santos 6a7ab9b026 ov-components: Updated audio-wave css 2024-11-06 10:49:29 +01:00
Carlos Santos b59c56c3e8 ov-components: Updated css variable names 2024-11-06 10:06:51 +01:00
Carlos Santos 02e3fb0d4e ov-components: Updated css styles for improving custom color support 2024-11-05 17:48:10 +01:00
Carlos Santos ada5984a32 ov-components: Updated css color variables 2024-11-05 12:38:52 +01:00
pabloFuente 1d91d6fa9d openvidu-testapp: make deviceId a proper selector in VideoCaptureOptions 2024-10-28 19:12:16 +01:00
pabloFuente ed2fa45d59 openvidu-testapp: show codec in video track info window 2024-10-28 14:30:22 +01:00
pabloFuente 57d92873da openvidu-testapp: toggle video zoom 2024-10-24 11:37:04 +02:00
Carlos Santos 897404b54b ov-components: Removed unnecessary code
Removed getTokenMetadata method
2024-10-23 16:57:48 +02:00
pabloFuente c53b1b5b81 openvidu-test-e2e: improve test adaptiveStreamDisabledDynacastDisabledTest 2024-10-22 15:25:41 +02:00
pabloFuente 083adb1775 openvidu-testapp: update livekit dependencies 2024-10-22 12:13:11 +02:00
pabloFuente b74f340042 openvidu-test-browsers: move srcObject wait to JS script 2024-10-21 22:03:36 +02:00
pabloFuente 23ac1c3b00 Update to Java 17 2024-10-21 22:03:04 +02:00
pabloFuente cbc8a6b859 openvidu-tesr-browsers: wait for srcObject to be defined when checking media elements 2024-10-21 20:33:43 +02:00
pabloFuente 9f4bcc827e openvidu-test-e2e: reduce tests flakyness with active waits 2024-10-21 13:33:34 +02:00
pabloFuente 333436a90e Fix path in npm script 2024-10-15 15:56:47 +02:00
github-actions 2132d5b984 openvidu-components-angular: Bumped version to 3.0.0-beta3 2024-10-15 13:21:16 +00:00
cruizba 7ff73ac225 Update submodule openvidu for 3.0.0-beta3 2024-10-15 15:03:54 +02:00
Carlos Santos ee57064095 ci: Renamed openvidu components test file 2024-10-11 10:21:00 +02:00
Carlos Santos 28f2405cc6 ov-components: Enhanced tests timeout 2024-10-10 21:14:08 +02:00
Carlos Santos 7f2660abd9 ov-components: Removed unnecessary files 2024-10-10 21:07:23 +02:00
Carlos Santos 5a0aea9ecb ov-components: Used jasmine instead of mocha 2024-10-10 21:01:01 +02:00
Carlos Santos 5a40ce9056 ov-components: Set headless chrome for unit tests 2024-10-10 20:39:16 +02:00
Carlos Santos f309527c26 ci: Run unit tests 2024-10-10 20:32:10 +02:00
Carlos Santos 52422fb58a ov-components: Added unit tests 2024-10-10 20:30:02 +02:00
Carlos Santos 9a7a2e3adb ov-components: Fixed blocking dialog when connection issues 2024-10-10 20:28:48 +02:00
pabloFuente c273ae0109 openvidu-test-e2e: update manyToMany test 2024-10-10 13:18:58 +02:00
pabloFuente f19432af8e openvidu-test-e2e: improve test's flakiness with more checks 2024-10-09 10:47:00 +02:00
pabloFuente 9238becfe3 openvidu-testapp: update livekit dependencies 2024-10-09 10:24:23 +02:00
pabloFuente 8e12739c97 openvidu-test-e2e: fix uri resolution from protocol 2024-10-07 16:43:16 +02:00
Carlos Santos d19f0f7bb5 ov-components: Allowed custom title on admin components 2024-10-07 12:01:08 +02:00
pabloFuente 6bb5937b23 openvidu-test-browsers: remove geckodriver location 2024-10-04 13:28:18 +02:00
pabloFuente 3d60920447 openvidu-test-e2e: add enabled/disabled, Server API Mute and simulcast disabled tests 2024-10-04 13:27:20 +02:00
pabloFuente 0ce0e2acde openvidu-testapp: refactor TrackComponent 2024-10-04 13:25:44 +02:00
pabloFuente 4354561d5a openvidu-test-e2e: add new tests (speaker detection, simulcast, dynacast, adaptive stream) 2024-10-02 01:17:02 +02:00
pabloFuente 88baf99368 openvidu-testapp: new features to test simulcast, dynacast and adaptive stream 2024-10-02 01:14:42 +02:00
pabloFuente fdc3b82122 openvidu-test-e2e: add speaker detection and adaptive stream tests 2024-10-01 14:16:01 +02:00
pabloFuente e307af24e3 openvidu-test-e2e: improved e2e tests 2024-09-30 15:19:33 +02:00
pabloFuente 71598c2d7d openvidu-test-e2e: enable tests (one-to-one audio and video only, massive room) 2024-09-28 12:13:51 +02:00
Carlos Santos 28a0574d99 ov-components: Refactored translate service 2024-09-26 10:26:59 +02:00
Carlos Santos 7336f4f609 ci: Fixed start backend command 2024-09-24 14:47:25 +02:00
Carlos Santos 3d164c6422 ci: Fixed openvidu call backend path 2024-09-24 13:26:19 +02:00
Carlos Santos 72c5aa97ad ov-components: Refactored storage service 2024-09-24 12:51:43 +02:00
Carlos Santos c3b2b4663f ov-components: Exported storage service 2024-09-24 11:30:51 +02:00
Carlos Santos f7d6e81261 ov-components: Fixed selenium-webdriver types 2024-09-23 10:32:45 +02:00
Carlos Santos 8d99c376f7 ov-components: Added node types into tsconfig 2024-09-23 10:21:19 +02:00
Carlos Santos d37f094773 ov-components: Updated dependencies 2024-09-23 10:10:57 +02:00
pabloFuente 5bacf37523 openvidu-testapp: better end scenario logic 2024-09-19 13:37:46 +02:00
pabloFuente 888f0bdb7e openvidu-testapp: complete participant options. Add VideoResolution 2024-09-17 14:46:21 +02:00
pabloFuente 7e7b6d2915 openvidu-testapp: test scenarios. Full LiveKit options dialog 2024-09-17 01:32:41 +02:00
Carlos Santos bd6ba55504 ov-components: Refactored and improved config 2024-09-04 12:19:13 +02:00
Carlos Santos 724fbd9186 ov-components: Refactored config service 2024-08-26 13:20:14 +02:00
Carlos Santos 95b8d055ed ov-components: Exported toolbar model 2024-08-22 11:35:38 +02:00
Carlos Santos 0a6dd252af ov-components: Exported config service to make it public 2024-08-22 11:20:01 +02:00
Carlos Santos a82b2189bc ov-componentes: Added ovToolbarAdditionalButtonsPosition directive 2024-08-22 11:17:02 +02:00
Carlos Santos 9f0246db2f ov-components: Added cdk as peerDependencies 2024-08-22 11:13:37 +02:00
Carlos Santos 64f62dd716 ci: Fixed server start commands 2024-08-12 13:47:48 +02:00
Carlos Santos 33d71f24c3 ov-components: fixed screen sharing e2e 2024-08-02 11:44:57 +02:00
Carlos Santos 7c1066d126 ov-components: Specify screen sharing options 2024-08-02 11:12:52 +02:00
Carlos Santos 5bf5c68da4 ov-components: Updated css classes 2024-08-01 13:34:13 +02:00
Carlos Santos 33d11926a7 ci: Updated e2e test 2024-07-30 18:13:06 +02:00
Carlos Santos 6604d6aa1f ci: Updated build webcomponent step 2024-07-30 17:08:07 +02:00
Carlos Santos 1b93b1a551 ov-components: included fullscreen e2e event test 2024-07-30 16:44:07 +02:00
Carlos Santos 822ef1ad09 ov-components: Refactored screensharing e2e tests 2024-07-30 16:42:51 +02:00
Carlos Santos 2d6ab64d00 ov-components: Fixed chat e2e tests 2024-07-30 16:42:21 +02:00
Carlos Santos 4c9e949133 ci: Added webcomponent e2e tests 2024-07-30 16:34:07 +02:00
Carlos Santos 31dd06c7e8 ci: Updated e2e tests 2024-07-30 16:07:02 +02:00
Carlos Santos 17a6edbe91 ci: Added webcomponent directives e2e tests 2024-07-30 16:01:54 +02:00
Carlos Santos 9fd1c5b746 ov-components: Fixed webcomponent directives e2e tests 2024-07-30 15:48:13 +02:00
Carlos Santos 5072804e67 ov-components: Refactored and fixed device service 2024-07-30 15:45:22 +02:00
Carlos Santos 7b560b447c ov-components: Fixed fullscreen e2e test 2024-07-29 17:52:56 +02:00
Carlos Santos d52dc9b6cf ov-components: Remove old and unnecessary test and refactored code 2024-07-29 13:20:07 +02:00
Carlos Santos b2e50aa53b ci: Run E2E tests in parallel for improved performance 2024-07-29 13:08:37 +02:00
Carlos Santos 5fa86f4f4c ov-components: split ee2 tests into files 2024-07-29 12:59:25 +02:00
Carlos Santos c61bed5a75 ov-components: Fixed e2e tests events 2024-07-29 12:38:35 +02:00
Carlos Santos 27644e8fa5 ci: Commented webcomponent tests 2024-07-26 13:26:53 +02:00
Carlos Santos 9f7efd8ad5 ov-components: Added elements ids for testing 2024-07-26 13:24:02 +02:00
Carlos Santos a7e5f27eb0 ov-components: Updated generate-docs script 2024-07-26 10:30:24 +02:00
Carlos Santos 52564b5f5d ov-components: Avoid null pointer 2024-07-26 10:29:55 +02:00
Carlos Santos 3f1334b65d ci: Fixed ov-components test workflow running openvidu-call-backend 2024-07-24 18:32:12 +02:00
Carlos Santos 110cbc130f ci: Fixed start test app in e2e workflow 2024-07-24 18:07:32 +02:00
Carlos Santos 5097dc925e ov-components: fixed bundle path 2024-07-24 18:07:13 +02:00
Carlos Santos 551bc76ba1 ci: Wait for openvidu-local-deployment and testapp 2024-07-24 17:29:02 +02:00
Carlos Santos 25ef634757 ci: Updated openvidu-components e2e tests 2024-07-24 17:21:19 +02:00
Carlos Santos aa437be8cf ov-components: Updated dependencies 2024-07-24 17:02:15 +02:00
Carlos Santos d02b12141b ov-components: Refactored and cleaned code 2024-07-24 16:59:40 +02:00
Carlos Santos f28652b425 ov-components: Added missing services to providers section module
Fixed virtual background feature
2024-07-24 16:58:28 +02:00
Carlos Santos fc17b3bf9e ov-components: Fixed base href when playing and downloading recordings
Added base href to video src and downloading link for fixing the recordings features
2024-07-17 15:54:07 +02:00
github-actions d8033dcde4 openvidu-components-angular: Bumped version to 3.0.0-beta2 2024-07-16 12:56:54 +00:00
pabloFuente d6d828d3ea Update reference to openvidu-livekit 2024-07-16 12:38:21 +02:00
github-actions db28c79ee8 openvidu-components-angular: Bumped to version 3.0.0-beta2-dev.20240704 2024-07-04 16:13:56 +00:00
pabloFuente 7a7a9d6582 Add openvidu-livekit as git submodule 2024-07-02 19:23:37 +02:00
pabloFuente eccc37156a OpenVidu v3 2024-07-02 19:19:05 +02:00
Carlos Santos d9bc9b3700 ov-components: Added spinner while joining session 2024-06-28 13:32:09 +02:00
Carlos Santos db2748367c ov-webvomponent: Increased max limit bundle. 2024-06-25 14:45:11 +02:00
Carlos Santos 9fcc593fb2 openvidu-angular-v2compatibility: Bumped to 3.0.0-beta1 2024-06-25 13:14:59 +02:00
Carlos Santos 027ad510dc openvidu-java-client-v2compatibility: Bumped to 3.0.0-beta1 2024-06-25 12:51:09 +02:00
Carlos Santos 5f51f7446f openvidu-node-client-v2compatibility: Bumped to 3.0.0-beta1 2024-06-25 12:50:14 +02:00
cruizba 649a2efdab Change openvidu-java-client to 3.0.0-beta0 2024-06-25 11:56:10 +02:00
Carlos Santos 07e4ede64d ov-components: Fixed recording panel elements 2024-06-24 18:10:47 +02:00
Carlos Santos 5dd689adc6 node-client: Bump to 3.0.0-dev5 2024-06-24 16:49:34 +02:00
Carlos Santos 40c19cedca ov-components: Bump to 3.0.0-dev6 2024-06-24 16:49:15 +02:00
Carlos Santos 6ec78e5522 ov-components: Used openvidu-browser-v2compatibility dependency 2024-06-24 16:48:02 +02:00
Carlos Santos 0b89603e1b ov-components: Updated README 2024-06-24 16:19:42 +02:00
Carlos Santos 82264d436e ov-components: Bump to 3.0.0-dev5 2024-06-24 16:19:33 +02:00
Carlos Santos 81fa53b5bf Added v2compatibility suffix to java-client 2024-06-21 11:39:13 +02:00
Carlos Santos 30c705e8fc Added v2compatibility suffix to node-client 2024-06-21 11:30:34 +02:00
Carlos Santos 6698ae2314 ov-components: Added v2compatibility suffix to library and webcomponent 2024-06-21 11:20:34 +02:00
pabloFuente dc759dffd4 openvidu-browser: comment ICE server configuration priority 2024-06-05 18:03:23 +02:00
pabloFuente 2493d3c1c8 openvidu-testapp: update test-scenarios.component.ts 2024-06-05 17:38:23 +02:00
pabloFuente fdbd1bdc12 openvidu-browser: fix deprecated typedoc link 2024-06-05 17:25:13 +02:00
pabloFuente dfd614a634 openvidu-browser: add OpenViduAdvancedConfiguration.rtcConfiguration 2024-06-05 17:14:07 +02:00
pabloFuente 86c4abacb1 openvidu-java-client: fix javadoc errors 2024-05-28 13:08:10 +02:00
jenkinsopenvidu e709e63655 Update installation scripts for next release 2024-05-28 09:47:24 +00:00
jenkinsopenvidu 86f0d18417 Update to version 2.30.0 2024-05-28 09:44:59 +00:00
jenkinsopenvidu e965315ab6 Update docker-compose.yml files to version 2.30.0 2024-05-28 09:35:47 +00:00
jenkinsopenvidu 08a5950c22 Update openvidu-recording to version 2.30.0 2024-05-28 09:18:24 +00:00
jenkinsopenvidu 01298af7a6 Update openvidu-java-client to version 2.30.0 2024-05-28 09:13:34 +00:00
jenkinsopenvidu f66da6f5b4 Update openvidu-node-client to version 2.30.0 2024-05-28 09:10:41 +00:00
pabloFuente d65d2cf00e Update openvidu-browser 2024-05-28 11:01:47 +02:00
pabloFuente 8ff9c7c635 openvidu-test-e2e: fix oneToManyVideoAudioSession test 2024-05-24 14:05:15 +02:00
Carlos Santos d293d69571 webcomponent: Fixed material imports and added required polyfills file 2024-05-24 12:22:17 +02:00
Carlos Santos 6221c92bae ov-components: Updated testapp to Angular 17 2024-05-24 12:13:34 +02:00
Carlos Santos f2ab607c82 ov-components: Updated versions of CI workflow 2024-05-24 11:31:09 +02:00
Carlos Santos c2ac2384d9 ov-components: Updated Node.js version to 20 in CI workflow 2024-05-24 09:39:47 +02:00
Carlos Santos f756e48d4c ov-components: Updated e2e tests 2024-05-24 09:31:16 +02:00
Carlos Santos cc44e743a8 ov-components: Supported Angular 17 2024-05-24 09:11:02 +02:00
cruizba 86320a024e openvidu-testapp: disable buildOptimizer 2024-05-23 20:38:18 +02:00
Carlos Santos b970463325 ov-components: Removed Angular Material legacy modules 2024-05-23 14:09:47 +02:00
Carlos Santos c0bcb95282 ov-components: Fixed video poster on iPhone 2024-05-22 17:02:59 +02:00
pabloFuente 52c6126b8d Update version of Spring Boot in openvidu-server 2024-05-22 13:44:07 +02:00
cruizba 46ba88cf9a Revert "openvidu-node-client: Fix possible enum errors with typescript transpilation"
This reverts commit c1688c0d2a.
2024-05-22 13:23:48 +02:00
cruizba c1688c0d2a openvidu-node-client: Fix possible enum errors with typescript transpilation 2024-05-22 12:43:39 +02:00
Carlos Santos d1630e9b82 ov-components: Updated to Angular 16 2024-05-22 11:27:29 +02:00
Carlos Santos 0db1eda057 ov-components: Updated to Angular 15 2024-05-22 11:27:29 +02:00
cruizba 2adbdd9160 deployment: Update AMIs to Ubuntu 22.04 2024-05-21 19:42:21 +02:00
cruizba 218a9b5c9f deployment: Bump docker images FROM images 2024-05-21 16:08:31 +02:00
pabloFuente f89fd1e2cd openvidu-node-client: update dependencies 2024-05-21 13:39:45 +02:00
pabloFuente 795046b827 openvidu-browser: update dependencies 2024-05-21 13:37:12 +02:00
Carlos Santos cfd9417ee1 ov-components: Fixed e2e test config 2024-04-18 17:41:03 +02:00
Carlos Santos 004ab046be ov-components: Improved replace track sending stream params 2024-04-18 17:40:11 +02:00
pabloFuente ce74823006 openvidu-testapp: re-enable streamDestroyed event for Publishers 2024-04-04 23:04:12 +02:00
pabloFuente 762f5edf31 openvidu-testapp: disable streamDestroyed event on Publisher objects by default 2024-03-18 17:54:42 +01:00
pabloFuente d81e116e0d openvidu-testapp: add custom class to event panel contents 2024-03-18 13:01:49 +01:00
pabloFuente 2a44f20294 openvidu-browser: fix video element removal from StreamManager collection 2024-03-13 14:27:07 +01:00
pabloFuente 49e2e87f69 openvidu-testapp: update test-scenarios component 2024-03-07 11:52:25 +01:00
pabloFuente b92548c504 openvidu-testapp: better N:M and 1:M management 2024-03-06 16:53:18 +01:00
pabloFuente ce869751f1 openvidu-testapp: allow changing the auto join N:M number of participants 2024-03-06 15:59:20 +01:00
Micael Gallego f40dfa5466
Add acknowledgments to README.md 2024-03-02 17:04:33 +01:00
cruizba 78d17defa9 deployment: Missing token in metadata requests 2024-02-29 23:54:00 +01:00
cruizba aac79ef80f deployment: Use IMDSv2 in aws deployments 2024-02-29 20:24:54 +01:00
Pablo Fuente Pérez 4face2e556
Merge pull request #828 from OpenVidu/recording_experimental_flag
openvidu-recording: add experimental flag to chrome to avoid hiding l…
2024-02-13 12:08:25 +01:00
pabloFuente 69b41a1406 openvidu-recording: add experimental flag to chrome to avoid hiding local ips with mdns 2024-02-13 12:05:27 +01:00
Carlos Santos 8c18f4b366 openvidu-components: Released v2.29.3 2023-12-11 13:41:01 +01:00
Carlos Santos 44eb9e9fe0 openvidu-components: Emitted event when broadcasting button is clicked 2023-12-11 13:02:02 +01:00
pabloFuente a830033388 openvidu-server: fix https://github.com/OpenVidu/openvidu/issues/824 2023-11-03 12:36:10 +01:00
Carlos Santos d9d524b23c openvidu-components: Released v2.29.2 2023-10-26 11:44:43 +02:00
Carlos Santos 48d60eab40 openvidu-browser: Released v2.29.1 2023-10-26 11:38:12 +02:00
Carlos Santos 7802b068be openvidu-components: Added types/ws as dev dependency 2023-10-26 11:27:17 +02:00
Carlos Santos 875c8536cc openvidu-browser: Fixed bug with screensharing
When a screen publisher was initialized with audio but the user disable the publish audio after it, in the default browser popup, the subscriber was not able to receive the video and audio. There was an inconsistent with transceivers in webrtpeer
2023-10-26 11:10:49 +02:00
Carlos Santos 809ba26b35 openvidu-components: Released 2.29.1 version 2023-10-23 13:06:34 +02:00
Carlos Santos 96af7d3225 openvidu-angular: Avoid possible errors applying custom frame rate 2023-10-23 12:09:17 +02:00
jenkinsopenvidu 98b783e968 Update installation scripts for next release 2023-10-18 19:50:25 +00:00
jenkinsopenvidu 8d1a4720bb Update to version 2.29.0 2023-10-18 19:47:56 +00:00
jenkinsopenvidu c57d2b2753 Update docker-compose.yml files to version 2.29.0 2023-10-18 19:39:08 +00:00
jenkinsopenvidu 01d602633b Update openvidu-recording to version 2.29.0 2023-10-18 19:20:05 +00:00
jenkinsopenvidu 8edae4e81d Update openvidu-java-client to version 2.29.0 2023-10-18 19:13:51 +00:00
jenkinsopenvidu 626e2183c5 Update openvidu-node-client to version 2.29.0 2023-10-18 10:04:25 +00:00
Carlos Santos bb2c63cb5b openvidu-components: Released v2.29.0-beta1 2023-10-17 11:32:20 +02:00
Carlos Santos c8ff947a4f openvidu-components: Allow mute forcibly only for camera streams 2023-10-17 11:26:31 +02:00
Carlos Santos 1fb201375e openvidu-browser: Released v2.29.0-beta1 2023-10-17 10:54:31 +02:00
pabloFuente 2e07e25df7 openvidu-browser: do not add default audio track to screen media steam if screen audio source 2023-10-16 16:51:29 +02:00
pabloFuente 1e416325b6 Revert "openvidu-browser: fix wrong screen audio track management"
This reverts commit 50a07ed203.
2023-10-16 16:49:26 +02:00
Carlos Ruiz Ballesteros 55728b7235
Update build.sh 2023-10-16 13:35:13 +02:00
pabloFuente 50a07ed203 openvidu-browser: fix wrong screen audio track management 2023-10-16 13:04:30 +02:00
cruizba ff8605ef85 openvidu-server: Update Kurento version to 7.0.1-SNAPSHOT 2023-10-16 12:55:14 +02:00
cruizba ea846ac415 Fix: Recover endReason when ghost participant detected for webhook notifications 2023-10-16 12:49:47 +02:00
cruizba a14f8d997d openvidu-ci: move check kurento of snapshots from test-utils.sh to build.sh. Remove config of openvidu generic settings in bump 2023-10-14 23:02:56 +02:00
cruizba da5f55e34b openvidu-ci: Enable snapshots only if snapshot version is used 2023-10-14 21:29:36 +02:00
cruizba 39323c73a3 openvidu-e2e-tests: Fix possible race conditions in CustomWebhook.java 2023-10-12 22:33:48 +02:00
Carlos Santos 775a7bd436 openvidu-components: Supported screen audio bugfix 2023-10-05 17:58:54 +02:00
pabloFuente d2423b012d openvidu-browser: document audioSource to "screen". Warn when no videoSource to "screen" 2023-10-05 16:54:56 +02:00
pabloFuente ad96776571 openvidu-browser: fix getDisplayMedia audio bug 2023-10-05 16:42:21 +02:00
pabloFuente c8fd2090f2 openvidu-test-browsers: print hasAudioTracks and hasVideoTracks 2023-10-05 14:00:30 +02:00
pabloFuente beecb101e2 openvidu-test-e2e: improved "docker inspect" command to get docker gateway IP 2023-10-05 13:09:40 +02:00
pabloFuente 4384a74896 openvidu-test-e2e: dynamically discover docker gateway IP in mediasoup tests 2023-10-05 12:45:44 +02:00
cruizba d29254e56a deployment: Add c6a instance types to AWS CloudFormation templates 2023-10-03 10:45:55 +02:00
pabloFuente 796a478010 Update Node installation in openvidu/openvidu-test-e2e container 2023-09-29 13:48:51 +02:00
pabloFuente ac64aeb2be openvidu-server: fix circular dependency with @PostConstruct 2023-09-29 13:48:24 +02:00
Carlos Santos ec2396d904 openvidu-components: Fixed show additional panel when others are opened 2023-09-29 13:36:32 +02:00
pabloFuente 6ae3186c1e openvidu-server: remove IllegalStateException string filter for ghost participants 2023-09-28 15:39:17 +02:00
pabloFuente 96907f2c7f openvidu-server: try to delete any ghost participant after unknown ws close 2023-09-28 14:24:52 +02:00
pabloFuente 276722176b openvidu-test-e2e: fix changePublisherTest with different ChromeUser 2023-09-27 11:34:30 +02:00
pabloFuente 8a4cc402fd openvidu-server: remove extra slash in RecordingManager test path 2023-09-27 11:17:56 +02:00
Kazuma Arimura a30d3c5c9e
Update ja translation (#819)
* update title for japanese translation selector

* update translation configuration for japanese
2023-09-25 16:23:32 +02:00
pabloFuente a87086fb6c Update Selenium version 2023-09-21 11:58:58 +02:00
pabloFuente c24ad580de openvidu-test-e2e: fix docker run command to launch mediasoup-controller storing logs 2023-09-20 19:17:29 +02:00
pabloFuente 169df4373b openvidu-test-e2e: fix docker run command for mediasoup-controller 2023-09-20 17:59:50 +02:00
pabloFuente 41658de781 openvidu-test-e2e: store mediasoup-controller logs in /opt/openvidu folder 2023-09-20 17:46:30 +02:00
cruizba 4fccf86109 deployment: Increase AMI size media nodes 2023-09-19 15:36:09 +02:00
cruizba a8acfae4a8 deployment: Revert Ubuntu AMI filter to use Ubuntu Focal 20.04 2023-09-19 15:15:28 +02:00
cruizba 0497ccf439 deployment: Update at createAMI.sh scripts the Ubuntu AMI filtering to use Ubuntu Jammy 22.04 2023-09-19 11:25:03 +02:00
Carlos Santos f57c1de443 openvidu-components: Fixed screenshare e2e test 2023-09-18 11:44:24 +02:00
Carlos Santos 287ec58bab openvidu-components: Support screen audio
Now screen is always visible and independent of the camera connection. It has its own audio
2023-09-18 11:27:56 +02:00
Carlos Santos 93e48ce139 openvidu-browser: initialized getDisplayMedia with audio track 2023-09-18 10:50:29 +02:00
pabloFuente 087d5384c8 Update mobile testing 2023-09-14 16:24:09 +02:00
cruizba cb07252181 deployment: Update Lambda runtime to python3.11 for AWS deployments 2023-09-08 18:06:46 +02:00
pabloFuente bbfc579161 openvidu-browser: fix object initialization type error 2023-08-21 13:17:35 +02:00
Pablo Fuente Pérez 2f2001490a
Merge pull request #816 from semmel/semmel-inaccessible-localStorage
Tolerate inaccessible localStorage
2023-08-21 13:13:29 +02:00
Matthias Seemann 566e52f1dd
Tolerate inaccessible localStorage
When reading from localStorage, treat security exceptions like absent values. 
This supports running in third-party contexts when cross-origin cookies are blocked by the browser.
2023-08-03 21:23:27 +02:00
cruizba 918bf0ae6d deployment: While creating AMI disable flag '--disable-rollback' to remove unused NIGHTLY parameter 2023-07-31 16:01:42 +02:00
cruizba c683d989a6 Caching of driver not working in openvidu-deployment-tester. Disabling until fix 2023-07-31 14:55:11 +02:00
pabloFuente 2d320df71a Update Spring Boot from 2.7.6 to 2.7.14 2023-07-28 12:00:00 +02:00
cruizba 5bc4d20ae1 Update commons-collections4 dependency to version 4.4 2023-07-04 11:25:17 +02:00
Carlos Santos 9a6a4cbf25 openvidu-components: Added network control directives
Allowed frameRate, resolution and simulcast customization
2023-07-03 22:13:03 +02:00
cruizba 6bf48078a5 deployment: Add random TURN shared secret to .env file at enterprise ha aws 2023-06-30 17:37:48 +02:00
pabloFuente a44da5f043 openvidu-test-e2e: update default DOCKER_ANDROID_IMAGE env variable 2023-06-29 17:47:44 +02:00
pabloFuente 0b57843e84 openvidu-browser: make forceMediaReconnectionAfterNetworkDrop also affect subscribers 2023-06-28 15:46:03 +02:00
pabloFuente cc402f34d3 openvidu-server: fix possible ghost participant issue after network reconnection 2023-06-28 15:43:24 +02:00
pabloFuente efcc15a109 openvidu-browser: fix wrong call to onreconnected 2023-06-27 16:20:34 +02:00
cruizba 554fa142fc deployment: Update external TURN to version 4.6.2 2023-06-27 15:14:36 +02:00
cruizba 16c417e8e4 deployment: CF update launch configuration to launch template due to deprecation notice.
Link to the AWS announcement: https://aws.amazon.com/blogs/compute/amazon-ec2-auto-scaling-will-no-longer-add-support-for-new-ec2-features-to-launch-configurations/
2023-06-27 12:59:50 +02:00
Carlos Santos ca19a1235d openvidu-components: Released v2.28.1 2023-06-26 14:08:23 +02:00
Carlos Santos 9e7443ae7f openvidu-components: Added unique id to video elements 2023-06-26 13:31:03 +02:00
Carlos Santos 4ab66e30a1 openvidu-components: Exported translate pipe
This export will allow handle translations from a custom json file
2023-06-26 13:17:47 +02:00
cruizba 8dcf0096ee deployment: OpenVidu HA On prem - Wait for Media Node controller before launching 2023-06-24 00:59:18 +02:00
cruizba 2f797ca54f deployment: Remove coturn image at IMAGE_MEDIA_NODE_CONTROLLER in installation script of HA On premises. It is actually present in the docker-compose.yml 2023-06-23 17:16:03 +02:00
jenkinsopenvidu 1235b3ef40 Update installation scripts for next release 2023-06-23 11:28:29 +00:00
jenkinsopenvidu 9bbfc9855a Update to version 2.28.0 2023-06-23 11:27:22 +00:00
jenkinsopenvidu 7bd56abd9c Update docker-compose.yml files to version 2.28.0 2023-06-23 11:07:52 +00:00
jenkinsopenvidu 601f4bcfed Update openvidu-recording to version 2.28.0 2023-06-23 11:07:10 +00:00
jenkinsopenvidu ca0c9abeb9 Update openvidu-java-client to version 2.28.0 2023-06-23 10:56:37 +00:00
jenkinsopenvidu 70513750da Update openvidu-node-client to version 2.28.0 2023-06-23 10:54:02 +00:00
cruizba a8dcd8f3cc Bump OpenVidu recording to version 2.28.0-beta1 2023-06-22 21:58:13 +02:00
cruizba e59b055ec6 openvidu-recording: Revert preset from 'veryfast' to 'ultrafast' 2023-06-22 21:46:18 +02:00
cruizba ae694cc8e8 deployment: Missing pull at install_openvidu_enterprise_ha_node.sh 2023-06-22 12:51:17 +02:00
cruizba cd7f8ae282 Reformat of PR https://github.com/OpenVidu/openvidu/pull/809 2023-06-22 11:45:40 +02:00
Carlos Ruiz Ballesteros 759b7b2a70
Merge pull request #809 from semmel/patch-2
Fix Stream.isSendScreen() for custom videoSource
2023-06-22 11:43:24 +02:00
cruizba a1420849b4 deployment: Set default Coturn port to 443 in enterprise-ha deployment 2023-06-22 11:39:51 +02:00
Matthias Seemann 63e273129b
Fix Stream.isSendScreen() for custom videoSource
The custom MediaStreamTrack provided as videoSource parameter in the Publisher factory functions is now examined by the Stream.isSendScreen() method if it is a screen sharing video track.
2023-06-21 21:36:37 +02:00
Carlos Santos 734bc2710d openvidu-components: Updated chromedriver dependency 2023-06-21 15:49:57 +02:00
Carlos Santos 0cff58edb7 openvidu-components: Allowed override lang options with a directive 2023-06-21 15:39:45 +02:00
Carlos Santos 7c6ba2b584 openvidu-components: Fixed typo 2023-06-21 11:31:59 +02:00
Carlos Santos ddf2d936bb openvidu-components: Fixed button styles 2023-06-21 11:16:43 +02:00
Carlos Santos 41920219c3 openvidu-components: Emitted an event when language has been changed 2023-06-21 11:10:41 +02:00
cruizba bb72abe9c4 deployment: Update Kurento Media Server image version to 7.0.1 in enterprise-ha onprem 2023-06-16 16:14:01 +02:00
cruizba 946be88928 deployment: separated rules for dashboard/ and inspector/ in openvidu-proxy
To fix a rule in OpenVidu Enterprise to redirect `<domain>/inspector` to `<domain>/inspector/`,
now dashboard and inspector rules are separated to have different configurations
depending on the OpenVidu Edition PRO or Enterprise
2023-06-16 13:51:38 +02:00
cruizba fb6df7773a deployment: Restart and start OpenVidu CE services using "openvidu" deployemnt script 2023-06-15 17:14:26 +02:00
Carlos Santos 936287ae83 openvidu-components: Fixes #805
Audio and video muted directives were ignored when local storage values were present
2023-06-15 13:41:50 +02:00
cruizba d212f52f04 deployment: Update coturn to version 4.6.2 2023-06-14 18:44:18 +02:00
cruizba 22ab5641f7 deployment: Add HANodeRegistered and HANodeDeregistered to webhook events at openvidu-enterprise ha 2023-06-13 11:12:21 +02:00
cruizba e70fe4c3ab openvidu-server: Add HANodeRegistered and HANodeDeregistered to CDREventName 2023-06-13 11:05:29 +02:00
Carlos Santos 130f49d16b openvidu-components: open page after serve it locally 2023-06-01 12:56:06 +02:00
Carlos Santos 6bfe05f306 openvidu-components: Fixed e2e test timeout 2023-05-31 11:26:48 +02:00
Carlos Santos 12a34ca7cb Merge branch 'ov-components-refactor' 2023-05-31 10:55:51 +02:00
Carlos Santos 3f2e7c711e openvidu-components: Fixed e2e test 2023-05-31 10:43:43 +02:00
Carlos Santos f8812e615b openvidu-components: Wait for promise resolved 2023-05-31 10:08:45 +02:00
Carlos Santos 34d514118a openvidu-components: Updated deprecated methods messages 2023-05-31 10:00:00 +02:00
Carlos Santos fb057a5823 openvidu-components: Refactored Participant model 2023-05-31 09:56:36 +02:00
Carlos Santos 197b46f212 openvidu-components: Decoupled replaceTrack from participant service
- Refactored replace track method avoiding to use participant service 
- Split method in two replaceScreenTrack and replaceCameraTrack
2023-05-31 09:45:00 +02:00
Carlos Santos c52f632d7c openvidu-components: Added replace track e2e tests 2023-05-31 09:45:00 +02:00
Carlos Santos 55db788f50 openvidu-components: Refactored streams types enabled pipe 2023-05-31 09:45:00 +02:00
Carlos Santos d78774b218 openvidu-components: Refactored participant service
Moved some methods to participant model
2023-05-31 09:45:00 +02:00
Carlos Santos 749948a6d9 openvidu-components: Refactored openvidu and participant service
- Moved toggle screen method to participant service
2023-05-31 09:45:00 +02:00
Carlos Santos eb5984befe openvidu-components: Added e2e tests 2023-05-31 09:45:00 +02:00
Carlos Santos 504a9a915e openvidu-components: Updated local participant after toggling video 2023-05-31 09:45:00 +02:00
Carlos Santos 3175b5d328 openvidu-components: Added more e2e test
- Testing video and audio toolbar buttons
- Testing screensharing with video muted
2023-05-31 09:45:00 +02:00
Carlos Santos c6520133db openvidu-components: Refactored local participant updates 2023-05-31 09:45:00 +02:00
Carlos Santos b74ae7a6ab openvidu-components: Refactored participant and openvidu service
- Moved publishVideo from openviduService to participantService
- Mark old openviduService methods as deprecated
2023-05-31 09:45:00 +02:00
Carlos Santos d83604b92a openvidu-components: fixed e2e tests 2023-05-31 09:35:03 +02:00
Carlos Santos b013d851da openvidu-components: Updated chromedriver dependency to 110.0.0 2023-05-31 09:35:03 +02:00
Carlos Santos fd0d23563e openvidu-components: Refactored participants and openvidu service
- Migrated publishAudio method from OpenViduService to ParticipantService
2023-05-31 09:35:03 +02:00
Carlos Santos 1f6f151ce2 openvidu-components: Improved the way to create participant reference 2023-05-31 09:35:03 +02:00
Carlos Santos f20a2a8001 openvidu-components: Simplified streams pipe 2023-05-31 09:35:03 +02:00
Carlos Santos 7348ce6535 openvidu-components: Refactored css syles 2023-05-31 09:35:03 +02:00
Carlos Santos 9bcb55d4d8 openvidu-components: Refactored panel service 2023-05-31 09:35:03 +02:00
Carlos Santos 87f43537d2 openvidu-components: Fixed zoom in/out icons 2023-05-30 13:44:53 +02:00
Carlos Santos 02b1af2093 openvidu-components: Made settings menu visible while fullscreen 2023-05-30 13:17:00 +02:00
Carlos Santos 0bd8a6f38d openvidu-components: Fixed full screen status 2023-05-30 13:08:17 +02:00
cruizba 6f691e8bb1 deployment: Remove hard-coded IP addresses from load balancer 2023-05-29 17:09:02 +02:00
cruizba 4f13e5181b deployment: Remove image pull print statements in enterprise-ha installation scripts 2023-05-29 16:56:37 +02:00
cruizba c1f3b22bc9 deployment: Add script to update load balancer IPs in enterprise-ha deployment 2023-05-29 16:46:12 +02:00
cruizba b81c0dfccc deployment: Update install_ov_enterprise_ha_base.sh image pulling to include docker-compose.override.yml 2023-05-29 15:21:45 +02:00
cruizba de0ea61eb4 deployment: Set OPENVIDU_PRO_CLUSTER_RECONNECTION_TIMEOUT to 60 seconds in OpenVidu Enterprise HA on-premises 2023-05-29 14:38:07 +02:00
Carlos Santos c1cec2c07d
Merge pull request #803 from semmel/patch-1
fix: remove video element which was never inserted before
2023-05-29 11:18:50 +02:00
Matthias Seemann 76ec592865
fix: remove video element which was never inserted before
fixes #802
2023-05-25 20:41:26 +02:00
cruizba 0a952839c7 deployment: Fix installation script pull images 2023-05-22 18:36:09 +02:00
cruizba 912cdee47f deployment: Add installation and deployment files for OpenVidu Enteprise HA - On premises 2023-05-22 16:22:06 +02:00
cruizba 7b1f411db4 deployment: Update nginx for Enterprise HA on premises 2023-05-20 23:08:52 +02:00
pabloFuente 58c15b0e3c openvidu-browser: bug fix when checking system requirements on motorola edge devices 2023-05-19 13:39:19 +02:00
pabloFuente ba0e736da9 openvidu-server: remove incorrect size description of recording image 2023-05-19 13:21:34 +02:00
pabloFuente 423e0d302f openvidu-browser: remove code smell in OpenVidu.ts 2023-05-19 13:21:13 +02:00
cruizba b4b808e3f1 openvidu-node-client: Update axios version. Fix unhandled exception while fetching sessions when session is created 2023-05-18 14:16:03 +02:00
cruizba be7634c821 openvidu-node-client: Don't handle error on fetch if session is found 2023-05-17 17:42:59 +02:00
cruizba c0fa49af8d openvidu-node-client: Avoid multiple 'reject' calls in specific HttpErrors. Handling on errors in one place 2023-05-17 16:50:24 +02:00
cruizba 72b95741ca openvidu-server: Fix OPENVIDU_WEBRTC_ICE_SERVERS not being used when customIceServer is an empty list but not null 2023-05-16 01:56:02 +02:00
Carlos Santos 90d13cedc4 openvidu-components: Wait for the promise resolved from unpublish method 2023-05-05 10:42:45 +02:00
Carlos Santos 90acd8682c openvidu-browser: Avoided accessing to a property of null 2023-05-05 10:29:39 +02:00
Carlos Santos 4e50796547 openvidu-components: Fixed styles 2023-05-04 17:35:47 +02:00
Carlos Santos 2726fa6a67 openvidu-components: Minor code refactoring 2023-05-04 16:34:13 +02:00
Carlos Santos 4dc98e3272 openvidu-components: Fixed switch camera on Android devices 2023-05-04 16:14:19 +02:00
jenkinsopenvidu 75c9576f4d Update installation scripts for next release 2023-05-03 11:02:33 +00:00
jenkinsopenvidu 9f8cc36a9d Update to version 2.27.0 2023-05-03 11:01:36 +00:00
jenkinsopenvidu 61273ad642 Update docker-compose.yml files to version 2.27.0 2023-05-03 10:52:49 +00:00
jenkinsopenvidu c891a26e4b Update openvidu-recording to version 2.27.0 2023-05-03 10:49:02 +00:00
jenkinsopenvidu 6aa7a4106c Update openvidu-java-client to version 2.27.0 2023-05-03 10:44:23 +00:00
jenkinsopenvidu 83b14c39d6 Update openvidu-node-client to version 2.27.0 2023-05-03 10:41:47 +00:00
pabloFuente f922c5cd53 Update to Kurento 7.0.1 2023-05-03 12:32:51 +02:00
Carlos Santos fb101bc2c7 openvidu-components: Emitted event for updating recording list
Non moderators participants didn't update their recording list because they didn't know when a recording has been deleted or stopped. Now all standard participants know all recording events using custom signals and emitted an event to the application with the aim of updating the recording list.
2023-04-28 17:55:33 +02:00
Carlos Santos 9be838308c openvidu-components: Disabled start streaming button for no moderators 2023-04-27 16:02:31 +02:00
pabloFuente c7f1bbcd93 openvidu-test-e2e: extend broadcast and composed record test with STT 2023-04-27 13:35:30 +02:00
pabloFuente 6479382f58 openvidu-test-e2e: fix video dimension tests. Add new pro test 2023-04-27 13:16:35 +02:00
cruizba 026352133a deployment: Remove non needed comment 2023-04-27 12:55:02 +02:00
pabloFuente 1152a79354 openvidu-java-client: fix unit test 2023-04-27 10:59:24 +02:00
pabloFuente b40f120efa openvidu-server: allow only-audio broadcasting. Add new test 2023-04-26 18:46:35 +02:00
Carlos Santos f5e18fc11d openvidu-components: Fixed video recording cache
The browser was storing the play recording request on cache . Adding a query parameter which is updated each time fix this problem
2023-04-25 12:40:21 +02:00
Carlos Santos fffbdd3cd5 openvidu-components: Refactored recordings pipes 2023-04-24 17:41:29 +02:00
Carlos Santos 5f8fa08fe0 openvidu-components: Fixed connection data parse on new connection 2023-04-24 14:09:31 +02:00
Carlos Santos d7e7cfe6f7 openvidu-components: Hidden mute sound button for local participants 2023-04-21 13:33:17 +02:00
Carlos Santos f7b0f8e803 openvidu-components: Added e2e test for checking video sound button
Checking if sound button is not present for local participants
2023-04-21 13:32:13 +02:00
pabloFuente 35a6e823b6 openvidu-server: refactor recordingStarted notification for COMPOSED with video 2023-04-19 12:56:03 +02:00
pabloFuente c646f66aab Fix AndroidChromeUser REMOTE_URL 2023-04-18 18:22:52 +02:00
pabloFuente 7529de5897 ci-scripts: add "grep 172" to DOCKER_HOST_IP command 2023-04-18 18:02:06 +02:00
pabloFuente 19f9bee16e Update Android user to use correct remote URL 2023-04-18 17:17:38 +02:00
cruizba 82fe3dc986 ci: Remove runner-image instead of runner-deployment for build.sh --clean-environment 2023-04-14 16:10:29 +02:00
pabloFuente 0677268516 Change preset ultrafast to veryfast in openvidu-recording container 2023-04-14 10:01:07 +02:00
cruizba 4a11b3678b deployment: Change Docker image tags to master and pull new images in AWS CloudFormation KMS AMI template 2023-04-12 23:57:06 +02:00
Carlos Santos 1c675aa664 openvidu-components: Updated angular.json 2023-04-11 16:46:38 +02:00
Carlos Santos 2ca5e2362e openvidu-components: Removed workaround for avoiding blank videos on iOS 2023-04-11 11:30:46 +02:00
Carlos Santos 979fd14ccc openvidu-components: Avoided to show freeze videos when they are muted
Showing poster on iPhone when remote video is muted.
2023-04-11 11:29:01 +02:00
cruizba af31380bbd openvidu-java-client: Create 'performJarFileRelease' maven profile to build openvidu-java-client builds in a jar file for nightlies 2023-04-10 23:43:01 +02:00
cruizba 805c1bdb47 deployment: Parametrize correctly openvidu-recording version for cloudformation nightlies 2023-04-10 20:50:31 +02:00
Carlos Santos 1d68cbeaf8 openvidu-components: Cleared captions subscription 2023-04-10 15:43:32 +02:00
cruizba de9f195fd5 openvidu-recording: Remove CHROME_VERSION argument 2023-04-10 11:25:29 +02:00
cruizba 1edc3c055b openvidu-recording: Better way to add chrome public key for chrome installation 2023-04-10 11:12:06 +02:00
cruizba 898d12e695 deployment: Avoid aws-marketplace amis getting the latest ubuntu AMI in external turn CF 2023-04-06 17:26:11 +02:00
cruizba 91fd7c09ef deployment: Fix missing character in Enterprise CF 2023-04-05 02:25:37 +02:00
cruizba 4620645ae2 deployment: Fix AWS_CLI_DOCKER_TAG sed 2023-04-04 22:07:19 +02:00
cruizba 0c6f798692 Fix wrong elasticsearch host while using it externally 2023-04-04 20:54:34 +02:00
cruizba 5298a085cb deployment: Fix metricbeat and filebeat condition 2023-04-04 19:59:59 +02:00
cruizba 82371ba499 deployment: Typo: OPENVIDU_PRO_ELAS'IT'CSEARCH instead of OPENVIDU_PRO_ELASTICSEARCH at CF-OpenVidu-Enterprise.yaml.template 2023-04-04 19:23:42 +02:00
pabloFuente a0e6b137cc openvidu-server: avoid fatal error if an outdated version of openvidu-browser is in use by STT or broadcasting module 2023-04-03 19:52:30 +02:00
csantosm 16ec1c9480 openvidu-components: Added e2e test for audio only mediastream
Tested if NO_STREAM_PLAYING_EVENT exception is not showing when participant has video muted and MediaStream is audio only.
2023-04-03 15:45:14 +02:00
pabloFuente 1fe005c6af openvidu-test-e2e: fix custom layout broadcast test 2023-04-03 12:58:11 +02:00
pabloFuente 5d2e78238f openvidu-test-e2e: fix EXTERNAL_CUSTOM_LAYOUT_PARAMS default value 2023-04-03 12:54:21 +02:00
Pablo Fuente Pérez 83e9ab7021
Merge pull request #797 from OpenVidu/ov_browser_fix
Audio is not working properly when camera is muted
2023-04-03 12:10:22 +02:00
pabloFuente 7060a0b06f openvidu-test-e2e: fix custom layout broadcast test 2023-04-03 12:02:09 +02:00
pabloFuente 0296dcbd8e openvidu-test-e2e: remove unnecessary folder jenkins 2023-04-03 11:58:17 +02:00
csantosm ec807d3944 openvidu-browser: Fixed bug with audio only MediaStream
If a MediaStream is published with video track stopped  and a standard audio track, the video was not playing because the video track of subscriber was enabled. This track must be disabled for allowing play the video. 
Issue reference: https://openvidu.discourse.group/t/microphone-doesnt-work-correctly-on-web-from-a-mobile-device/4514
2023-03-31 14:37:22 +02:00
pabloFuente dade445ce7 Update openvidu-test-e2e Dockerfile 2023-03-31 13:00:48 +02:00
pabloFuente 3ae582700c openvidu-test-e2e: add custom layout broadcasting test 2023-03-31 12:57:50 +02:00
pabloFuente 60bddcebda openvidu-java-client: fix Javadoc typo 2023-03-31 12:24:36 +02:00
pabloFuente 7fa65661f9 openvidu-test-browsers: add --remote-allow-origins to ChromeUser 2023-03-31 12:02:05 +02:00
cruizba 5eb47d7401 openvidu-deployment-tester: Add index to docs 2023-03-29 21:48:40 +02:00
cruizba 6f6a6ad7e8 openvidu-deployment-tester: Move documentation text 2023-03-29 21:46:31 +02:00
cruizba bb2a1f6c39 openvidu-deployment-tester: Update docs with new tests 2023-03-29 21:44:50 +02:00
cruizba 11e5888747 openvidu-deployment-tester: Add recording and call parametrizable tests 2023-03-29 18:28:05 +02:00
cruizba 868835bb91 deployment: Add FOLLOW_OPENVIDU_LOGS parameter to openvidu ce script 2023-03-29 01:15:48 +02:00
cruizba 4ed42cee1d deployment: Rename some wrong descriptions for CF of external-turn 2023-03-28 23:44:18 +02:00
cruizba 1943d2f2e6 Create Cloudformation for external turn 2023-03-28 23:41:39 +02:00
pabloFuente 4ad79c7bcb Deployments: final version 2023-03-27 18:31:59 +02:00
pabloFuente ca0df78bc4 Deployments: update ENTERPRISE yaml template paths 2023-03-27 14:22:41 +02:00
pabloFuente f52673a8c4 Deployments: test ENTERPRISE AMIs 2023-03-27 11:43:22 +02:00
pabloFuente 6e826fcbc3 Deployments: move Enterprise AMI to openvidu repo 2023-03-27 11:42:15 +02:00
cruizba 09d89b2cdb openvidu-deployment-tester: Improve docker cache of drivers. Document how to develop the deployment tester image 2023-03-27 11:40:49 +02:00
pabloFuente 92048dcf7a Deployments: remove unused taskcat files 2023-03-24 17:11:20 +01:00
pabloFuente 1a6a998fea Deployment: remove unnecessary template yamls from S3 at the end 2023-03-24 13:43:29 +01:00
pabloFuente da32a74ff9 Deployment: test createAMI.sh in GH pipeline 2023-03-24 11:28:11 +01:00
pabloFuente d996e41258 Beautify create_image.sh for openvidu-deployment-tester 2023-03-23 16:15:30 +01:00
cruizba 9080159736 openvidu: Add version tag to create_image.sh of openvidu-deployment-tester 2023-03-23 14:57:09 +01:00
cruizba e482181644 openvidu: Docker image to tests deployments 2023-03-23 14:46:35 +01:00
pabloFuente 8d522bb136 workflows: replace gihub.event.inputs with inputs 2023-03-22 10:59:37 +01:00
pabloFuente fdcf14c9ae Workflow: fix wrong script method --build-openvidu-browser 2023-03-21 16:06:55 +01:00
pabloFuente 09c53bb86f ci-scripts: divide commons.sh into 3 different scripts 2023-03-21 15:54:06 +01:00
pabloFuente 855eceab23 Deployments: remove unncessary script test-no-market.sh 2023-03-21 13:33:40 +01:00
pabloFuente 47e6ed01a5 ci-scripts: replace old kurento-java repository with new one 2023-03-21 13:31:52 +01:00
cruizba 94bb69c418 deployment: Do not use IP level deny for virtual background 2023-03-21 11:30:35 +01:00
pabloFuente c4dfbdb419 Deployments: final version of createAMI.sh for PRO deployment 2023-03-19 03:38:53 +01:00
pabloFuente 9fabff5355 Deployments: test createAMI.sh 2023-03-19 01:23:23 +01:00
pabloFuente e8b75cd44d Deployments: rename createAMIs.sh to createAMI.sh 2023-03-19 00:32:39 +01:00
pabloFuente 81cc7450f5 Rename file cfn-openvidu-server-pro-no-market.yaml.template to CF-OpenVidu-Pro.yaml.template 2023-03-19 00:05:55 +01:00
pabloFuente ab55e4d046 Deployments: createAMI.sh script back to normal for CE 2023-03-18 23:51:03 +01:00
pabloFuente 11129e25b8 Deployemnts: comment full checkout if statement 2023-03-18 21:47:26 +01:00
pabloFuente 9af84c2d54 Deployments: comment checkout command for testing purposes 2023-03-18 21:33:34 +01:00
pabloFuente eae721a45b Update createAMI.sh scripts and yaml templates with new var names 2023-03-18 02:56:09 +01:00
cruizba 3c363878a1 deployment: Improve metricbeat and filebeat URL parsing 2023-03-17 22:28:35 +01:00
pabloFuente 5aa91f7217 ci-scripts: update scripts path warning 2023-03-17 17:28:15 +01:00
pabloFuente 1c29c3c76c ci-scripts: add --bump-maven-dependency-version method to commons.sh 2023-03-17 14:43:37 +01:00
pabloFuente 4add44a528 ci-scripts: add --generic-sed to commons.sh 2023-03-16 15:46:46 +01:00
pabloFuente 38ee33db27 Beautify createAMI.sh scripts 2023-03-16 13:14:05 +01:00
pabloFuente 81d561d1a0 Delete outdated scripts to update JS dependencies of openvidu-browser in tutorials 2023-03-16 13:10:53 +01:00
pabloFuente 38ef3681e7 Update installation scripts to prepare it for next release 2023-03-16 11:29:57 +01:00
cruizba 66687592de deployment: Check that minimal version of docker is 20.10.10 2023-03-16 00:45:26 +01:00
pabloFuente ab428b3ecc ci-scripts: fix OPENVIDU_MAVEN_GENERIC_SETTINGS management 2023-03-15 23:41:44 +01:00
pabloFuente fc55b27e3e openvidu-browser: update .gitignore 2023-03-15 23:06:46 +01:00
pabloFuente 59957d5f01 openvidu-browser: remove unwanted statics 2023-03-15 23:05:10 +01:00
jenkinsopenvidu 29461299e3 Update to version 2.26.0 2023-03-15 22:00:53 +00:00
pabloFuente ff189941bd Docker containers: fix create_image.scripts to allow if with wildcards 2023-03-15 22:49:54 +01:00
pabloFuente 0eb91d8948 ci-scripts: update build-openvidu-parent and build-openvidu-java-client methods 2023-03-15 21:14:15 +01:00
cruizba 280ba3b0c2 deployment: Fix unbound variable when WAIT_KIBANA_URL is empty for openvidu-server-pro image 2023-03-15 14:55:14 +01:00
jenkinsopenvidu 3dcde7db53 Update docker-compose.yml files to version 2.26.0 2023-03-15 13:52:22 +00:00
pabloFuente cd76c3a74b Unify JAR location in all openvidu-server Dockerfiles 2023-03-15 14:31:12 +01:00
jenkinsopenvidu 8e2f096217 Update openvidu-recording to version 2.26.0 2023-03-15 13:14:20 +00:00
pabloFuente 24f9a79aff GH workflow: replace step to "Use specific kurento-java commit" 2023-03-15 13:29:19 +01:00
pabloFuente c9d172c0af ci-scripts: replace PREPARE_KURENTO_SNAPSHOT to USE_SPECIFIC_KURENTO_JAVA_COMMIT 2023-03-15 13:25:09 +01:00
jenkinsopenvidu 9c2bb6a5c6 Update openvidu-node-client to version 2.26.0 2023-03-15 11:43:06 +00:00
jenkinsopenvidu 38eb4bd2c6 Update openvidu-node-client to version 2.26.2 2023-03-15 10:38:37 +00:00
pabloFuente 35113f6837 ci-scripts: fix method --wait-for-npm-dependency 2023-03-14 19:24:20 +01:00
pabloFuente 585767ec0c Use wildcard in Dockerfile of openvidu-server-pro 2023-03-14 16:20:20 +01:00
pabloFuente 2b78349b85 ci-scripts: add LINK_LOCAL_DEPENDENCIES env var to Inspector build 2023-03-14 16:19:04 +01:00
pabloFuente f5b4abce26 ci-scripts: update commons.sh to improve npm methods 2023-03-14 15:31:16 +01:00
cruizba c1a11f8e00 deployment: Improve cloudformation assertions 2023-03-14 15:24:22 +01:00
cruizba f86d71c0bf deployment: Revert coturn to 4.5.2 2023-03-13 18:03:19 +01:00
cruizba 0694281504 deployment: Add option to disable Elasticsearch in Cloudformation 2023-03-13 17:17:57 +01:00
cruizba 8764b7a23b deployment: Use OPENVIDU_PRO_ELASTICSEARCH instead of OPENVIDU_PRO_ELASTICSEARCH_ENABLED 2023-03-13 15:32:08 +01:00
pabloFuente d539504890 GitHub Action: add default imageto run the tests 2023-03-13 15:09:19 +01:00
pabloFuente 7ecf7483bd openvidu-test-e2e: extend wrongBroadcastTest check condition 2023-03-13 14:35:17 +01:00
pabloFuente 77d562c7de ci-scripts: update Setup scripts step 2023-03-10 14:59:30 +01:00
pabloFuente c4599b7529 Update version of kurento-java to 7.0.0 2023-03-10 14:35:19 +01:00
pabloFuente 1ac5ffbe32 ci-scripts: remove GITHUB_ACTIONS_WORKING_DIR from commons.sh 2023-03-10 14:33:30 +01:00
pabloFuente 2daf28518b ci-scripts: remove comment 2023-03-10 13:51:11 +01:00
pabloFuente 8d150d27ae ci-scripts: fix wrong env var input description 2023-03-09 19:59:41 +01:00
pabloFuente 378f6ea2ca ci-scripts: reorder openvidu-e2e-tests.sh methods 2023-03-09 19:13:25 +01:00
pabloFuente a36e87acc4 ci-scripts: remove unnecessary env var MEDIASOUP_CONTROLLER_VERSION 2023-03-09 19:06:51 +01:00
pabloFuente d2380dbfda ci-scripts: remove unused OPERA_VERSION env variable 2023-03-09 19:02:22 +01:00
pabloFuente bdb78db9d5 ci-scripts: fix other chmod command permissions 2023-03-09 18:50:55 +01:00
pabloFuente f0acefe685 ci-scripts: invert order in method --prepare-test-environment 2023-03-09 18:47:35 +01:00
pabloFuente d3d6e8d3be ci-scripts: add sudo to chmod command 2023-03-09 18:42:28 +01:00
pabloFuente 1892a90f88 ci-scripts: fix /etc/maven permissions 2023-03-09 18:37:59 +01:00
pabloFuente 80b08eeea5 ci-scripts: fix regression (default values in env vars are necessary) 2023-03-09 18:31:37 +01:00
pabloFuente c8546abd40 ci-scripts: remove default values of env vars as they are required: true 2023-03-09 18:24:55 +01:00
pabloFuente 249b3812ba ci-scripts: use TEST_IMAGE env var directly 2023-03-09 18:22:22 +01:00
pabloFuente ea35420526 ci-scripts: fix --prepate-test-environment parameter 2023-03-09 18:07:08 +01:00
pabloFuente 3f659457d6 ci-scripts: obtain test image from TEST_IMAGE en var 2023-03-09 17:53:11 +01:00
pabloFuente b5779e18bf ci-scripts: restore necessary maven parameter to install openvidu-parent 2023-03-09 17:34:22 +01:00
pabloFuente bc694f43d1 ci-scripts: remove unnecessary step to build openvidu-test-e2e 2023-03-09 17:27:13 +01:00
pabloFuente ac8af98404 ci-scripts: replace cd with popd 2023-03-09 16:42:29 +01:00
pabloFuente 572cc46c52 ci-scripts: simplify kurento-snapshots.xml setup 2023-03-09 16:33:03 +01:00
pabloFuente 2ec56608aa ci-scripts: allow --prepare-test-environment for localhost 2023-03-09 16:14:15 +01:00
pabloFuente 40c6bbfa6d ci-scripts: remove while loop in case statement 2023-03-09 13:15:30 +01:00
pabloFuente 794c16ae6d ci-scripts: remove unnecessary "shift 1" command 2023-03-09 13:11:21 +01:00
pabloFuente fa1d33163b ci-scripts: remove EXECUTE_ALL from commons.sh 2023-03-09 12:53:52 +01:00
pabloFuente 2f885c7309 ci-scripts: remove unused EXECUTE_ALL env var 2023-03-09 12:51:29 +01:00
pabloFuente 951be72be9 ci-scripts: fix workflow work path. Unify step names 2023-03-09 12:32:47 +01:00
pabloFuente 7d56ebfc77 ci-scripts: update workflow to refactoring 2023-03-09 12:17:04 +01:00
cruizba 4e3f241c13 deployment: Typo, forgot to use scale argument in docker-compose up 2023-03-08 18:15:18 +01:00
cruizba 7a8f7fb5d1 deployment: Add some missing changes from cb8d87aecc 2023-03-08 18:09:48 +01:00
cruizba cb8d87aecc openvidu-pro: Fix some Elasticsearch and Kibana config inconsistencies.
- 1. `ELASTICSEARCH_PASSWORD` must be greater than 6 characters
- 2. Port 443 and 80 is no longer needed to be specified when defining `OPENVIDU_PRO_ELASTICSEARCH_HOST`
  and `OPENVIDU_PRO_KIBANA_HOST`
- 3. OpenVidu Pro can run without Elasticsearch and Kibana by using `OPENVIDU_PRO_ELASTICSEARCH_ENABLED`
2023-03-08 17:57:52 +01:00
jenkinsopenvidu 53e75e5f83 Update openvidu-recording to version 2.26.0-beta1 2023-03-07 23:50:53 +00:00
pabloFuente 60e802f017 ci-scripts: add method --bump-application-properties-var-value 2023-03-08 00:26:59 +01:00
pabloFuente b495e94c9e openvidu-recording: udpate create_image.sh script 2023-03-07 20:26:18 +01:00
pabloFuente d395b807b3 ci-scripts: add bash methods to modify the deployment folder 2023-03-07 19:13:20 +01:00
pabloFuente a5a3cbd1e8 openvidu-test-e2e: fix checkVideoAverageRgbLightGray description 2023-03-07 15:55:26 +01:00
pabloFuente e6ea4ee1d8 openvidu-test-e2e: add replaceTrack test 2023-03-07 15:53:23 +01:00
pabloFuente 9fa6898db2 Deployments: add blank space to docker-compose.override.yml 2023-03-06 22:56:36 +01:00
pabloFuente 6d62d091df ci-scripts: add -j flag to jq command 2023-03-03 18:25:47 +01:00
pabloFuente 0334147690 Upgrade Kurento to 7.0.0-SNAPSHOT again 2023-03-03 13:43:10 +01:00
pabloFuente 4614ba80e7 Downgrade Kurento version to 6.18.0 2023-03-03 13:15:15 +01:00
pabloFuente 69cd6f9c1a ci-scripts: use jq to modify NPM dependencies 2023-03-03 12:23:31 +01:00
pabloFuente d3c98050ce Update Kurento snapshot version 2023-03-03 11:47:09 +01:00
pabloFuente b32ec088d8 Update commons.sh 2023-03-03 11:23:31 +01:00
pabloFuente 8db7c53a58 Extend commons.sh script 2023-03-01 17:54:30 +01:00
pabloFuente ffb2a1590c Update Docker image base versions of nginx and coturn 2023-03-01 14:05:21 +01:00
pabloFuente f48e1f805f Add /bin/bash to create_image.sh script 2023-02-28 16:34:03 +01:00
pabloFuente 9a3b7d5ae7 Add /bin/bash to create_image.sh script 2023-02-28 16:32:44 +01:00
Carlos Santos 64d3c09bd4 Revert "openvidu-components: Reduced bundle size compressing code"
This reverts commit 0cab779c8e.
2023-02-28 13:46:02 +01:00
Carlos Santos d99fb47161 ci: Printed commit url 2023-02-27 17:49:00 +01:00
Carlos Santos 49bdfa7930 ci: Added workflow inputs 2023-02-27 17:28:09 +01:00
pabloFuente 72cac3b49e Update openvidu-recording image to 2.26.0 2023-02-27 11:53:49 +01:00
Carlos Santos 0cab779c8e openvidu-components: Reduced bundle size compressing code 2023-02-24 12:12:10 +01:00
pabloFuente 90dfd60a06 openvidu-test-e2e: move start and stop RTMP server util methods 2023-02-23 15:02:18 +01:00
csantosm f3550c4f6a openvidu-node-client: Added custom logger. Fixes #791
Added custom logger and exported a new enableProdMode method with the aim of enabling the production mode and avoiding unnecessary logs
2023-02-22 23:56:46 +01:00
csantosm 027e85052a openvidu-node-client: Added .prettierrc file and formated the code 2023-02-22 23:23:43 +01:00
Carlos Santos e10198f501 openvidu-components: Reduced openvidu-angular bundle size 2023-02-22 15:53:25 +01:00
Carlos Santos 4af0e85341 openvidu-components: Fixed possible access to undefined 2023-02-22 14:07:00 +01:00
pabloFuente af8c4ec9d4 Github Workflow: comment unnecessary OPERA_VERSION input 2023-02-22 13:26:17 +01:00
Carlos Santos 8d4584dd79 openvidu-components: Updated testapp 2023-02-22 13:08:22 +01:00
Carlos Santos 421869d48e openvidu-components: Refactored recording and broadcasting services 2023-02-22 13:07:47 +01:00
Carlos Santos e45aec750e openvidu-components: Made responsive toolbar activities tags 2023-02-22 13:07:08 +01:00
pabloFuente 98d7c4415f openvidu-test-e2e: removed empty test 2023-02-22 12:49:59 +01:00
Carlos Santos 1363a19117 openvidu-components: Aligned activities status tag 2023-02-21 23:52:41 +01:00
Carlos Santos eba30772a3 openvidu-components: Improved activities toolbar tags styles 2023-02-21 23:34:42 +01:00
pabloFuente b4e7523277 openvidu-test-e2e: fix nginx.conf temp file for broadcast test 2023-02-21 16:44:13 +01:00
pabloFuente 0fc9b05f93 openvidu-test-e2e: extend waitForContainerIpAddress method 2023-02-21 15:41:10 +01:00
pabloFuente 1111c62bfe openvidu-test-e2e: get container IP using DockerClient 2023-02-21 14:53:35 +01:00
pabloFuente f7f2708b1f openvidu-test-e2e: fix custom HTTP client Java SDK test 2023-02-21 13:07:25 +01:00
pabloFuente 13651e8a76 openvidu-test-e2e: obtain broadcast container IP dynamically 2023-02-21 12:52:08 +01:00
Carlos Santos a1b7081f9d Updated paths on openvidu-components workflow 2023-02-21 10:51:49 +01:00
pabloFuente 175585b2f1 openvidu-test-e2e: make broadcast IP an env variable 2023-02-20 21:35:49 +01:00
pabloFuente 2b9b532656 openvidu-java-client: downgrade Apache HttpClient to 5.1.4 2023-02-20 16:05:40 +01:00
Carlos Santos 51728ec2d1 openvidu-components: Renamed streaming by broadcasting on webcomponent 2023-02-17 17:45:25 +01:00
Carlos Santos 54b7f82881 openvidu-components: Fixed typo on testing app 2023-02-17 17:23:13 +01:00
Carlos Santos 9d392c82cb openvidu-components: Made stt service property internal 2023-02-17 17:16:40 +01:00
Carlos Santos 931b9d63bd openvidu-components: Deleted unnecessary webcomponent directive 2023-02-17 17:10:06 +01:00
Carlos Santos 10bcc87ac5 openvidu-components: Renamed streaming by broadcasting 2023-02-17 17:03:15 +01:00
Carlos Santos d4be677613 openvidu-components: Integrated broadcast feature 2023-02-17 15:22:17 +01:00
pabloFuente 6aab00900e Remove unnecessary broadcast-nginx.conf 2023-02-17 14:35:26 +01:00
pabloFuente 4118ba2e92 openvidu-server: differentiate between activeRecordings and activeBroadcasts 2023-02-17 14:34:49 +01:00
pabloFuente 832b40fd83 Update wrongBroadcast concurrency test 2023-02-17 10:24:11 +01:00
pabloFuente cfb6f60aab openvidu-testapp: fix typo 2023-02-16 21:06:54 +01:00
Carlos Santos 8b83bb1c05 openvidu-node-client: Fixed typo 2023-02-16 20:57:50 +01:00
pabloFuente 5a1bc4f7c3 openvidu-server: rollback autoremove property on runContainer 2023-02-16 17:05:15 +01:00
pabloFuente bd23cfcd71 Broadcast SDKs. Broadcast tests in OpenViduProTestaAppE2eTest 2023-02-16 14:43:00 +01:00
pabloFuente ca5887ac06 openvidu-server: add BROADCAST_CONCURRENT_ERROR_CODE code exception 2023-02-15 10:51:28 +01:00
pabloFuente 5347849c6d openvidu-test-e2e: reduce Thread.sleep(1000) to Thread.sleep(750) 2023-02-15 10:50:51 +01:00
pabloFuente 8e04c2e38c openvidu-testapp: fix broadcast events push to event list 2023-02-15 10:50:19 +01:00
pabloFuente 2e940b3af7 openvidu-server: make autoremove a variable in DockerManager 2023-02-14 17:41:44 +01:00
pabloFuente 4d2fa546cf openvidu-testapp: broadcast 2023-02-14 17:40:48 +01:00
Carlos Santos 8083e3b5cb openvidu-components: Generate stronger unique id for participants 2023-02-10 15:50:20 +01:00
Carlos Santos 8cdd4dd751 openvidu-components: Avoided using await for returning a promise 2023-02-10 15:28:45 +01:00
pabloFuente 68ccf49f29 openvidu-test-e2e: update Session entity to include "broadcasting" property 2023-02-08 12:35:49 +01:00
pabloFuente f841886b52 Add broadcasting property to Session entity 2023-02-08 12:29:53 +01:00
pabloFuente fa91a529bc openvidu-browser: update Broadcasting link in Typedoc 2023-02-08 10:47:14 +01:00
pabloFuente c670bee1aa openvidu-test-e2e: EndReason test 2023-02-08 09:49:11 +01:00
pabloFuente 9cdca285a2 openvidu-server: fix CDR logback file. Add CDR test 2023-02-06 12:46:07 +01:00
pabloFuente a6b9e802c7 Broadcast events 2023-02-06 12:45:17 +01:00
pabloFuente cae40f5493 Change concept RTMP to Broadcast. Prepare openvidu-browser for broadcast events 2023-02-03 13:55:17 +01:00
pabloFuente 99e2b1fe97 openvidu-test-e2e: fix race condition when running openvidu-browser event callbacks 2023-02-03 13:33:19 +01:00
jenkinsopenvidu de5d712967 Update openvidu-java-client to version v2.26.0-beta1 2023-02-01 13:47:18 +00:00
pabloFuente 20db08a7e4 openvidu-test-e2e: log event.raw instead of event.text on STT simple trasnscription test 2023-02-01 14:27:05 +01:00
pabloFuente 11386c3176 openvidu-test-e2e: update REST API pro test, endpoint /health 2023-02-01 12:35:02 +01:00
pabloFuente 0fbf4d9297 openvidu-browser: fix Publisher Typedoc for method publishVideo 2023-02-01 12:16:15 +01:00
pabloFuente 8570782dfe openvidu-java-client: setHostnameVerifier in HttpClient 2023-01-31 21:11:52 +01:00
pabloFuente 66bbe9f41f openvidu-java-client: rollback to Apache HttpClient. Upgrade it to version 5 2023-01-31 20:35:33 +01:00
pabloFuente 047a23137a openvidu-test-e2e: remove Apache HttpClient dependency 2023-01-27 16:43:55 +01:00
pabloFuente d9a5ce30af openvidu-test-browsers: remove Apache HttpClient dependency 2023-01-27 16:32:37 +01:00
pabloFuente b78b127447 openvidu-java-client: refactoring to use Java HttpClient. Allow custom client 2023-01-27 16:15:32 +01:00
Carlos Santos 836fa84cd1 openvidu-components: Updated README 2023-01-26 10:48:32 +01:00
pabloFuente 9fceedd91f openvidu-test-e2e: log browser screenshot if Ionic failed receiving video 2023-01-25 13:50:46 +01:00
pabloFuente 7bd2ad5868 Azure and AWS STT tests 2023-01-24 17:06:02 +01:00
pabloFuente 2043c33761 openvidu-server: refactoring to support rtmp streaming 2023-01-18 18:11:16 +01:00
pabloFuente a41749602f Update openvidu-recording image 2023-01-18 16:02:57 +01:00
pabloFuente 2b2c2c8d01 openvidu-test-e2e: React Native and native Android tests 2023-01-09 16:58:37 +01:00
cruizba 83057362bd ci-scripts: Add docker image to not be removed at CLEAN_ENVIRONMENT 2023-01-09 12:19:22 +01:00
pabloFuente 3091070179 ci-scripts: recreate working dir just in case it was placed under /opt/openvidu 2023-01-04 14:16:30 +01:00
pabloFuente ecadb91b3e ci-scripts: move --clean-environment to its own separate function 2023-01-04 13:21:07 +01:00
pabloFuente 9681e10d45 ci-scripts: clean environment on prepare 2023-01-04 00:36:35 +01:00
pabloFuente 1c299f958b ci-scripts: add second argument to "prepare" method of commons.sh 2023-01-04 00:16:46 +01:00
pabloFuente 6ecc72800b ci-scripts: fix "popd: directory stack empty" 2023-01-03 13:03:31 +01:00
pabloFuente a65a22e204 GitHub Actions: move "serve testapp" to commons.sh 2023-01-03 12:25:23 +01:00
pabloFuente 705ac24e3b Extend commons-sh script to pack NPM dependencies into tgzs 2022-12-30 17:08:36 +01:00
pabloFuente 445f516c5b openvidu-test-e2e-android Docker image replace android-33 with android-32 2022-12-30 16:13:56 +01:00
pabloFuente 3f6316026c Export ANDROID_HOME variable in openvidu-test-e2e-android Docker container 2022-12-30 15:43:45 +01:00
pabloFuente 61f87bfe16 openvidu-test-e2e-android Docker image 2022-12-30 14:14:49 +01:00
Carlos Santos 179138eb50 openvidu-components: Fixed testapp admin dashboard 2022-12-30 13:14:55 +01:00
pabloFuente c3b7c5b147 Fix KURENTO_SNAPSHOTS_URL unbound variable 2022-12-30 11:58:07 +01:00
pabloFuente b9d3f16bac openvidu-test-e2e: OpenVidu Mobile E2e Test 2022-12-30 11:42:07 +01:00
pabloFuente 48da31f452 openvidu-test-browsers: fix CustomHttpClient when response is null 2022-12-29 22:41:49 +01:00
pabloFuente 5755412566 openvidu-test-e2e: pull DOCKER_ANDROID_IMAGE 2022-12-29 22:02:41 +01:00
pabloFuente bdb544ac4e openvidu-test-e2e: refactoring before mobile testing 2022-12-29 21:52:54 +01:00
pabloFuente 0664da5e5b openvidu-testapp: update default openvidu-node-client dependency 2022-12-29 16:44:08 +01:00
pabloFuente 5abd19deca openvidu-test-e2e: remove unnecessary webdriver-manager. Use new Selenium Manager 2022-12-28 12:56:45 +01:00
pabloFuente 863f633c64 openvidu-test-e2e: multiple Media Nodes STT Test 2022-12-28 11:48:49 +01:00
pabloFuente 0d03131217 openvidu-test-e2e: move restart methods to parent OpenViduTestE2e 2022-12-27 22:45:40 +01:00
cruizba 6069095804 ci: Common building scripts to commons.sh 2022-12-27 22:01:30 +01:00
pabloFuente e15b6115c8 openvidu-test-e2e: fix E2E STT test with mutable HashMap 2022-12-27 19:02:13 +01:00
cruizba ed418a205f ci: Make docker pull images optional 2022-12-27 17:15:31 +01:00
pabloFuente f962160c91 openvidu-test-e2e: fix E2E STT tests related to OPENVIDU_PRO_SPEECH_TO_TEXT_IMAGE 2022-12-27 16:15:17 +01:00
cruizba 5dc5528f90 ci: Fix EXECUTE_ALL unbound variable 2022-12-27 15:45:45 +01:00
cruizba 34f6d6935c Create commons.sh with common ci functions 2022-12-27 15:40:50 +01:00
pabloFuente 84864202aa openvidu-testapp: fix broken checkboxes after Angular update 2022-12-27 13:57:15 +01:00
Carlos Santos 8f8441949c Merge branch 'ov-components-rtmp' 2022-12-23 16:19:42 +01:00
Carlos Santos ab0cf2a343 openvidu-components: Added streaming activity
- Added streaming activity panel 
- Added streaming structurals directives
- Added streaming attributes directives
- Added e2e test
- Updated test app

openvidu-components: Updated e2e configuration


openvidu-components: Skipped pro e2e tests


openvidu-components: Allowed streaming for moderators only


openvidu-components: Request MODERATOR connection in testapp


openvidu-components: Fixed streaming signals


openvidu-components: Fixed bug with streaming status


openvidu-components: Fixed streaming button on status failed


openvidu-components: Refactored activities checks


openvidu-components: Forced streaming status to enum value


openvidu-components: Added non available error in streaming activity  

Streaming activity will show paid feature error if the service is not available
openvidu-components: Created and exported streaming error type


openvidu-components: Updated e2e tests


openvidu-components: Updated testapp 


openvidu-components: Enabled streaming input wehn module is disabled


openvidu-components: Updated e2e tests


openvidu-components: Updated docs


openvidu-components: Moved streaming directive to its component 

Moved streaming directive to streaming component instead of activities component 
openvidu-components: Updated testapp 


openvidu-components: Made streaming service public


ci: Send branch name in event dispatch


openvidu-components: Updated test app
2022-12-23 16:19:01 +01:00
pabloFuente 216817b675 openvidu-test-e2e: update restart command for OpenVidu Pro E2E tests. Add custom language STT test 2022-12-23 14:11:18 +01:00
pabloFuente d19d5d6dcb Add DOCKERHUB_PRIVATE_REGISTRY_PASSWORD env variable 2022-12-23 14:06:57 +01:00
cruizba 799e875dd7 deployment: OPENVIDU_UPGRADABLE_VERSION to 2.25 2022-12-22 13:59:45 +01:00
jenkinsopenvidu 4d7e33ea5e Update to version v2.25.0 2022-12-22 12:41:39 +00:00
cruizba 29b6b17787 deployment: Bumb docker-compose.yml to 2.25.0 2022-12-22 13:28:58 +01:00
openvidu fdeb2ba1a2 Update openvidu-java-client to version v2.25.0 2022-12-22 12:00:12 +00:00
jenkinsopenvidu 73e8434585 Update openvidu-node-client to version v2.25.0 2022-12-22 11:53:02 +00:00
cruizba 276fe225b0 Update openvidu recording version 2022-12-22 12:48:41 +01:00
cruizba 7cdf095e01 deployment: Update OPENVIDU_PRO_AWS parameters .env description 2022-12-22 12:40:24 +01:00
pabloFuente be202a18b9 openvidu-test-e2e: fix restart method 2022-12-22 11:25:11 +01:00
pabloFuente fb934a56ba openvidu-test-e2e: extend restart method of OpenVidu Pro E2e tests 2022-12-22 02:04:51 +01:00
pabloFuente 2cb4211555 openvidu-test-e2e: fix STT tests 2022-12-20 20:22:50 +01:00
pabloFuente 34b9908ae3 openvidu-test-e2e: test error conditions with AWS and Azure 2022-12-20 17:34:03 +01:00
Carlos Santos 5349177f14 openvidu-components: Updated captionsLangOptions api
Replaced ISO attribute by lang with the aim of matching the openvidu-browser  api
2022-12-20 11:47:25 +01:00
pabloFuente 316b14561f openvidu-test-e2e: add tests for STT load/unloading lang models 2022-12-20 01:12:53 +01:00
pabloFuente 038d6ccd29 openvidu-server: protect from NullPointer on KurentoParticipant#getPublisherStreamId 2022-12-16 16:33:10 +01:00
pabloFuente d6acd0d321 openvidu-browser: catch unhandled error on RTCPeerConnection#addIceCandidate 2022-12-16 16:32:45 +01:00
pabloFuente 273520cb2d openvidu-test-e2e: set "on_demand" as vosk model load strategy where required 2022-12-15 20:08:05 +01:00
pabloFuente 852b03267b openvidu-test-e2e: extend OpenVidu Pro E2E STT tests 2022-12-15 18:07:46 +01:00
cruizba 41ca11f9df deployment: Add OPENVIDU_PRO_DOCKER_REGISTRIES for private docker repositories usage in media nodes 2022-12-15 17:37:50 +01:00
Carlos Santos 5d38aaeddf openvidu-components: Renamed recording-activity component folder 2022-12-14 13:31:10 +01:00
Carlos Santos 682a51d11a openvidu-components: Added recordingActivity directive e2e test 2022-12-14 13:08:30 +01:00
Carlos Santos 8aba9d0610 openvidu-components: Fixed bug with recordingActivity
Fixed a typo with recordingActivity attribute directive of ov-activities-panel
2022-12-14 13:07:47 +01:00
Carlos Santos a48a6ffa32 openvidu-components: Fixed onSessionCreated event sending
Fired onSessionCreated event immediately after its creation
2022-12-14 12:47:37 +01:00
pabloFuente c924cb9ab5 Recording layout: better way of getting WS protocol 2022-12-13 13:26:03 +01:00
pabloFuente ca1dd07f08 Recording layout: dynamic WS protocol depending on current location.protocol 2022-12-13 13:24:39 +01:00
pabloFuente ea724a8db0 openvidu-server: generateErrorResponse as a static method of SessionRestController 2022-12-13 12:02:34 +01:00
Pablo Fuente Pérez f66d642c2a
Delete ROADMAP.md 2022-12-09 11:15:55 +01:00
pabloFuente c2478d806b openvidu-server: remove deprecated WebMvcConfigurerAdapter 2022-12-05 13:34:28 +01:00
pabloFuente d5d037be53 OpenVidu Server Dashboard CE: change tokens API to connections API 2022-12-02 12:58:06 +01:00
pabloFuente 36c24fab7c OpenVidu Server Dashborad update to Angular 15 2022-12-02 12:46:12 +01:00
pabloFuente 763c7cba26 openvidu-server dashboard: upgrade to Angular 14 2022-12-01 16:24:54 +01:00
pabloFuente e993cc7eb3 Remove unnecessary io.netty exclusion from pom.xml 2022-12-01 13:11:12 +01:00
pabloFuente adc102712e Update .gitignore 2022-12-01 12:49:58 +01:00
pabloFuente e1c4a44cae Update maven.compiler Java version configuration 2022-12-01 12:37:09 +01:00
pabloFuente 759127204f Remove net.bytebuddy unnecessary exclusions from pom.xml 2022-12-01 11:54:41 +01:00
pabloFuente f83e4fa7b6 openvidu-test-browsers: use deprecated setScriptTimeout 2022-12-01 11:54:00 +01:00
pabloFuente dc227a212c openvidu-test-browsers: udpate EdgeUser to new scriptTimeout API 2022-11-30 19:17:57 +01:00
pabloFuente 62794257e3 Update selenium dependency 2022-11-30 18:28:54 +01:00
pabloFuente e1aaf91053 Update pom.xml plugin versions 2022-11-30 16:29:51 +01:00
pabloFuente 72b8e78dff openvidu-server: update reconnection handler to catch uncaught KurentoException 2022-11-30 15:59:44 +01:00
pabloFuente 2f41d27b62 Update testcontainers pom.xml version 2022-11-30 11:44:40 +01:00
pabloFuente ef2189bada Reorder pom.xml dependencies 2022-11-30 11:38:21 +01:00
pabloFuente 9ee5a75e74 Delete outdated unirest dependency (use Apache Http Client) 2022-11-29 23:56:41 +01:00
pabloFuente 9522e1ff63 Update pom.xml dependencies 2022-11-29 23:19:11 +01:00
pabloFuente dadcfc6f77 Remove openvidu-pro-test-e2e Docker container from commonFunctions.groovy script 2022-11-29 18:53:15 +01:00
pabloFuente 6ef6faca86 openvidu-test-e2e: change Crash service STT test name 2022-11-29 18:36:41 +01:00
pabloFuente af23890f20 ci-scripts: add maven.artifact.thread=1 flag to mvn install command 2022-11-29 18:36:22 +01:00
pabloFuente b2158ce5e8 openvidu-testapp: update package-lock.json 2022-11-28 15:37:43 +01:00
pabloFuente 8347e521cd openvidu-test-e2e: update TestApp Pro tests to new version of JUnit 2022-11-27 18:15:32 +01:00
pabloFuente 1706491538 Fix integration tests updating properties file 2022-11-27 17:54:35 +01:00
pabloFuente b5afa436f6 openvidu-test-e2e: update to new JUnit version 2022-11-27 17:34:48 +01:00
pabloFuente 3ed03167ca openvidu-test-browsers: update to support new JUnit version 2022-11-27 17:33:46 +01:00
pabloFuente fe2f668d58 openvidu-server: update unit and integration tests to new JUnit version 2022-11-27 17:33:46 +01:00
pabloFuente 13f404d072 Update Spring Boot to 2.7.5 2022-11-27 17:33:46 +01:00
Carlos Santos 86d1260395 openvidu-angular: Fixed webcomponents e2e test 2022-11-25 12:24:55 +01:00
Carlos Santos c6cf3b91cd openvidu-components: Added e2e test pro features 2022-11-24 18:12:40 +01:00
csantosm 370b3af37e openvidu-components: Allowed custom captions lang options 2022-11-24 17:22:00 +01:00
Carlos Santos c0d8f24533 openvidu-components: Added lang and captionsLang directive tests 2022-11-24 14:13:18 +01:00
Carlos Santos c8884bc6e7 openvidu-components: Fixed e2e tests 2022-11-24 13:32:10 +01:00
Carlos Santos 7105fe448d openvidu-components: Added PRO feature e2e tests 2022-11-24 11:57:21 +01:00
Carlos Santos 595ad9564e openvidu-webcomponent: Marked as PRO feature 2022-11-24 11:53:44 +01:00
pabloFuente b0f1db5770 openvidu-server: update janino. Remove unnecessary springboot dependencies 2022-11-24 03:05:58 +01:00
pabloFuente 8caeb23c53 openvidu-server: provide required DockerHttpClient in LocalDockerManager 2022-11-24 01:48:21 +01:00
pabloFuente e8218b3fd8 Update Java dependencies. Remove commons-validator and powermock-module-junit4 2022-11-24 01:46:20 +01:00
pabloFuente d49ec43236 Add massive session e2e test 2022-11-23 22:59:43 +01:00
pabloFuente bdb34e7221 openvidu-test-app: update .gitignore 2022-11-23 17:51:00 +01:00
Carlos Santos 3cc28fa9f5 Merge branch 'openvidu-testapp-update' 2022-11-23 17:29:18 +01:00
Carlos Santos f709eb8da9 openvidu-testapp: Updated to Angular 14
ci: Updated testapp building 

openvidu-testapp: Added missing HTTPClient import

openvidu-testapp: Updated circular references stringifying a JSON
2022-11-23 17:15:34 +01:00
Carlos Santos 3af985f571 Revert "openvidu-components: Removed HTTPClient dependency"
This reverts commit bc9f3b6a6a.
2022-11-23 13:57:24 +01:00
Carlos Santos bc9f3b6a6a openvidu-components: Removed HTTPClient dependency 2022-11-23 13:46:54 +01:00
Carlos Santos 2985593391 openvidu-components: Updated dependencies 2022-11-22 17:05:44 +01:00
pabloFuente 13a0616619 openvidu-node-client: update dependencies. Update TypeDoc 2022-11-22 16:58:43 +01:00
Carlos Santos c1a8940270 openvidu-components: Updated package-lock.json 2022-11-22 16:55:40 +01:00
Carlos Santos dbd2e4a506 Merge branch 'ov-components-stt-reconnection' 2022-11-22 16:54:20 +01:00
Carlos Santos 4c0b829a08 openvidu-components: Avoided duplicated errors 2022-11-22 16:52:51 +01:00
Carlos Santos 0b7fefd906 openvidu-components: Added reconnection when STT disconnected 2022-11-22 16:50:32 +01:00
pabloFuente b39f509562 openvidu-browser: update dependencies. Update TypeDoc to 0.24 2022-11-22 16:15:07 +01:00
pabloFuente 01e5a492c4 Update openvidu-test-e2e image to Ubuntu 22.04 2022-11-22 15:08:05 +01:00
pabloFuente f728dd848a Fix openvidu-e2e-tests for NPM 18 with NODE_OPTIONS=--openssl-legacy-provider 2022-11-21 14:27:07 +01:00
pabloFuente a1d040e61a openvidu-ce-test.yml: Env variable TEST_IMAGE 2022-11-21 14:12:17 +01:00
Pablo Fuente Pérez 2389ce929f
Update openvidu-ce-test.yml 2022-11-21 14:00:53 +01:00
Carlos Santos 54cbe84812 openvidu-components: Updated npm doc scripts 2022-11-21 13:10:06 +01:00
Carlos Santos 453c9576ea openvidu-components: Updated build doc script
Replaced testapp README by openvidu-angular README with the aim of showing it on the docs. (Compodoc shows the README file which stay on the main path)
2022-11-21 12:34:14 +01:00
Carlos Santos 170c835e3b openvidu-components: Updated docs
Updated build scripts docs
Added description for token parameter
2022-11-21 12:27:45 +01:00
cruizba d19a8406bf deployment: install_media_node.sh - Pull coturn in media nodes 2022-11-18 21:16:52 +01:00
pabloFuente 1673a1b38c Update OPENVIDU_UPGRADABLE_VERSION to 2.24 in deployment scripts 2022-11-17 19:16:38 +01:00
jenkinsopenvidu deb10d2aa2 Update to version v2.24.0 2022-11-17 18:05:30 +00:00
pabloFuente 92225253fa Update Docker deployment files to 2.24.0 2022-11-17 18:31:18 +01:00
openvidu 6b82d6371d Update openvidu-java-client to version v2.24.0 2022-11-17 17:02:40 +00:00
pabloFuente b346f031c1 openvidu-testapp: update openvidu-node-client to 2.24.0 2022-11-17 17:58:22 +01:00
jenkinsopenvidu 58737cc887 Update openvidu-node-client to version v2.24.0 2022-11-17 16:57:16 +00:00
pabloFuente 887fdf6ea9 openvidu-components: update onNodeCrashed doc 2022-11-17 14:51:45 +01:00
cruizba 6947fe87cb ci: Get gateway IP by using subnet value from docker network inspect 2022-11-17 14:11:45 +01:00
pabloFuente ab1f7c4688 openvidu-test-e2e: remove path from stt service kill command 2022-11-17 14:06:59 +01:00
pabloFuente 94940dc247 openvidu-test-e2e: kill STT process inside DIND 2022-11-17 13:57:55 +01:00
cruizba f812b4d1be deployment: Update openvidu-recording to 2.24.0 2022-11-17 13:12:45 +01:00
cruizba 0c4355f9c7 deployment: Open port 4000. Update speech to text AMI 2022-11-17 13:12:45 +01:00
pabloFuente 1b5979e8f7 Manage stt-test.wav as a fake audio file instead of a fake video file 2022-11-17 11:37:28 +01:00
pabloFuente 078c13ac80 Add stt-test.wav file for STT e2e tests 2022-11-17 11:24:04 +01:00
pabloFuente 4ea501031e openvidu-test-e2e: fix Virtual Background test 2022-11-17 10:56:32 +01:00
pabloFuente 444f898125 openvidu-test-e2e: test STT reconnection after crash 2022-11-16 15:41:45 +01:00
pabloFuente 1652311448 openvidu-browser: restore automatic Stream reconnection on ICE errors 2022-11-16 13:16:32 +01:00
Carlos Santos 6ab6c22158 openvidu-components: Updated captions e2e test 2022-11-16 12:15:21 +01:00
Carlos Santos 41e9cc95eb openvidu-components: Displayed dialog on PRO features 2022-11-16 10:55:36 +01:00
pabloFuente 14debd515c openvidu-test-e2e: Crash STT service test 2022-11-15 19:25:53 +01:00
pabloFuente 75eeda4aee New RPC event "speechToTextDisconnected" 2022-11-15 19:25:40 +01:00
Carlos Santos b9fb8942c5 openvidu-components: Printed openvidu exception 2022-11-15 17:31:51 +01:00
Carlos Santos 495572035f openvidu-components: Hidden captions when OpenVidu is CE 2022-11-15 17:31:09 +01:00
pabloFuente b51a502cc9 Update STT tests to check consecutive recognized STT events 2022-11-15 16:44:10 +01:00
pabloFuente 6576f40db8 openvidu-browser: restrict Device.kind string type 2022-11-15 15:49:46 +01:00
pabloFuente fc93566e04 openvidu-browser: add Types for Events 2022-11-15 15:28:55 +01:00
pabloFuente a61fb64707 STT E2E Tests: simplify subscribe actions in all tests 2022-11-14 14:19:22 +01:00
pabloFuente 4aa1813383 openvidu-browser: dispose remote Connection on connectionDestroyed event 2022-11-14 12:56:37 +01:00
Carlos Santos b2426149c6 openvidu-components: Improved algorithm for showing captions 2022-11-11 16:48:13 +01:00
pabloFuente 55c97c3d78 openvidu-test-e2e: make OPENVIDU_PRO_SPEECH_TO_TEXT prop configurable 2022-11-11 14:24:06 +01:00
pabloFuente 8aad8948bf openvidu-server: hide secret properties on log 2022-11-11 13:37:45 +01:00
pabloFuente 286891c6fc openvidu-test-e2e: STT and composed recording test 2022-11-11 13:08:27 +01:00
pabloFuente fc275452ec openvidu-server: fix null pointer for STT participant with incompatible openvidu-browser 2022-11-11 13:07:54 +01:00
Carlos Santos e34ad74b8f openvidu-components: Added npm script for serve with ssl 2022-11-10 18:09:52 +01:00
pabloFuente a689f0009f openvidu-test-e2e: add sleeps after closing dialogs 2022-11-10 16:59:06 +01:00
pabloFuente 3276b9d26e openvidu-test-e2e: STT memory leak test 2022-11-10 15:07:01 +01:00
cruizba 0919f04fa4 deployment: Update nginx version and bump deployment versions 2022-11-10 14:44:33 +01:00
cruizba b93b8dd85e deployment: Nginx security improvements:
- Disable TLSv1.0 and TLSv1.1 by default.
- Use intermediate SSL ciphers following mozilla SSL generator: https://ssl-config.mozilla.org/#server=nginx&version=1.23.1&config=intermediate&openssl=1.1.1&guideline=5.6
- Enable HSTS by default
2022-11-10 14:43:03 +01:00
pabloFuente 8846c14157 openvidu-test-e2e: admit +0/+1 value difference in port view height 2022-11-10 14:34:40 +01:00
pabloFuente c8b445b7d2 openvidu-test-e2e: add STT tests 2022-11-10 14:00:00 +01:00
pabloFuente 7820e02574 openvidu-testapp: fix video codec retrieval 2022-11-10 13:40:17 +01:00
pabloFuente 3ad506e01a openvidu-test-e2e: update OpenViduEventManager to support user specific targets 2022-11-10 13:01:18 +01:00
cruizba 78cdd2442d Revert "openvidu-node-client: Fix upstream depedency bumping typescript to 3.9.7"
This reverts commit 1ac3660263.
2022-11-10 00:58:29 +01:00
cruizba 1ac3660263 openvidu-node-client: Fix upstream depedency bumping typescript to 3.9.7 2022-11-09 22:50:25 +01:00
Carlos Santos 4cd7369ff6 openvidu-components: Improved STT unsubscription
Unsubscribed from STT only for remote streams and camera types
2022-11-09 14:05:08 +01:00
Carlos Santos 2fa5d05c2b openvidu-components: Fixed bug with captions lang initialization 2022-11-09 13:31:40 +01:00
Carlos Santos 4be4b9695b openvidu-components: Fixed captions lang update
Updated captions lang only when it is different than older one
2022-11-09 12:47:29 +01:00
Carlos Santos 80a0f16778 openvidu-components: Removed token service
Moved all tokens logic to openvidu service
2022-11-09 10:35:48 +01:00
Carlos Santos d4cfd3893a openvidu-components: Changed language only when captions are enabled 2022-11-09 10:08:37 +01:00
Carlos Santos a8e0fcfb79 openvidu-components: Subscribe to STT when captions opened 2022-11-08 15:29:06 +01:00
pabloFuente c769ddd02d openvidu-test-e2e: fix OpenViduEventManager 2022-11-08 15:03:00 +01:00
pabloFuente 0621f205c5 openvidu-test-e2e: identify testapp user on each openvidu-browser event 2022-11-08 14:20:42 +01:00
pabloFuente 6bc8c31af1 openvidu-browser: fix RPC calls to STT (param connetionIds to connectionId) 2022-11-07 14:14:25 +01:00
pabloFuente 0d73bdc462 openvidu-server: simplify STT operations with single a connectionId 2022-11-07 13:35:35 +01:00
Carlos Santos ce4b783ef0 openvidu-components: Stored virtual background in local storage
Saved background in use in local storage for reapplying it at future meetings
2022-11-07 11:48:43 +01:00
Carlos Santos fb5c56cd87 openvidu-components: Added fault tolerant support
On media node crashed, openvidu-copmponents emits an event for requesting new tokens to the client.
2022-11-07 11:45:15 +01:00
pabloFuente dd62c033df openvidu-testapp: move STT button to stream dialog 2022-11-04 12:00:32 +01:00
Carlos Santos 4d80f823b4 openvidu-components: Updated settings panel style on mobile devices 2022-11-03 16:18:06 +01:00
Carlos Santos 0341470fc0 openvidu-components: Updated testapp 2022-11-03 16:04:20 +01:00
cruizba 79f1580560 deployment: Fix some typos of speech to text parameters at .env files 2022-11-03 12:53:47 +01:00
Carlos Santos ec7e915ee1 openvidu-components: Updated to Angular 14 2022-11-03 12:03:34 +01:00
cruizba 5f73380afa deployment: Speech to text properties added to .env 2022-11-03 11:29:16 +01:00
Carlos Santos 610f328b41 openvidu-components: Updated package-lock.json 2022-11-03 11:16:58 +01:00
Carlos Santos d360bb99e2 openvidu-components: Added e2e test for testing url message 2022-11-03 11:16:15 +01:00
Carlos Santos a61f843083 openvidu-components: Updated test app 2022-11-02 15:54:18 +01:00
Carlos Santos 9173918ce4 openvidu-components: Fixed bug when panel changed in Angular 14 2022-11-02 13:30:06 +01:00
Carlos Santos 42279d557d openvidu-components: Reapplied background on video replace track 2022-11-02 12:26:00 +01:00
pabloFuente f5fc739ea1 Update OpenVidu Editions links 2022-11-02 12:17:44 +01:00
pabloFuente 0e9ae092e5 openvidu-browser: add new StreamPropertyChanged for audioTrack and videoTrack 2022-11-02 12:11:11 +01:00
Carlos Santos 48f20ec64f openvidu-components: resubscribe to STT only if streamManager exists 2022-10-31 14:15:58 +01:00
Carlos Santos d68326a374 openvidu-components: Subscribed to STT only for camera type 2022-10-31 13:40:39 +01:00
Carlos Santos 8925d09bd6 openvidu-components: initialize captions lang checking local storage 2022-10-31 13:39:16 +01:00
Carlos Santos 103ae1fd54 openvidu-browser: Downgraded event info logs to debug level 2022-10-31 12:52:13 +01:00
cruizba f1c65213df deployment: Typo - Add service to 'speech-to-text' docker image name 2022-10-30 13:31:44 +01:00
cruizba a49c35ac7d deployment: Add speech to text service 2022-10-30 13:17:28 +01:00
Carlos Santos 0e55ac35bc openvidu-components: Updated panel settings
Added text description in captions section and other minors styles improvements
2022-10-28 14:20:28 +02:00
Carlos Santos bae861e2ce openvidu-components: Added e2e test without media devices 2022-10-27 17:52:02 +02:00
Carlos Santos 36dad0c86d openvidu-components: Refactored device service 2022-10-27 17:44:47 +02:00
pabloFuente 46ab59f4b2 openvidu-server: new Error code SERVICE_NOT_ENABLED_ERROR_CODE 2022-10-27 16:14:30 +02:00
Carlos Santos 98ecdc278e openvidu-components: Improved UI when media devices are not available 2022-10-27 13:32:29 +02:00
Carlos Santos 1898057e2a openvidu-components: Fixed white screen without media devices 2022-10-27 12:49:52 +02:00
cruizba fffc100623 deployment: Add new call properties 2022-10-26 18:03:45 +02:00
Carlos Santos 7ba8d67db6 openvidu-components: Added caption e2e test 2022-10-26 14:17:12 +02:00
Carlos Santos 2aec4b9fab openvidu-components: Added captions 2022-10-26 12:19:03 +02:00
pabloFuente 370f7b015f openvidu-client: add "lang" to ProtocolElements 2022-10-26 11:47:28 +02:00
pabloFuente 7f9b879d45 openvidu-testapp: invert Speech To Text icons 2022-10-25 13:06:48 +02:00
pabloFuente ce869588ec openvidu-testapp: default STT lang to 'en-US' 2022-10-24 14:16:46 +02:00
pabloFuente 5a9954c614 openvidu-server: added method ConfigRestController#hideSecret 2022-10-24 13:46:59 +02:00
pabloFuente c865b70c40 openvidu-browser: subscribeToSpeechToText param documentation 2022-10-21 12:40:05 +02:00
pabloFuente 9a5cf628d0 openvidu-testapp: provide lang parameter to subscribeToSpeechToText method 2022-10-21 11:20:28 +02:00
pabloFuente 38a8681d17 'lang' parameter in subscribeToSpeechToText method 2022-10-21 10:32:00 +02:00
pabloFuente 8a8cce27f5 openvidu-testapp: update openvidu-node-client to 2.23.0 2022-10-20 13:29:58 +02:00
pabloFuente fe749d40c0 openvidu-server: same public ID in Token and Connection for insecure participants 2022-10-20 12:25:07 +02:00
pabloFuente ed82ab1241 openvidu-test-browsers: add "chromeFakeAudio" 2022-10-19 12:45:58 +02:00
pabloFuente cc8ac8d99d openvidu-browser: protect onParticipantUnpublished upon undefined Connection.stream 2022-10-19 12:44:04 +02:00
Carlos Santos 1ece085349 openvidu-components: Updated testapp 2022-10-19 12:30:19 +02:00
Carlos Santos df128e0591 openvidu-components: Clean code 2022-10-19 12:29:02 +02:00
Carlos Santos fd6a076f55 openvidu-components: Refactored e2e library tests 2022-10-18 16:47:34 +02:00
Carlos Santos 5d8f4033be openvidu-components: Refactored webcomponent e2e tests 2022-10-18 12:01:21 +02:00
pabloFuente 9defcf4e87 openvidu-browser: final SpeechToTextEvent format 2022-10-17 12:27:23 +02:00
Carlos Santos d4cbc67836 openvidu-components: Replaced selenium image by browserless
Significantly reduced the e2e tests time using browserless chrome instead of selenium standalone
2022-10-17 11:47:17 +02:00
csantosm 626043c9e9 openvidu-components: Parallelized e2e test 2022-10-15 00:05:01 +02:00
Carlos Santos 6395e74f85 openvidu-components: Fixed e2e tests 2022-10-14 16:44:59 +02:00
Carlos Santos a4c2955dd4 openvidu-components: Fixed UI glitches on iPhones 2022-10-14 14:46:32 +02:00
Carlos Santos 92fd9cd634 openvidu-components: Added e2e test case 2022-10-14 13:52:35 +02:00
Carlos Santos fd99fb27f9 openvidu-components: Elevate an event on device muting 2022-10-14 13:38:36 +02:00
Carlos Santos 3d0370017a openvidu-components: Improved poster animation 2022-10-14 13:38:36 +02:00
cruizba 12e5a8b9d9 deployment: Add coturn to mono-node deployment 2022-10-13 12:10:11 +02:00
pabloFuente cf15f9f7b6 openvidu-server: manage STT participant as an invisible one 2022-10-10 18:40:25 +02:00
pabloFuente b31b612954 openvidu-server: differentiate onSubscribe handler 2022-10-10 14:37:35 +02:00
pabloFuente 37073bd0ec openvidu-browser: speechToText to speechToTextMessage 2022-10-10 12:04:17 +02:00
pabloFuente d700dd3e97 Speech-To-Text base support 2022-10-10 11:45:27 +02:00
pabloFuente 9fe3a6856c openvidu-testapp: add speech-to-text buttons to videos 2022-10-09 13:14:05 +02:00
Carlos Santos 98a1ea0cd2 openvidu-components: Updated README 2022-10-07 16:40:25 +02:00
Carlos Santos 356784d473 openvidu-components: Updated e2e test and Angular dependencies 2022-10-07 16:32:03 +02:00
Carlos Santos 98e0f20dc0 ci: Updated selenium on ov-components workflow 2022-10-07 15:56:47 +02:00
Carlos Santos d0a9ad0e67 openvidu-components: Updated e2e dependencies 2022-10-07 15:48:23 +02:00
cruizba 875763f357 deployment: Update OpenVidu PRO and media-node-controller to 2.24.0-beta1 2022-10-07 14:35:13 +02:00
cruizba 637fe69b1d deployment: Set different recordings directory for media nodes with mono-node deployment 2022-10-07 13:55:56 +02:00
cruizba 56b22841ac openvidu-server: Adapt config.getOpenViduRecordingPath to have different recording paths in Media nodes for OpenVidu PRO/ENTERPRISE 2022-10-07 13:55:56 +02:00
Carlos Santos b489485c42 openvidu-components: Updated docs 2022-10-07 13:35:59 +02:00
pabloFuente 600c3d778d openvidu-java-client: fix test 2022-10-06 13:07:37 +02:00
pabloFuente 3b72c8f52d openvidu-recording Docker image: add Ubuntu 22.04-based image 2022-10-06 11:25:12 +02:00
pabloFuente 74e68ea8b1 openvidu-recording Docker image: add new Chromium flags 2022-10-06 11:15:52 +02:00
Carlos Santos e2d8a510e6 openvidu-components: Returned same url in recording pipe 2022-10-05 13:58:17 +02:00
Carlos Santos 5f0fe95d69 ci: Fixed curl request for sending commit data 2022-10-05 12:33:41 +02:00
Carlos Santos 7d88c1fafb ci: Replaced gh cli command by curl request
gh cli does not suport object as parameters
2022-10-05 11:54:42 +02:00
Carlos Santos 0a2a89e375 ci: Set default value if input is empty 2022-10-05 10:28:51 +02:00
Carlos Santos f8bb589caa ci: Added workflow path in openvidu-components-e2e 2022-10-05 10:16:29 +02:00
Carlos Santos a652754fc5 ci: Added commit message and id in dispatch event 2022-10-05 10:12:42 +02:00
Carlos Santos da6388cc3c ci: Fixed typo in ov-components e2e 2022-10-04 23:23:25 +02:00
Carlos Santos 4bdb6f303c ci: ignored components yml on CE workflow 2022-10-04 21:55:46 +02:00
Carlos Santos 70916677de github: Updated dispatch event 2022-10-04 21:53:11 +02:00
Carlos Santos e26fdf723c github: Fire a custom event on openvidu-components job 2022-10-04 16:59:20 +02:00
pabloFuente 4e299f1ae6 openvidu-java-client: allow http and https URI protocols on rtspUri parameter 2022-10-04 13:11:50 +02:00
cruizba f886eb217c deployment: Add stop container command in opevidu-pro mono node 2022-10-04 10:38:43 +02:00
cruizba 64e603e047 deployment: Add mononode openvidu pro deployment files 2022-10-04 10:30:45 +02:00
Carlos Santos 2595afd722 openvidu-components: Updated admin dashboard view 2022-09-27 13:02:56 +02:00
csantosm 6916f1525d openvidu-components: Added e2e test 2022-09-23 16:37:40 +02:00
csantosm 0ec4d828b8 openvidu-components: Updated chromedriver dependency 2022-09-23 16:37:40 +02:00
cruizba 837c1d5af7 openvidu-components: Set version 2.23.1 2022-09-23 14:17:38 +02:00
csantosm 49ca194c07 openvidu-components: Updated openvidu-browser peerDependency 2022-09-23 13:35:16 +02:00
csantosm d1e6aeab36 Revert "openvidu-components: Updated peer depencencies versions"
This reverts commit 4a08a569b5.
2022-09-23 13:02:16 +02:00
csantosm f8d76f647c openvidu-call: Fixed testing OpenVidu URL 2022-09-23 11:43:04 +02:00
cruizba 5acd93ecd0 Update OPENVIDU_UPGRADABLE_VERSION to 2.23 2022-09-22 00:22:29 +02:00
jenkinsopenvidu bf427ba4df Update to version v2.23.0 2022-09-21 20:47:30 +00:00
cruizba 48192b3f50 Update docker-compose.yml tag versions to 2.23.0 2022-09-21 17:23:13 +02:00
openvidu ef9ad28d56 Update openvidu-java-client to version v2.23.0 2022-09-21 14:47:26 +00:00
cruizba 154cdc2db6 deployment: Update nginx version to 1.23.1 2022-09-21 15:18:56 +02:00
pabloFuente 7e5a8afb48 openvidu-server: show warning log on startup if openvidu-dev container 2022-09-20 16:09:47 +02:00
jenkinsopenvidu ec6106b079 Update openvidu-node-client to version v2.23.0 2022-09-19 16:23:29 +00:00
cruizba 57401acf2b deployment: Remove docker of openvidu-test-app. Update openvidu-dev to 6.18.0 2022-09-19 17:56:15 +02:00
cruizba 420da79ea4 Change to openvidu-server-kms to openvidu-dev 2022-09-19 17:21:33 +02:00
cruizba c4244cf397 openvidu-server: Update version.kurento from 6.18.0-SNAPSHOT to 6.18.0 2022-09-19 13:10:14 +02:00
Carlos Santos 4a08a569b5 openvidu-components: Updated peer depencencies versions
Used ranges with the aim of support new Angular versions
2022-09-19 12:20:32 +02:00
Carlos Santos 3f0e96ac35 openvidu-components: Disabled captions feature preview 2022-09-19 12:19:26 +02:00
Carlos Santos cc5110dec3 openvidu-components: Updated README 2022-09-19 10:48:09 +02:00
cruizba ace1a1f5a4 deployment: Update script of upgrading
- Throw error while upgrading between different OpenVidu Editions.
- Move coturn volume to rollback directory while upgrading.
2022-09-16 19:09:41 +02:00
cruizba 7f1684fb78 openvidu-server,deployment: Update kurento-media-server to 6.18.0 2022-09-16 16:43:49 +02:00
cruizba f124f0a661 openvidu-server, deployment: Update recording version to 2.23.0 2022-09-14 12:56:33 +02:00
cruizba ca08e16ac4 deployment: Deprecate old API by default. 2022-09-14 12:04:57 +02:00
csantosm 0865aaa97f openvidu-components: Fixed recording extension 2022-09-07 12:44:47 +02:00
csantosm 74cfa1e567 openvidu-components: Made prejoin page responsive 2022-09-07 12:01:04 +02:00
csantosm b20da507c3 openvidu-components: Updated README 2022-09-07 11:55:27 +02:00
pabloFuente bd3ad19cab openvidu-server: rename property DEV_CONTAINER to FORCE_PLAIN_HTTP 2022-08-26 11:46:09 +02:00
pabloFuente a2c6c8b4eb Rename openvidu-js-java(/node) to openvidu-roles-java(/node) 2022-08-26 11:45:25 +02:00
csantosm 09eeaf4b88 openvidu-components: Updated webcomponent e2e 2022-08-18 15:58:07 +02:00
csantosm 27e686271e openvidu-components: Fixed replaced track after mute camera
openvidu-browser needs a mediaStreamTrack param if a custom was assigned before mute video track releasing resources.
2022-08-18 13:51:55 +02:00
csantosm 7296057184 openvidu-browser: Added missing return after refactoring 2022-08-18 11:11:46 +02:00
csantosm 2ce54f577b openvidu-browser: Added common format config file 2022-08-17 18:05:32 +02:00
csantosm 128dd3cfed openvidu-components: Fixed bug requesting devices 2022-08-17 17:54:39 +02:00
csantosm c0e45e8df7 openvidu-browser: Refactored some methods for them to use async/await
Updated initPublisher and getUserMedia
2022-08-17 17:50:01 +02:00
csantosm 1704bb2c8c openvidu-components: Fixed bug listing recordings on admin page 2022-08-17 12:46:49 +02:00
csantosm 6905142a4a openvidu-components: Fixed typo 2022-08-17 12:46:21 +02:00
csantosm 95180b669f openvidu-components: Updated admin dashboard and fixed linters 2022-08-11 17:24:15 +02:00
csantosm 30aa871075 openvidu-components: updated dependencies 2022-08-11 17:24:15 +02:00
pabloFuente d878c3f5eb Rename docker container openvidu-server-kms to openvidu-dev 2022-08-08 23:49:22 +02:00
pabloFuente 064887f7d8 openvidu-server: remove deprecated property OPENVIDU_DOMAIN_OR_PUBLIC_IP 2022-08-08 22:32:06 +02:00
pabloFuente a729cea252 openvidu-components-angular: update all code snippets to match tutorials 2022-08-08 18:53:38 +02:00
pabloFuente 5a5fcc4d5e openvidu-browser: fix typo. Add sample codes to Events 2022-08-04 17:19:46 +02:00
csantosm dbf8a84981 openvidu-components: Used proxy for requesting the recording thumbnail 2022-08-03 18:38:37 +02:00
cruizba 6b27a44542 openvidu-test-e2e: Install docker-compose in docker test image 2022-07-28 02:17:52 +02:00
pabloFuente 755de51c2a openvidu-testapp: revert unpublish video change 2022-07-27 18:13:06 +02:00
Juan Navarro 4a846c5f56 openvidu-browser: Node.js platform: Extend system requirements 2022-07-27 16:53:25 +02:00
Juan Navarro 2b70c12be6 openvidu-browser: Node.js platform: Use `globalThis` instead of `window`
While `window` is specific to the web browser, and `global` is specific
to Node.js, the standard `globalThis` global variable is common to both
platforms.

Thus, to make openvidu-browser more portable to Node.js, it's better to
use the common name.

More info:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
2022-07-27 16:53:25 +02:00
Juan Navarro 71b0e6ca43 openvidu-browser: Node.js platform: ConsoleLogger constructor
Doesn't look right that the argument is ignored and instead global
state is modified. The code later passes in `window.console` anyway,
so this doesn't really change the behavior.

However this change is important for Node.js compatibility, where
`window` is not defined.
2022-07-27 16:53:25 +02:00
Juan Navarro b5d7371eed openvidu-browser: Reformat function checkSystemRequirements()
It was difficult to read and modify, and the "if/else" return logic
could be simplified.

Also the comments were outdated. Remove them and let the code speak
by itself.
2022-07-27 16:53:25 +02:00
pabloFuente 80ed795c65 openvidu-testapp: use plain openvidu-server HTTP 2022-07-27 15:58:57 +02:00
pabloFuente ee2c3d009b openvidu-server: public URL to plain HTTP if DEV_CONTAINER 2022-07-27 12:07:45 +02:00
pabloFuente fd83b6693a openvidu-browser: do not force wss in token 2022-07-26 15:46:53 +02:00
pabloFuente d071529e12 openvidu-node-client: link to Error JS object in TypeDocs 2022-07-18 11:37:40 +02:00
cruizba 4102d5c8c3 ci: Include deprecated AMIs in delete_amis.sh script 2022-07-17 20:57:03 +02:00
csantosm 65ff948354 openvidu-components: Clean tests 2022-07-15 15:55:33 +02:00
csantosm fda25021f2 openvidu-components: make stronger e2e test 2022-07-15 15:20:41 +02:00
csantosm bfb350d3df openvidu-components: Updated documentation 2022-07-15 15:20:13 +02:00
pabloFuente 370a426fa9 openvidu-browser: fix targetElement types on constructors 2022-07-15 10:41:12 +02:00
pabloFuente 215f2828dd openvidu-browser: allow undefined as targetElement property. Typo fix 2022-07-14 16:44:18 +02:00
csantosm 353dd2b545 openvidu-angular: Removed custom service for webcomponent logging 2022-07-14 09:46:30 +02:00
csantosm 1d70791fd9 openvidu-components: Exported only the necessary elements 2022-07-14 09:39:11 +02:00
csantosm 51c8eb27e6 openvidu-components: Added e2e test 2022-07-14 09:38:08 +02:00
csantosm 1122fb8649 openvidu-components: Fixed bug with playing recording
Set a default value if recording extension is undefined.
2022-07-12 11:25:29 +02:00
csantosm 65025c4e33 openvidu-components: Improved prejoin styles 2022-07-11 15:32:36 +02:00
csantosm f93b55818d openvidu-components: Fixed prejoin selectors when is iPhone 2022-07-11 13:05:28 +02:00
csantosm 1f348d2986 openvidu-components: Updated exported components 2022-07-11 12:06:38 +02:00
csantosm e8f110f6b5 openvidu-components: Updated captions component 2022-07-08 15:39:05 +02:00
cruizba 091f53c596 Move lorem-ipsum dependency to library temporarly 2022-07-07 21:34:26 +02:00
cruizba f4b9636d5a Move lorem-ipsum dependency to fix build 2022-07-07 21:10:00 +02:00
csantosm 53d54a682e openvidu-components: Removed unnecessary code after fixed hark
openvidu-browser hark events bug has been fixed so it is not necessary to resubscribe again after audio track is replaced.
2022-07-07 17:47:27 +02:00
pabloFuente ce230f059a openvidu-browser: fix hark events reapplication after Publisher#replaceTrack 2022-07-07 16:49:17 +02:00
pabloFuente b99f387b4e openvidu-browser: init hark events on Publisher#replaceTrack 2022-07-07 14:28:47 +02:00
Pablo Fuente Pérez a04f43e98d
Merge pull request #726 from Flamenco/patch-2
Add space after period.
2022-07-07 07:19:56 -05:00
Pablo Fuente Pérez 4078852503
Merge pull request #739 from OpenVidu/fix_replaceTrack_event
Fixed StreamPropertyChangedEvent when replaced tracks
2022-07-07 07:19:10 -05:00
csantosm 873b52f19c openvidu-components: Updated testapp 2022-07-06 13:55:15 +02:00
csantosm d96edcfec6 openvidu-components: Deleted samples 2022-07-06 13:47:13 +02:00
csantosm b4080fedea openvidu-components: Renamed subtitles components to captions 2022-07-06 13:46:42 +02:00
csantosm 085d659363 openvidu-components: Updated e2e tests 2022-07-06 00:37:28 +02:00
csantosm 95e5e977da openvidu-components: Fixed race condition with session initialization
When prejoin component is disabled, the Session component was initialized before the videoconference component initialization had finished
2022-07-06 00:04:02 +02:00
csantosm 25972260ac openvidu-components: Updated layout elements transitons 2022-07-05 23:59:39 +02:00
csantosm 4fd2fc8595 openvidu-components: Added dev dependencies in testapp 2022-07-05 12:23:55 +02:00
csantosm 0b74590252 openvidu-components: Added preliminary subtitles 2022-07-05 12:17:03 +02:00
csantosm fc7b961010 openvidu-components: Updated layout 2022-07-01 12:50:59 +02:00
csantosm 8f2cfec201 openvidu-components: Fixed recording extension 2022-06-28 21:16:11 +02:00
csantosm 84d3ea1de7 openvidu-components: Updated E2E test 2022-06-28 14:16:53 +02:00
csantosm 6ace61fe75 openvidu-components: Updated test app 2022-06-28 13:16:39 +02:00
csantosm a46502ceca openvidu-components: Improved play and download recordings 2022-06-28 12:47:29 +02:00
csantosm eaed1b3692 openvidu-components: Fixed replace tracks in session 2022-06-24 16:12:36 +02:00
csantosm 03a15d1077 openvidu-browser: Fixed StreamPropertyChangedEvent when replaced tracks 2022-06-24 14:34:59 +02:00
csantosm ea3f16778e openvidu-components: Fixed panel services bugs
Chat panel is not updating when a new message is received. 
Wrong method had been invoked
2022-06-24 12:50:19 +02:00
pabloFuente 556b3a0a2b openvidu-browser: replace setAttribute('playsinline') with playsInline=true 2022-06-23 13:28:00 +02:00
pabloFuente 17ff9105aa openvidu-browser: fix echo when calling Publisher#replaceTrack 2022-06-23 13:23:36 +02:00
csantosm 6269db8978 openvidu-components: Avoided subscribe to recording events if disabled 2022-06-22 14:01:50 +02:00
csantosm fd45988bfc openvidu-components: Updated testapp 2022-06-22 12:42:02 +02:00
csantosm 26f96761cd openvidu-components: Improved play recordings feature 2022-06-22 12:35:31 +02:00
csantosm c71848ec3c openvidu-copmponents: Updated recording and admin dashboard 2022-06-20 17:03:54 +02:00
csantosm b2dc5da33c openvidu-components: Fixed typo showing disconnected error 2022-06-20 17:01:29 +02:00
pabloFuente c37e619dac openvidu-java-client: add method OpenVidu#getActiveSession(String sessionId) 2022-06-20 11:23:15 +02:00
csantosm b283dcd3a2 openvidu-components: Fixed bug updating media devices 2022-06-17 12:50:20 +02:00
csantosm a1d55575fd openvidu-components-e2e: Added settings button test 2022-06-16 15:56:57 +02:00
csantosm 2c200d4d86 openvidu-components: Added missing bg effects directive to webcomponent 2022-06-16 15:56:14 +02:00
csantosm 12ad515e5b openvidu-components: Added settings directive to webcomponent 2022-06-16 15:55:40 +02:00
csantosm c8264fdb1b openvidu-components: Added settings panel for configuring media devices 2022-06-16 14:01:19 +02:00
pabloFuente 3908dfc146 openvidu-java-client: improve default values of Properties 2022-06-16 12:21:11 +02:00
pabloFuente e5fc3927b5 openvidu-java-client: RecordingPropertiesTest 2022-06-15 15:58:10 +02:00
pabloFuente 84f23f6beb openvidu-test-e2e: update Kurento image from 6.16.0 to dev-6.18 2022-06-15 14:12:45 +02:00
pabloFuente 1dd234a928 Update "mediaNode" Recording property 2022-06-15 12:50:56 +02:00
csantosm 57869cb358 openvidu-components: Made toolbar responsive 2022-06-14 13:22:53 +02:00
csantosm d18d37de82 openvidu-components: Emitted event when refresh button is clicked 2022-06-14 12:24:16 +02:00
pabloFuente bb23e65897 openvidu-java-client: fix unit test 2022-06-13 18:32:30 +02:00
pabloFuente 735d4a96bd Move RecordingProperties#fromJson from openvidu-server to openvidu-java-client 2022-06-13 18:20:53 +02:00
csantosm 7e8b6adaad openvidu-components: Hidden bacground service from docs 2022-06-13 14:06:07 +02:00
csantosm 76e27fb5d9 openvidu-components: Updated Readme 2022-06-13 14:06:07 +02:00
csantosm cf77883982 openvidu-components: Updated recording panel 2022-06-13 14:06:07 +02:00
csantosm b133313e44 openvidu-components: Splitted material imports 2022-06-13 14:06:07 +02:00
csantosm e83025f522 openvidu-components: Added translations 2022-06-13 14:06:07 +02:00
csantosm 15a7037b04 openvidu-components: Added admin dashboard 2022-06-13 14:06:07 +02:00
pabloFuente d37809ac5b openvidu-test-e2e: fix OpenVidu SDK fetch test 2022-06-10 12:38:14 +02:00
pabloFuente c6e3875ceb openvidu-server: fix uncaught exception in Token class 2022-06-10 11:57:04 +02:00
pabloFuente b102a44d50 Move ConnectionProperties#fromJson from openvidu-server to openvidu-java-client 2022-06-10 11:54:47 +02:00
pabloFuente a49e1818c0 Move SessionProperties#fromJson from openvidu-server to openvidu-java-client 2022-06-09 17:38:58 +02:00
Carlos Ruiz Ballesteros caa9accf02
Merge pull request #734 from OpenVidu/deployment-logs
Improvements for deployment script "logs" command
2022-06-09 17:27:31 +02:00
csantosm bba03ec8a0 openvidu-components: Implements AfterViewInit in prejoin component 2022-06-09 16:06:51 +02:00
Juan Navarro ac5700cd95
Remove improper usages of SessionProperties.forcedVideoCodecResolved (#737)
forcedVideoCodecResolved is a property that gets automatically assigned
by the server and only used by it; clients don't need to know about its
existence and don't need to use it. Similarly, SessionProperties itself
should not serialize this field.
2022-06-09 15:29:23 +02:00
cruizba a18b15146f ci: Only listen on push master branch and PRs to master 2022-06-09 15:22:54 +02:00
csantosm 91c328b58f openvidu-components: Fixed recording button toolbar
Checked role when the toolbar menu is opened for avoiding deprecated values
2022-06-09 14:45:59 +02:00
csantosm 84bf80c24a openvidu-components: Fixed video blank on iOS devices 2022-06-09 12:28:04 +02:00
csantosm 3c323233a5 openvidu-components: Fixed bug with show mat menu in iPhone devices 2022-06-09 11:20:01 +02:00
pabloFuente e3aaf2a25a Update README with OpenVidu Tests badge 2022-06-08 14:40:26 +02:00
pabloFuente 83397b07dc openvidu-server: fix RPC missing parameters exception message 2022-06-08 12:40:00 +02:00
Juan Navarro 4e54cd2472 deployments: Allow users to print whole logs or just follow them
Users can call the script with "-f" or "--follow" in order to follow the
latest lines (like with system tool "tail -f"), of not provide this
argument to obtain the whole contents of the logs.
2022-06-06 14:54:43 +02:00
Juan Navarro 5d61cb1afa deployments: use "--tail 10" to follow logs
docker-compose uses "--tail all" by default, which prints the complete
logs before starting to follow new lines. This becomes a problem when
the service has been running for a lot of time and there are thousand of
lines.

Use "--tail 10" to mimic the behavior of the "tail" program, which shows
the latest 10 lines by default.
2022-06-06 14:46:37 +02:00
cruizba 5152f38d23 ci: Define defaults if not present for push 2022-06-06 14:33:40 +02:00
cruizba c4ba0b66b4 ci: Check if default values works on push 2022-06-06 14:26:39 +02:00
cruizba c326c206c4 ci: Use paths-ignore instead of paths 2022-06-06 14:16:32 +02:00
cruizba 757923bbc4 ci: Add e2e tests in github actions 2022-06-06 12:32:35 +02:00
csantosm 57c17b50ef openvidu-components: Fixed missing device labels in Firefox 2022-06-03 11:34:55 +02:00
csantosm a9854649a4 openvidu-components: Fixed form styles 2022-06-03 11:33:56 +02:00
csantosm 6e1783fb87 openvidu-components-e2e: Added sleep after open mat menu 2022-06-02 18:13:22 +02:00
csantosm 5d574fb3d2 openvidu-components: Allowed one single string token in webcomponent 2022-06-02 18:00:14 +02:00
csantosm 2fd764ce7c openvidu-components: Commented recording e2e test 2022-06-02 17:05:51 +02:00
cruizba e8fae9bf0f openvidu-test-e2e: Fix streamPropertyChangedEventTest race condition.
This supposedly fix a flaky test. If the event reaches before the viewport resolution is known, test would fail.
Now the viewport resolution is adquired in a new Thread and the resolution is not compared until the event
and viewport resolution are received
2022-06-02 15:12:04 +02:00
csantosm b80ca191e2 openvidu-components-e2e: added sleep after click button 2022-06-02 13:56:49 +02:00
csantosm 4a3865f419 github-actions: Fixed testapp url address 2022-06-02 13:32:14 +02:00
csantosm adf362f4e8 github-actions: added certs chrome flags 2022-06-02 13:21:18 +02:00
csantosm 86fdab922a github-actions: Launched openvidu-server with recording enabled 2022-06-02 12:49:54 +02:00
csantosm e65a6b7afe openvidu-components: Minor changes in recording panel view 2022-06-02 12:45:41 +02:00
csantosm 5754dcfd8f openvidu-components: Updated e2e test 2022-06-02 12:44:32 +02:00
csantosm 44110a6246 openvidu-components: Added recording
openvidu-components: Fixed recording directive name
2022-06-02 12:44:32 +02:00
cruizba 206a44d881 openvidu-test-e2e: Ignore videoDimensions event in filter event test. 2022-06-02 00:48:12 +02:00
cruizba 8b27191378 Jenkinsfile: Remove kurento-java skip tests 2022-06-01 18:32:31 +02:00
cruizba d6c430cd66 Jenkinsfile: Temporarly disable tests until kurento-java tests passes 2022-06-01 12:50:18 +02:00
cruizba f0bba6ee43 Jenkisfile: Move mvn_settings instead of copying 2022-06-01 11:24:39 +02:00
cruizba 49dc9e7df0 Jenkisfile: Get public kurento snapshots credential to download snapshots 2022-06-01 11:18:46 +02:00
cruizba bbb16189ef Jenkinsfile: use maven settings so snapshots can be downloaded. Build kurento mvn build snapshots with only one thread to avoid github packages download restrictions 2022-06-01 10:48:10 +02:00
csantosm 4af8be5a72 openvidu-components: Updated video poster styles 2022-06-01 10:01:05 +02:00
Carlos Ruiz Ballesteros f2f37ab42d
Merge pull request #722 from OpenVidu/kurento-6.18
Change to new API methods for Kurento release 6.18.0
2022-05-31 17:46:17 +02:00
cruizba a8fd0f8cf7 deployment: Prepare for kurento dev-6.18 2022-05-31 17:44:41 +02:00
csantosm 5fa3f749f5 openvidu-components: Added black poster when video is muted 2022-05-31 17:08:59 +02:00
csantosm 2785d3c036 Revert "openvidu-node-client: Updated rejected responses"
This reverts commit df7bd5f202.
2022-05-31 10:44:57 +02:00
cruizba f0f5f217bb openvidu-server: Missing add customIceServer in joinRoom response 2022-05-30 20:46:20 +02:00
cruizba 958eaee41d openvidu-server: Check nulls before setting default ICE servers in customIceServers 2022-05-30 20:40:10 +02:00
cruizba 789ff26cfc openvidu-server: Set default coturnIp and coturnPort in customIceServers at joinRoom RPC response, ONLY if customIceServers are not defined 2022-05-30 18:03:50 +02:00
csantosm e505cd6c8d openvidu-node-client: Downgraded dev dependencies 2022-05-30 13:17:40 +02:00
pabloFuente 8bb96d6912 Minor updates in README 2022-05-30 12:10:28 +02:00
pabloFuente 8d3fe2b681 Trigger recordingStarted event for new connected participants 2022-05-27 11:13:59 +02:00
csantosm df7bd5f202 openvidu-node-client: Updated rejected responses and dependencies
Old promises rejections return unusable responses to the client. Now they return the status code
2022-05-26 13:43:29 +02:00
Flamenco 75a484e831
Add space after period. 2022-05-20 13:15:33 -04:00
cruizba 75f4c6497f Fix update link error 2022-05-20 17:42:38 +02:00
pabloFuente bc1d1b7925 openvidu-server: allow missing parameter sdkVersion on RPC joinRoom 2022-05-20 14:13:59 +02:00
csantosm ad3ad30e86 openvidu-components: Added translations 2022-05-20 13:53:12 +02:00
csantosm cccf0474d1 openvidu-components: Hidden recording code in docs 2022-05-20 13:34:42 +02:00
pabloFuente 1766ae15c8 openvidu-components-angular: remove typo from method description 2022-05-20 12:43:53 +02:00
pabloFuente a64ccb03cf Fix AWS cli --createVolumePermission to --create-volume-permission 2022-05-13 17:19:42 +02:00
pabloFuente a4e10199bd Update docker-compose.yml tag versions to 2.22.0 2022-05-13 16:54:49 +02:00
pabloFuente ea6ea80f18 Update AMIs scripts 2022-05-13 16:35:03 +02:00
pabloFuente 7ccb53ab51 Update openvidu-components-angular to 2.22.0 2022-05-13 14:41:39 +02:00
pabloFuente d04a16a07b Update openvidu-components-angular package.json (openvidu-browser version) 2022-05-13 12:29:55 +02:00
pabloFuente d85bd79da9 Update OPENVIDU_UPGRADABLE_VERSION to 2.22 in installation scripts 2022-05-12 17:31:17 +02:00
Juan Navarro 3425e601bf Change to new API methods for Kurento release 6.18.0
* Old: MediaFlowOutStateChange
* New: MediaFlowOutStateChanged

* Old: MediaFlowInStateChange
* New: MediaFlowInStateChanged

* Old: MediaTranscodingStateChange
* New: MediaTranscodingStateChanged

* Old: OnIceCandidate
* New: IceCandidateFound

* Old: OnIceGatheringDone
* New: IceGatheringDone

* Old: OnIceComponentStateChanged, IceComponentStateChanges
* New: IceComponentStateChanged

* Old: OnDataChannelOpened, DataChannelOpens
* New: DataChannelOpened

* Old: OnDataChannelClosed, DataChannelClose
* New: DataChannelClosed
2022-05-03 17:21:23 +02:00
Juan Navarro 4ee20ed3ec pom.xml: Update to kurento-client 6.18.0-SNAPSHOT
Open up access to the new API methods that get introduced in the Kurento
Java client 6.18 development version.
2022-05-03 17:21:23 +02:00
1073 changed files with 100049 additions and 173645 deletions

View File

@ -1,52 +0,0 @@
name: openvidu-components-angular E2E
on:
push:
paths:
- 'openvidu-components-angular/**'
- 'openvidu-browser/**'
pull_request:
branches:
- master
workflow_dispatch:
jobs:
openvidu_angular_e2e:
name: E2E tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Run Selenium Chromedriver
run: docker run -d --shm-size="2g" --network host selenium/standalone-chrome:latest
- name: Run openvidu-server-kms
run: docker run -p 4443:4443 --rm -d -e OPENVIDU_SECRET=MY_SECRET openvidu/openvidu-server-kms:latest
- name: Build openvidu-browser
run: |
cd openvidu-browser
npm install
npm run build && npm pack
mv openvidu-browser-*.tgz ../openvidu-components-angular
- name: Install openvidu-browser
run: |
cd openvidu-components-angular
npm install openvidu-browser-*.tgz
- name: Install dependencies
run: npm install --prefix openvidu-components-angular
- name: Build openvidu-angular
run: npm run lib:build --prefix openvidu-components-angular
- name: Build openvidu-webcomponent
run: npm run webcomponent:build --prefix openvidu-components-angular
- name: Build openvidu-angular-testapp
run: npm run build --prefix openvidu-components-angular
- name: Serve openvidu-angular-testapp
run: npm run start-prod --prefix openvidu-components-angular &
- name: Run openvidu-angular E2E
run: npm run lib:e2e-ci --prefix openvidu-components-angular
- name: Serve Webcomponent Testapp
run: npm run webcomponent:serve-testapp --prefix openvidu-components-angular &
- name: Run Webcomponent E2E
run: npm run webcomponent:e2e-ci --prefix openvidu-components-angular

View File

@ -0,0 +1,445 @@
name: openvidu-components-angular Tests
on:
push:
branches:
- master
paths:
- 'openvidu-components-angular/**'
- '.github/workflows/openvidu-components-angular-tests.yml'
pull_request:
branches:
- master
workflow_dispatch:
inputs:
commit_sha:
description: 'Commit SHA'
required: false
default: ''
jobs:
test_setup:
name: Test setup
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Commit URL
run: echo https://github.com/OpenVidu/openvidu/commit/${{ inputs.commit_sha || github.sha }}
- name: Send Dispatch Event
env:
GITHUB_TOKEN: ${{ secrets.OPENVIDU_DISPATCH_EVENT_GA }}
COMMIT_MESSAGE: ${{ github.event.head_commit.message || 'Manually' }}
COMMIT_URL: ${{ github.event.commits[0].url || 'Manually' }}
BRANCH_NAME: ${{ github.ref_name }}
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
https://api.github.com/repos/OpenVidu/openvidu-call/dispatches \
-d '{"event_type":"openvidu-components-angular","client_payload":{"commit-message":"'"$COMMIT_MESSAGE"'","commit-ref":"'"$COMMIT_URL"'", "branch-name":"'"$BRANCH_NAME"'"}}'
nested_events:
needs: test_setup
name: Nested events
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Install dependencies
run: |
cd openvidu-components-angular
npm install
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run nested components E2E event tests
env:
LAUNCH_MODE: CI
run: npm run e2e:nested-events --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
nested_structural_directives:
needs: test_setup
name: Nested Structural Directives
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run nested structural directives tests
env:
LAUNCH_MODE: CI
run: npm run e2e:nested-structural-directives --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
nested_attribute_directives:
needs: test_setup
name: Nested Attribute Directives
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run nested attribute directives tests
env:
LAUNCH_MODE: CI
run: npm run e2e:nested-attribute-directives --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
e2e_directives:
needs: test_setup
name: API Directives Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:lib-directives --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
e2e_internal_directives:
needs: test_setup
name: Internal Directives Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:lib-internal-directives --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
e2e_chat:
needs: test_setup
name: Chat E2E
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:lib-chat --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
e2e_events:
needs: test_setup
name: Events E2E
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:lib-events --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
e2e_media_devices:
needs: test_setup
name: Media devices E2E
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:lib-media-devices --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
e2e_panels:
needs: test_setup
name: Panels E2E
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:lib-panels --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
e2e_screen_sharing:
needs: test_setup
name: Screen sharing E2E
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:lib-screensharing --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
e2e_stream:
needs: test_setup
name: Stream E2E
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -v $(pwd)/openvidu-components-angular/e2e/assets:/e2e-assets selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run Tests
env:
LAUNCH_MODE: CI
run: npm run e2e:lib-stream --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main
e2e_toolbar:
needs: test_setup
name: Toolbar E2E
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha || github.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install wait-on package
run: npm install -g wait-on
# - name: Run Browserless Chrome
# run: docker run -d -p 3000:3000 --network host browserless/chrome:1.57-chrome-stable
- name: Run Chrome
run: docker run --network=host -d -p 4444:4444 selenium/standalone-chrome:138.0
- name: Run openvidu-local-deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
- name: Start OpenVidu Call backend
uses: OpenVidu/actions/start-openvidu-call@main
- name: Build and Serve openvidu-components-angular Testapp
uses: OpenVidu/actions/start-openvidu-components-testapp@main
- name: Run Webcomponent E2E
env:
LAUNCH_MODE: CI
run: npm run e2e:lib-toolbar --prefix openvidu-components-angular
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main

View File

@ -0,0 +1,56 @@
name: OpenVidu integration tests
on:
push:
branches:
- master
paths:
- "openvidu-test-integration/**"
- ".github/workflows/openvidu-integration-tests.yml"
workflow_dispatch:
jobs:
integration-tests:
name: Integration tests
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Configure OpenVidu Local Deployment
uses: OpenVidu/actions/start-openvidu-local-deployment@main
with:
ref-openvidu-local-deployment: development
pre_startup_commands: |
sed -i 's/interval: 10s/interval: 1s/' livekit.yaml
sed -i '/interval: 1s/a \ fixer_interval: 10s' livekit.yaml
- name: Install LiveKit CLI
run: |
curl -sSL https://get.livekit.io/cli | bash
- name: Checkout current repository
uses: actions/checkout@v4
with:
path: openvidu
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
working-directory: ./openvidu/openvidu-test-integration
run: npm ci
- name: Run tests
working-directory: ./openvidu/openvidu-test-integration
run: npm run test:ci
- name: Upload report
uses: actions/upload-artifact@v4
if: always()
with:
name: openvidu-integration-tests-report
path: ./openvidu/openvidu-test-integration/test-results.json
retention-days: 7
- name: Cleanup
if: always()
uses: OpenVidu/actions/cleanup@main

4
.gitignore vendored
View File

@ -24,4 +24,6 @@ nbactions.xml
*/.project
*/.classpath
*/.settings/*
*/.tscache/*
*/.tscache/*
.factorypath

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "openvidu-livekit"]
path = openvidu-livekit
url = https://github.com/OpenVidu/openvidu-livekit.git

View File

@ -1,4 +1,6 @@
[![Backers on Open Collective](https://opencollective.com/openvidu/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/openvidu/sponsors/badge.svg)](#sponsors) [![License badge](https://img.shields.io/badge/license-Apache2-orange.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Backers on Open Collective](https://opencollective.com/openvidu/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/openvidu/sponsors/badge.svg)](#sponsors)
[![License badge](https://img.shields.io/badge/license-Apache2-orange.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![OpenVidu Tests](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-ce-test.yml/badge.svg)](https://github.com/OpenVidu/openvidu/actions/workflows/openvidu-ce-test.yml)
[![Npm version](https://img.shields.io/npm/v/openvidu-browser?label=npm-version)](https://npmjs.org/package/openvidu-browser)
[![Npm downloads](https://img.shields.io/npm/dw/openvidu-browser?label=npm2-downloads)](https://npmjs.org/package/openvidu-browser)
@ -33,6 +35,11 @@ Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com
<a href="https://opencollective.com/openvidu#backers" target="_blank"><img src="https://opencollective.com/openvidu/backers.svg?width=890"></a>
## Acknowledgments
OpenVidu has been supported under project "CPP2021-008720 NewGenVidu: An elastic, user-friendly and privacy-friendly videoconferencing platform", funded by MCIN/AEI/10.13039/501100011033 and by the European Union-NextGenerationEU/PRTR.
<img height="75px" src="https://docs.openvidu.io/en/stable/img/logos/support.jpg">
## Sponsors

View File

@ -1,25 +0,0 @@
# Next release
* IP Cameras support
* Angular version update in library and tutorials
* Ionic version update in tutorials
* Dynamic change of cluster size (PRO)
* On premises installation license management (PRO)
# Medium term
* Multiple streams per participant
* OpenVidu Call features for One to Many sessions
* Revamped documentation and tutorials
* Out of the box deployment in Azure, GCP and DO cloud providers
* Elasticity (auto-scaling) (PRO)
* Kubernetes support (PRO)
* Simulcast and SVC (PRO)
* Improved resource consumption (PRO)
# Long term
* Dynamic change of participant roles
* Granular permissions for participants
* P2P sessions with 2 participants (PRO)
* KurentoClient for advanced management of media sessions (PRO)
* RTMP, HLS and DASH support (PRO)
* Sessions migration between cluster nodes (for reduced resource consumption) (PRO)

View File

@ -1,62 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
docs/
lib/
static/*.js

View File

@ -1 +0,0 @@
docs/

View File

@ -1,201 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -1,7 +0,0 @@
#!/bin/bash
set -e
SEARCH_STRING_1="<K extends keyof SessionEventMap>(type: K,"
REPLACE_STRING_1="<K extends keyof SessionEventMap>(type: K | string,"
SEARCH_STRING_2='\[key: `signal:\${string}`\]: SignalEvent;'
sed -i "s~${SEARCH_STRING_1}~${REPLACE_STRING_1}~g" ts4.4/lib/OpenVidu/Session.d.ts
sed -i "/${SEARCH_STRING_2}/d" ts4.4/lib/OpenViduInternal/Events/EventMap/SessionEventMap.d.ts

View File

@ -1,20 +0,0 @@
{
"include": ["../src"],
"exclude": ["../config", "../docs", "../lib", "../node_modules", "../ts4.4"],
"typedocOptions": {
"name": "OpenVidu Browser",
"entryPoints": ["../src/index.ts"],
"out": "../docs",
"theme": "default",
"readme": "none",
"includeVersion": true,
"validation": {
"notExported": true,
"invalidLink": true
},
"excludeExternals": true,
"excludePrivate": true,
"excludeProtected": true,
"excludeInternal": true
}
}

View File

@ -1,154 +0,0 @@
{
"extends": "tslint:recommended",
"rules": {
"array-type": [
true,
"array"
],
"ban-types": {
"options": [
[
"Object",
"Avoid using the `Object` type. Did you mean `object`?"
],
[
"Function",
"Avoid using the `Function` type. Prefer a specific function type, like `() => void`, or use `ts.AnyFunction`."
],
[
"Boolean",
"Avoid using the `Boolean` type. Did you mean `boolean`?"
],
[
"Number",
"Avoid using the `Number` type. Did you mean `number`?"
],
[
"String",
"Avoid using the `String` type. Did you mean `string`?"
]
]
},
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": [
true,
"ignore-same-line"
],
"indent": [
true,
"spaces",
2
],
"interface-name": [
true,
"never-prefix"
],
"interface-over-type-literal": true,
"jsdoc-format": true,
"no-inferrable-types": true,
"no-internal-module": true,
"no-null-keyword": false,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": [
true,
"ignore-template-strings"
],
"no-var-keyword": true,
"object-literal-shorthand": true,
"one-line": [
true,
"check-open-brace",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single",
"avoid-escape",
"avoid-template"
],
"semicolon": [
true,
"always",
"ignore-bound-class-methods"
],
"space-within-parens": true,
"triple-equals": true,
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-type"
],
"no-implicit-dependencies": [
true,
"dev"
],
"object-literal-key-quotes": [
true,
"consistent-as-needed"
],
"variable-name": [
true,
"ban-keywords",
"check-format",
"allow-leading-underscore"
],
"arrow-parens": false,
"arrow-return-shorthand": false,
"forin": false,
"member-access": false,
"no-conditional-assignment": false,
"no-console": false,
"no-debugger": false,
"no-empty-interface": false,
"no-eval": false,
"no-object-literal-type-assertion": false,
"no-shadowed-variable": false,
"no-submodule-imports": false,
"no-var-requires": false,
"ordered-imports": false,
"prefer-conditional-expression": false,
"radix": false,
"trailing-comma": false,
"align": false,
"eofline": false,
"max-line-length": false,
"no-consecutive-blank-lines": false,
"space-before-function-paren": false,
"ban-comma-operator": false,
"max-classes-per-file": false,
"member-ordering": false,
"no-angle-bracket-type-assertion": false,
"no-bitwise": false,
"no-namespace": false,
"no-reference": false,
"object-literal-sort-keys": false,
"one-variable-per-declaration": false,
"unified-signatures": false
}
}

View File

@ -1,19 +0,0 @@
#!/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 --tsconfig ./config/tsconfig.json
# 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

File diff suppressed because it is too large Load Diff

View File

@ -1,57 +0,0 @@
{
"author": "OpenVidu",
"dependencies": {
"freeice": "2.2.2",
"hark": "1.2.3",
"jsnlog": "2.30.0",
"mime": "3.0.0",
"platform": "1.3.6",
"semver": "7.3.5",
"uuid": "8.3.2",
"wolfy87-eventemitter": "5.2.9",
"events": "3.3.0",
"inherits": "2.0.4"
},
"description": "OpenVidu Browser",
"devDependencies": {
"@types/node": "17.0.8",
"@types/platform": "1.3.4",
"browserify": "17.0.0",
"grunt": "1.4.1",
"grunt-cli": "1.4.3",
"grunt-contrib-copy": "1.0.0",
"grunt-contrib-sass": "2.0.0",
"grunt-contrib-uglify": "5.0.1",
"grunt-contrib-watch": "1.1.0",
"grunt-postcss": "0.9.0",
"grunt-string-replace": "1.3.1",
"grunt-ts": "6.0.0-beta.22",
"terser": "5.10.0",
"tsify": "5.0.4",
"tslint": "6.1.3",
"typedoc": "0.22.10",
"typescript": "4.5.4"
},
"license": "Apache-2.0",
"main": "lib/index.js",
"name": "openvidu-browser",
"repository": {
"type": "git",
"url": "git://github.com/OpenVidu/openvidu"
},
"scripts": {
"browserify": "VERSION=${VERSION:-dev}; mkdir -p static/js/ && 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}; mkdir -p static/js/ && cd src && ../node_modules/browserify/bin/cmd.js --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | ../node_modules/terser/bin/terser --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 --target es5 --lib dom,es5,es2015.promise,scripthost && rm -rf ./ts4.4 && mkdir -p ./ts4.4/lib && cp -r ./lib ./ts4.4 && find ./ts4.4/lib -type f ! -iname '*.d.ts' -delete && ./config/replace_for_ts44.sh",
"docs": "./generate-docs.sh"
},
"types": "lib/index.d.ts",
"typesVersions": {
"<4.4": {
"*": [
"ts4.4/*"
]
}
},
"version": "2.22.0"
}

View File

@ -1,9 +0,0 @@
import { OpenVidu } from './OpenVidu/OpenVidu';
import { JL } from 'jsnlog';
if (window) {
window['OpenVidu'] = OpenVidu;
}
// Disable jsnlog when library is loaded
JL.setOptions({ enabled: false })

View File

@ -1,206 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Session } from './Session';
import { Stream } from './Stream';
import { LocalConnectionOptions } from '../OpenViduInternal/Interfaces/Private/LocalConnectionOptions';
import { RemoteConnectionOptions } from '../OpenViduInternal/Interfaces/Private/RemoteConnectionOptions';
import { InboundStreamOptions } from '../OpenViduInternal/Interfaces/Private/InboundStreamOptions';
import { StreamOptionsServer } from '../OpenViduInternal/Interfaces/Private/StreamOptionsServer';
import { OpenViduLogger } from '../OpenViduInternal/Logger/OpenViduLogger';
import { ExceptionEvent, ExceptionEventName } from '../OpenViduInternal/Events/ExceptionEvent';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* Represents each one of the user's connection to the session (the local one and other user's connections).
* Therefore each [[Session]] and [[Stream]] object has an attribute of type Connection
*/
export class Connection {
/**
* Unique identifier of the connection
*/
connectionId: string;
/**
* Time when this connection was created in OpenVidu Server (UTC milliseconds)
*/
creationTime: number;
/**
* Data associated to this connection (and therefore to certain user). This is an important field:
* it allows you to broadcast all the information you want for each user (a username, for example)
*/
data: string;
/**
* Role of the connection.
* - `SUBSCRIBER`: can subscribe to published Streams of other users by calling [[Session.subscribe]]
* - `PUBLISHER`: SUBSCRIBER permissions + can publish their own Streams by calling [[Session.publish]]
* - `MODERATOR`: SUBSCRIBER + PUBLISHER permissions + can force the unpublishing or disconnection over a third-party Stream or Connection by call [[Session.forceUnpublish]] and [[Session.forceDisconnect]]
*
* **Only defined for the local connection. In remote connections will be `undefined`**
*/
role: string;
/**
* Whether the streams published by this Connection will be recorded or not. This only affects [INDIVIDUAL recording](/en/stable/advanced-features/recording/#individual-recording-selection) <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" style="display: inline-block; background-color: rgb(0, 136, 170); color: white; font-weight: bold; padding: 0px 5px; margin-right: 5px; border-radius: 3px; font-size: 13px; line-height:21px; font-family: Montserrat, sans-serif">PRO</a>
*
* **Only defined for the local connection. In remote connections will be `undefined`**
*/
record: boolean;
/**
* @hidden
*/
stream?: Stream;
/**
* @hidden
*/
localOptions: LocalConnectionOptions | undefined;
/**
* @hidden
*/
remoteOptions: RemoteConnectionOptions | undefined;
/**
* @hidden
*/
disposed = false;
/**
* @hidden
*/
rpcSessionId: string;
/**
* @hidden
*/
constructor(private session: Session, connectionOptions: LocalConnectionOptions | RemoteConnectionOptions) {
let msg = "'Connection' created ";
if (!!(<LocalConnectionOptions>connectionOptions).role) {
// Connection is local
this.localOptions = <LocalConnectionOptions>connectionOptions;
this.connectionId = this.localOptions.id;
this.creationTime = this.localOptions.createdAt;
this.data = this.localOptions.metadata;
this.rpcSessionId = this.localOptions.sessionId;
this.role = this.localOptions.role;
this.record = this.localOptions.record;
msg += '(local)';
} else {
// Connection is remote
this.remoteOptions = <RemoteConnectionOptions>connectionOptions;
this.connectionId = this.remoteOptions.id;
this.creationTime = this.remoteOptions.createdAt;
if (this.remoteOptions.metadata) {
this.data = this.remoteOptions.metadata;
}
if (this.remoteOptions.streams) {
this.initRemoteStreams(this.remoteOptions.streams);
}
msg += "(remote) with 'connectionId' [" + this.remoteOptions.id + ']';
}
logger.info(msg);
}
/* Hidden methods */
/**
* @hidden
*/
sendIceCandidate(candidate: RTCIceCandidate): void {
logger.debug((!!this.stream!.outboundStreamOpts ? 'Local' : 'Remote') + 'candidate for' +
this.connectionId, candidate);
this.session.openvidu.sendRequest('onIceCandidate', {
endpointName: this.connectionId,
candidate: candidate.candidate,
sdpMid: candidate.sdpMid,
sdpMLineIndex: candidate.sdpMLineIndex
}, (error, response) => {
if (error) {
logger.error('Error sending ICE candidate: ' + JSON.stringify(error));
this.session.emitEvent('exception', [new ExceptionEvent(this.session, ExceptionEventName.ICE_CANDIDATE_ERROR, this.session, "There was an unexpected error on the server-side processing an ICE candidate generated and sent by the client-side", error)]);
}
});
}
/**
* @hidden
*/
initRemoteStreams(options: StreamOptionsServer[]): void {
// This is ready for supporting multiple streams per Connection object. Right now the loop will always run just once
// this.stream should also be replaced by a collection of streams to support multiple streams per Connection
options.forEach(opts => {
const streamOptions: InboundStreamOptions = {
id: opts.id,
createdAt: opts.createdAt,
connection: this,
hasAudio: opts.hasAudio,
hasVideo: opts.hasVideo,
audioActive: opts.audioActive,
videoActive: opts.videoActive,
typeOfVideo: opts.typeOfVideo,
frameRate: opts.frameRate,
videoDimensions: !!opts.videoDimensions ? JSON.parse(opts.videoDimensions) : undefined,
filter: !!opts.filter ? opts.filter : undefined
};
const stream = new Stream(this.session, streamOptions);
this.addStream(stream);
});
logger.info("Remote 'Connection' with 'connectionId' [" + this.connectionId + '] is now configured for receiving Streams with options: ', this.stream!.inboundStreamOpts);
}
/**
* @hidden
*/
addStream(stream: Stream): void {
stream.connection = this;
this.stream = stream;
}
/**
* @hidden
*/
removeStream(streamId: string): void {
delete this.stream;
}
/**
* @hidden
*/
dispose(): void {
if (!!this.stream) {
delete this.stream;
}
this.disposed = true;
}
}

View File

@ -1,114 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event as Event } from '../OpenViduInternal/Events/Event';
import { EventMap } from '../OpenViduInternal/Events/EventMap/EventMap';
import EventEmitter = require('wolfy87-eventemitter');
import { OpenViduLogger } from '../OpenViduInternal/Logger/OpenViduLogger';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
export abstract class EventDispatcher {
/**
* @hidden
*/
userHandlerArrowHandler: WeakMap<(event: Event) => void, (event: Event) => void> = new WeakMap();
/**
* @hidden
*/
ee = new EventEmitter();
/**
* Adds function `handler` to handle event `type`
*
* @returns The EventDispatcher object
*/
abstract on<K extends keyof (EventMap)>(type: K, handler: (event: (EventMap)[K]) => void): this;
/**
* Adds function `handler` to handle event `type` just once. The handler will be automatically removed after first execution
*
* @returns The object that dispatched the event
*/
abstract once<K extends keyof (EventMap)>(type: K, handler: (event: (EventMap)[K]) => void): this;
/**
* Removes a `handler` from event `type`. If no handler is provided, all handlers will be removed from the event
*
* @returns The object that dispatched the event
*/
abstract off<K extends keyof (EventMap)>(type: K, handler?: (event: (EventMap)[K]) => void): this;
/**
* @hidden
*/
onAux(type: string, message: string, handler: (event: Event) => void): EventDispatcher {
const arrowHandler = event => {
if (event) {
logger.info(message, event);
} else {
logger.info(message);
}
handler(event);
};
this.userHandlerArrowHandler.set(handler, arrowHandler);
this.ee.on(type, arrowHandler);
return this;
}
/**
* @hidden
*/
onceAux(type: string, message: string, handler: (event: Event) => void): EventDispatcher {
const arrowHandler = event => {
if (event) {
logger.info(message, event);
} else {
logger.info(message);
}
handler(event);
// Remove handler from map after first and only execution
this.userHandlerArrowHandler.delete(handler);
};
this.userHandlerArrowHandler.set(handler, arrowHandler);
this.ee.once(type, arrowHandler);
return this;
}
/**
* @hidden
*/
offAux(type: string, handler?: (event: Event) => void): EventDispatcher {
if (!handler) {
this.ee.removeAllListeners(type);
} else {
// Must remove internal arrow function handler paired with user handler
const arrowHandler = this.userHandlerArrowHandler.get(handler);
if (!!arrowHandler) {
this.ee.off(type, arrowHandler);
}
this.userHandlerArrowHandler.delete(handler);
}
return this;
}
}

View File

@ -1,241 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Stream } from './Stream';
import { FilterEvent } from '../OpenViduInternal/Events/FilterEvent';
import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent';
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError';
import { OpenViduLogger } from '../OpenViduInternal/Logger/OpenViduLogger';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* **WARNING**: experimental option. This interface may change in the near future
*
* Video/audio filter applied to a Stream. See [[Stream.applyFilter]]
*/
export class Filter {
/**
* Type of filter applied. This is the name of the remote class identifying the filter to apply in Kurento Media Server.
* For example: `"FaceOverlayFilter"`, `"GStreamerFilter"`.
*
* You can get this property in `*.kmd.json` files defining the Kurento filters. For example, for GStreamerFilter that's
* [here](https://github.com/Kurento/kms-filters/blob/53a452fac71d61795952e3d2202156c6b00f6d65/src/server/interface/filters.GStreamerFilter.kmd.json#L4)
*/
type: string;
/**
* Parameters used to initialize the filter.
* These correspond to the constructor parameters used in the filter in Kurento Media Server (except for `mediaPipeline` parameter, which is never needed).
*
* For example: for `filter.type = "GStreamerFilter"` could be `filter.options = {"command": "videobalance saturation=0.0"}`
*
* You can get this property in `*.kmd.json` files defining the Kurento filters. For example, for GStreamerFilter that's
* [here](https://github.com/Kurento/kms-filters/blob/53a452fac71d61795952e3d2202156c6b00f6d65/src/server/interface/filters.GStreamerFilter.kmd.json#L13-L31)
*/
options: Object;
/**
* Value passed the last time [[Filter.execMethod]] was called. If `undefined` this method has not been called yet.
*
* You can use this value to know the current status of any applied filter
*/
lastExecMethod?: {
method: string, params: Object
};
/**
* @hidden
*/
handlers: Map<string, (event: FilterEvent) => void> = new Map();
/**
* @hidden
*/
stream: Stream;
private logger: OpenViduLogger;
/**
* @hidden
*/
constructor(type: string, options: Object) {
this.type = type;
this.options = options;
}
/**
* Executes a filter method. Available methods are specific for each filter
*
* @param method Name of the method
* @param params Parameters of the method
*/
execMethod(method: string, params: Object): Promise<void> {
return new Promise((resolve, reject) => {
logger.info('Executing filter method to stream ' + this.stream.streamId);
let finalParams;
const successExecMethod = triggerEvent => {
logger.info('Filter method successfully executed on Stream ' + this.stream.streamId);
const oldValue = (<any>Object).assign({}, this.stream.filter);
this.stream.filter!.lastExecMethod = { method, params: finalParams };
if (triggerEvent) {
this.stream.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this.stream.session, this.stream, 'filter', this.stream.filter!, oldValue, 'execFilterMethod')]);
this.stream.streamManager.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this.stream.streamManager, this.stream, 'filter', this.stream.filter!, oldValue, 'execFilterMethod')]);
}
return resolve();
}
if (this.type.startsWith('VB:')) {
if (typeof params === 'string') {
try {
params = JSON.parse(params);
} catch (error) {
return reject(new OpenViduError(OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR, 'Wrong params syntax: ' + error));
}
}
finalParams = params;
if (method === 'update') {
if (!this.stream.virtualBackgroundSinkElements?.VB) {
return reject(new OpenViduError(OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR, 'There is no Virtual Background filter applied'));
} else {
this.stream.virtualBackgroundSinkElements.VB.updateValues(params)
.then(() => successExecMethod(false))
.catch(error => {
if (error.name === OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR) {
return reject(new OpenViduError(error.name, error.message));
} else {
return reject(new OpenViduError(OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR, 'Error updating values on Virtual Background filter: ' + error));
}
});
}
} else {
return reject(new OpenViduError(OpenViduErrorName.VIRTUAL_BACKGROUND_ERROR, `Unknown Virtual Background method "${method}"`));
}
} else {
let stringParams;
if (typeof params !== 'string') {
try {
stringParams = JSON.stringify(params);
} catch (error) {
const errorMsg = "'params' property must be a JSON formatted object";
logger.error(errorMsg);
return reject(errorMsg);
}
} else {
stringParams = <string>params;
}
finalParams = stringParams;
this.stream.session.openvidu.sendRequest(
'execFilterMethod',
{ streamId: this.stream.streamId, method, params: stringParams },
(error, response) => {
if (error) {
logger.error('Error executing filter method for Stream ' + this.stream.streamId, error);
if (error.code === 401) {
return reject(new OpenViduError(OpenViduErrorName.OPENVIDU_PERMISSION_DENIED, "You don't have permissions to execute a filter method"));
} else {
return reject(error);
}
} else {
return successExecMethod(true);
}
}
);
}
});
}
/**
* Subscribe to certain filter event. Available events are specific for each filter
*
* @param eventType Event to which subscribe to.
* @param handler Function to execute upon event dispatched. It receives as parameter a [[FilterEvent]] object
*
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the event listener was successfully attached to the filter and rejected with an Error object if not
*/
addEventListener(eventType: string, handler: (event: FilterEvent) => void): Promise<void> {
return new Promise((resolve, reject) => {
logger.info('Adding filter event listener to event ' + eventType + ' to stream ' + this.stream.streamId);
this.stream.session.openvidu.sendRequest(
'addFilterEventListener',
{ streamId: this.stream.streamId, eventType },
(error, response) => {
if (error) {
logger.error('Error adding filter event listener to event ' + eventType + 'for Stream ' + this.stream.streamId, error);
if (error.code === 401) {
return reject(new OpenViduError(OpenViduErrorName.OPENVIDU_PERMISSION_DENIED, "You don't have permissions to add a filter event listener"));
} else {
return reject(error);
}
} else {
this.handlers.set(eventType, handler);
logger.info('Filter event listener to event ' + eventType + ' successfully applied on Stream ' + this.stream.streamId);
return resolve();
}
}
);
});
}
/**
* Removes certain filter event listener previously set.
*
* @param eventType Event to unsubscribe from.
*
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the event listener was successfully removed from the filter and rejected with an Error object in other case
*/
removeEventListener(eventType: string): Promise<void> {
return new Promise((resolve, reject) => {
logger.info('Removing filter event listener to event ' + eventType + ' to stream ' + this.stream.streamId);
this.stream.session.openvidu.sendRequest(
'removeFilterEventListener',
{ streamId: this.stream.streamId, eventType },
(error, response) => {
if (error) {
logger.error('Error removing filter event listener to event ' + eventType + 'for Stream ' + this.stream.streamId, error);
if (error.code === 401) {
return reject(new OpenViduError(OpenViduErrorName.OPENVIDU_PERMISSION_DENIED, "You don't have permissions to add a filter event listener"));
} else {
return reject(error);
}
} else {
this.handlers.delete(eventType);
logger.info('Filter event listener to event ' + eventType + ' successfully removed on Stream ' + this.stream.streamId);
return resolve();
}
}
);
});
}
}

View File

@ -1,385 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Stream } from './Stream';
import { LocalRecorderState } from '../OpenViduInternal/Enums/LocalRecorderState';
import { OpenViduLogger } from '../OpenViduInternal/Logger/OpenViduLogger';
import { PlatformUtils } from '../OpenViduInternal/Utils/Platform';
import Mime = require('mime/lite');
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* @hidden
*/
let platform: PlatformUtils;
/**
* Easy recording of [[Stream]] objects straightaway from the browser. Initialized with [[OpenVidu.initLocalRecorder]] method
*/
export class LocalRecorder {
state: LocalRecorderState;
private connectionId: string;
private mediaRecorder: MediaRecorder;
private chunks: any[] = [];
private blob?: Blob;
private id: string;
private videoPreviewSrc: string;
private videoPreview: HTMLVideoElement;
/**
* @hidden
*/
constructor(private stream: Stream) {
platform = PlatformUtils.getInstance();
this.connectionId = (!!this.stream.connection) ? this.stream.connection.connectionId : 'default-connection';
this.id = this.stream.streamId + '_' + this.connectionId + '_localrecord';
this.state = LocalRecorderState.READY;
}
/**
* Starts the recording of the Stream. [[state]] property must be `READY`. After method succeeds is set to `RECORDING`
*
* @param options The [MediaRecorder.options](https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/MediaRecorder#parameters) to be used to record this Stream.
* For example:
*
* ```javascript
* var OV = new OpenVidu();
* var publisher = await OV.initPublisherAsync();
* var localRecorder = OV.initLocalRecorder(publisher.stream);
* var options = {
* mimeType: 'video/webm;codecs=vp8',
* audioBitsPerSecond:128000,
* videoBitsPerSecond:2500000
* };
* localRecorder.record(options);
* ```
*
* If not specified, the default options preferred by the platform will be used.
*
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording successfully started and rejected with an Error object if not
*/
record(options?: any): Promise<void> {
return new Promise((resolve, reject) => {
try {
if (typeof options === 'string' || options instanceof String) {
return reject(`When calling LocalRecorder.record(options) parameter 'options' cannot be a string. Must be an object like { mimeType: "${options}" }`);
}
if (typeof MediaRecorder === 'undefined') {
logger.error('MediaRecorder not supported on your device. See compatibility in https://caniuse.com/#search=MediaRecorder');
throw (Error('MediaRecorder not supported on your device. See compatibility in https://caniuse.com/#search=MediaRecorder'));
}
if (this.state !== LocalRecorderState.READY) {
throw (Error('\'LocalRecord.record()\' needs \'LocalRecord.state\' to be \'READY\' (current value: \'' + this.state + '\'). Call \'LocalRecorder.clean()\' or init a new LocalRecorder before'));
}
logger.log("Starting local recording of stream '" + this.stream.streamId + "' of connection '" + this.connectionId + "'");
if (!options) {
options = { mimeType: 'video/webm' };
} else if (!options.mimeType) {
options.mimeType = 'video/webm';
}
this.mediaRecorder = new MediaRecorder(this.stream.getMediaStream(), options);
this.mediaRecorder.start();
} catch (err) {
return reject(err);
}
this.mediaRecorder.ondataavailable = (e) => {
if (e.data.size > 0) {
this.chunks.push(e.data);
}
};
this.mediaRecorder.onerror = (e) => {
logger.error('MediaRecorder error: ', e);
};
this.mediaRecorder.onstart = () => {
logger.log('MediaRecorder started (state=' + this.mediaRecorder.state + ')');
};
this.mediaRecorder.onstop = () => {
this.onStopDefault();
};
this.mediaRecorder.onpause = () => {
logger.log('MediaRecorder paused (state=' + this.mediaRecorder.state + ')');
};
this.mediaRecorder.onresume = () => {
logger.log('MediaRecorder resumed (state=' + this.mediaRecorder.state + ')');
};
this.state = LocalRecorderState.RECORDING;
return resolve();
});
}
/**
* Ends the recording of the Stream. [[state]] property must be `RECORDING` or `PAUSED`. After method succeeds is set to `FINISHED`
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording successfully stopped and rejected with an Error object if not
*/
stop(): Promise<void> {
return new Promise((resolve, reject) => {
try {
if (this.state === LocalRecorderState.READY || this.state === LocalRecorderState.FINISHED) {
throw (Error('\'LocalRecord.stop()\' needs \'LocalRecord.state\' to be \'RECORDING\' or \'PAUSED\' (current value: \'' + this.state + '\'). Call \'LocalRecorder.start()\' before'));
}
this.mediaRecorder.onstop = () => {
this.onStopDefault();
return resolve();
};
this.mediaRecorder.stop();
} catch (e) {
return reject(e);
}
});
}
/**
* Pauses the recording of the Stream. [[state]] property must be `RECORDING`. After method succeeds is set to `PAUSED`
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording was successfully paused and rejected with an Error object if not
*/
pause(): Promise<void> {
return new Promise((resolve, reject) => {
try {
if (this.state !== LocalRecorderState.RECORDING) {
return reject(Error('\'LocalRecord.pause()\' needs \'LocalRecord.state\' to be \'RECORDING\' (current value: \'' + this.state + '\'). Call \'LocalRecorder.start()\' or \'LocalRecorder.resume()\' before'));
}
this.mediaRecorder.pause();
this.state = LocalRecorderState.PAUSED;
return resolve();
} catch (error) {
return reject(error);
}
});
}
/**
* Resumes the recording of the Stream. [[state]] property must be `PAUSED`. After method succeeds is set to `RECORDING`
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the recording was successfully resumed and rejected with an Error object if not
*/
resume(): Promise<void> {
return new Promise((resolve, reject) => {
try {
if (this.state !== LocalRecorderState.PAUSED) {
throw (Error('\'LocalRecord.resume()\' needs \'LocalRecord.state\' to be \'PAUSED\' (current value: \'' + this.state + '\'). Call \'LocalRecorder.pause()\' before'));
}
this.mediaRecorder.resume();
this.state = LocalRecorderState.RECORDING;
return resolve();
} catch (error) {
return reject(error);
}
});
}
/**
* Previews the recording, appending a new HTMLVideoElement to element with id `parentId`. [[state]] property must be `FINISHED`
*/
preview(parentElement): HTMLVideoElement {
if (this.state !== LocalRecorderState.FINISHED) {
throw (Error('\'LocalRecord.preview()\' needs \'LocalRecord.state\' to be \'FINISHED\' (current value: \'' + this.state + '\'). Call \'LocalRecorder.stop()\' before'));
}
this.videoPreview = document.createElement('video');
this.videoPreview.id = this.id;
this.videoPreview.autoplay = true;
if (platform.isSafariBrowser()) {
this.videoPreview.setAttribute('playsinline', 'true');
}
if (typeof parentElement === 'string') {
const parentElementDom = document.getElementById(parentElement);
if (parentElementDom) {
this.videoPreview = parentElementDom.appendChild(this.videoPreview);
}
} else {
this.videoPreview = parentElement.appendChild(this.videoPreview);
}
this.videoPreview.src = this.videoPreviewSrc;
return this.videoPreview;
}
/**
* Gracefully stops and cleans the current recording (WARNING: it is completely dismissed). Sets [[state]] to `READY` so the recording can start again
*/
clean(): void {
const f = () => {
delete this.blob;
this.chunks = [];
this.state = LocalRecorderState.READY;
};
if (this.state === LocalRecorderState.RECORDING || this.state === LocalRecorderState.PAUSED) {
this.stop().then(() => f()).catch(() => f());
} else {
f();
}
}
/**
* Downloads the recorded video through the browser. [[state]] property must be `FINISHED`
*/
download(): void {
if (this.state !== LocalRecorderState.FINISHED) {
throw (Error('\'LocalRecord.download()\' needs \'LocalRecord.state\' to be \'FINISHED\' (current value: \'' + this.state + '\'). Call \'LocalRecorder.stop()\' before'));
} else {
const a: HTMLAnchorElement = document.createElement('a');
a.style.display = 'none';
document.body.appendChild(a);
const url = window.URL.createObjectURL(<any>this.blob);
a.href = url;
a.download = this.id + '.' + Mime.getExtension(this.blob!.type);
a.click();
window.URL.revokeObjectURL(url);
document.body.removeChild(a);
}
}
/**
* Gets the raw Blob file. Methods preview, download, uploadAsBinary and uploadAsMultipartfile use this same file to perform their specific actions. [[state]] property must be `FINISHED`
*/
getBlob(): Blob {
if (this.state !== LocalRecorderState.FINISHED) {
throw (Error('Call \'LocalRecord.stop()\' before getting Blob file'));
} else {
return this.blob!;
}
}
/**
* Uploads the recorded video as a binary file performing an HTTP/POST operation to URL `endpoint`. [[state]] property must be `FINISHED`. Optional HTTP headers can be passed as second parameter. For example:
* ```
* var headers = {
* "Cookie": "$Version=1; Skin=new;",
* "Authorization":"Basic QWxhZGpbjpuIHNlctZQ=="
* }
* ```
* @returns A Promise (to which you can optionally subscribe to) that is resolved with the `http.responseText` from server if the operation was successful and rejected with the failed `http.status` if not
*/
uploadAsBinary(endpoint: string, headers?: any): Promise<any> {
return new Promise((resolve, reject) => {
if (this.state !== LocalRecorderState.FINISHED) {
return reject(Error('\'LocalRecord.uploadAsBinary()\' needs \'LocalRecord.state\' to be \'FINISHED\' (current value: \'' + this.state + '\'). Call \'LocalRecorder.stop()\' before'));
} else {
const http = new XMLHttpRequest();
http.open('POST', endpoint, true);
if (typeof headers === 'object') {
for (const key of Object.keys(headers)) {
http.setRequestHeader(key, headers[key]);
}
}
http.onreadystatechange = () => {
if (http.readyState === 4) {
if (http.status.toString().charAt(0) === '2') {
// Success response from server (HTTP status standard: 2XX is success)
return resolve(http.responseText);
} else {
return reject(http.status);
}
}
};
http.send(this.blob);
}
});
}
/**
* Uploads the recorded video as a multipart file performing an HTTP/POST operation to URL `endpoint`. [[state]] property must be `FINISHED`. Optional HTTP headers can be passed as second parameter. For example:
* ```
* var headers = {
* "Cookie": "$Version=1; Skin=new;",
* "Authorization":"Basic QWxhZGpbjpuIHNlctZQ=="
* }
* ```
* @returns A Promise (to which you can optionally subscribe to) that is resolved with the `http.responseText` from server if the operation was successful and rejected with the failed `http.status` if not:
*/
uploadAsMultipartfile(endpoint: string, headers?: any): Promise<any> {
return new Promise((resolve, reject) => {
if (this.state !== LocalRecorderState.FINISHED) {
return reject(Error('\'LocalRecord.uploadAsMultipartfile()\' needs \'LocalRecord.state\' to be \'FINISHED\' (current value: \'' + this.state + '\'). Call \'LocalRecorder.stop()\' before'));
} else {
const http = new XMLHttpRequest();
http.open('POST', endpoint, true);
if (typeof headers === 'object') {
for (const key of Object.keys(headers)) {
http.setRequestHeader(key, headers[key]);
}
}
const sendable = new FormData();
sendable.append('file', this.blob!, this.id + '.' + Mime.getExtension(this.blob!.type));
http.onreadystatechange = () => {
if (http.readyState === 4) {
if (http.status.toString().charAt(0) === '2') {
// Success response from server (HTTP status standard: 2XX is success)
return resolve(http.responseText);
} else {
return reject(http.status);
}
}
};
http.send(sendable);
}
});
}
/* Private methods */
private onStopDefault(): void {
logger.log('MediaRecorder stopped (state=' + this.mediaRecorder.state + ')');
this.blob = new Blob(this.chunks, { type: this.mediaRecorder.mimeType });
this.chunks = [];
this.videoPreviewSrc = window.URL.createObjectURL(this.blob);
this.state = LocalRecorderState.FINISHED;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,814 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { OpenVidu } from './OpenVidu';
import { Session } from './Session';
import { Stream } from './Stream';
import { StreamManager } from './StreamManager';
import { PublisherProperties } from '../OpenViduInternal/Interfaces/Public/PublisherProperties';
import { PublisherEventMap } from '../OpenViduInternal/Events/EventMap/PublisherEventMap';
import { StreamEvent } from '../OpenViduInternal/Events/StreamEvent';
import { StreamPropertyChangedEvent } from '../OpenViduInternal/Events/StreamPropertyChangedEvent';
import { OpenViduError, OpenViduErrorName } from '../OpenViduInternal/Enums/OpenViduError';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import { OpenViduLogger } from '../OpenViduInternal/Logger/OpenViduLogger';
import { PlatformUtils } from '../OpenViduInternal/Utils/Platform';
import { TypeOfVideo } from '../OpenViduInternal/Enums/TypeOfVideo';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* @hidden
*/
let platform: PlatformUtils;
/**
* Packs local media streams. Participants can publish it to a session. Initialized with [[OpenVidu.initPublisher]] method.
*
* See available event listeners at [[PublisherEventMap]].
*/
export class Publisher extends StreamManager {
/**
* Whether the Publisher has been granted access to the requested input devices or not
*/
accessAllowed = false;
/**
* Whether you have called [[Publisher.subscribeToRemote]] with value `true` or `false` (*false* by default)
*/
isSubscribedToRemote = false;
/**
* The [[Session]] to which the Publisher belongs
*/
session: Session; // Initialized by Session.publish(Publisher)
private accessDenied = false;
protected properties: PublisherProperties;
private permissionDialogTimeout: NodeJS.Timer;
/**
* @hidden
*/
openvidu: OpenVidu;
/**
* @hidden
*/
videoReference: HTMLVideoElement;
/**
* @hidden
*/
screenShareResizeInterval: NodeJS.Timer;
/**
* @hidden
*/
constructor(targEl: string | HTMLElement, properties: PublisherProperties, openvidu: OpenVidu) {
super(new Stream((!!openvidu.session) ? openvidu.session : new Session(openvidu), { publisherProperties: properties, mediaConstraints: {} }), targEl);
platform = PlatformUtils.getInstance();
this.properties = properties;
this.openvidu = openvidu;
this.stream.ee.on('local-stream-destroyed', (reason: string) => {
this.stream.isLocalStreamPublished = false;
const streamEvent = new StreamEvent(true, this, 'streamDestroyed', this.stream, reason);
this.emitEvent('streamDestroyed', [streamEvent]);
streamEvent.callDefaultBehavior();
});
}
/**
* Publish or unpublish the audio stream (if available). Calling this method twice in a row passing same `enabled` value will have no effect
*
* #### Events dispatched
*
* > _Only if `Session.publish(Publisher)` has been called for this Publisher_
*
* The [[Session]] object of the local participant will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"audioActive"` and `reason` set to `"publishAudio"`
* The [[Publisher]] object of the local participant will also dispatch the exact same event
*
* The [[Session]] object of every other participant connected to the session will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"audioActive"` and `reason` set to `"publishAudio"`
* The respective [[Subscriber]] object of every other participant receiving this Publisher's stream will also dispatch the exact same event
*
* See [[StreamPropertyChangedEvent]] to learn more.
*
* @param enabled `true` to publish the audio stream, `false` to unpublish it
*/
publishAudio(enabled: boolean): void {
if (this.stream.audioActive !== enabled) {
const affectedMediaStream: MediaStream = this.stream.displayMyRemote() ? this.stream.localMediaStreamWhenSubscribedToRemote! : this.stream.getMediaStream();
affectedMediaStream.getAudioTracks().forEach((track) => {
track.enabled = enabled;
});
if (!!this.session && !!this.stream.streamId) {
this.session.openvidu.sendRequest(
'streamPropertyChanged',
{
streamId: this.stream.streamId,
property: 'audioActive',
newValue: enabled,
reason: 'publishAudio'
},
(error, response) => {
if (error) {
logger.error("Error sending 'streamPropertyChanged' event", error);
} else {
this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this.session, this.stream, 'audioActive', enabled, !enabled, 'publishAudio')]);
this.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this, this.stream, 'audioActive', enabled, !enabled, 'publishAudio')]);
this.session.sendVideoData(this.stream.streamManager);
}
});
}
this.stream.audioActive = enabled;
logger.info("'Publisher' has " + (enabled ? 'published' : 'unpublished') + ' its audio stream');
}
}
/**
* Publish or unpublish the video stream (if available). Calling this method twice in a row passing same `enabled` value will have no effect
*
* #### Events dispatched
*
* > _Only if `Session.publish(Publisher)` has been called for this Publisher_
*
* The [[Session]] object of the local participant will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"videoActive"` and `reason` set to `"publishVideo"`
* The [[Publisher]] object of the local participant will also dispatch the exact same event
*
* The [[Session]] object of every other participant connected to the session will dispatch a `streamPropertyChanged` event with `changedProperty` set to `"videoActive"` and `reason` set to `"publishVideo"`
* The respective [[Subscriber]] object of every other participant receiving this Publisher's stream will also dispatch the exact same event
*
* See [[StreamPropertyChangedEvent]] to learn more.
*
* @param enabled `true` to publish the video stream, `false` to unpublish it
* @param resource
* - If parameter **`enabled`** is `false`, this optional parameter is of type boolean. It can be set to `true` to forcibly free the hardware resource associated to the video track, or can be set to `false` to keep the access to the hardware resource.
* Not freeing the resource makes the operation much more efficient, but depending on the platform two side-effects can be introduced: the video device may not be accessible by other applications and the access light of
* webcams may remain on. This is platform-dependent: some browsers will not present the side-effects even when not freeing the resource.</li>
* - If parameter **`enabled`** is `true`, this optional parameter is of type [MediaStreamTrack](https://developer.mozilla.org/docs/Web/API/MediaStreamTrack). It can be set to force the restoration of the video track with a custom track. This may be
* useful if the Publisher was unpublished freeing the hardware resource, and openvidu-browser is not able to successfully re-create the video track as it was before unpublishing. In this way previous track settings will be ignored and this MediaStreamTrack
* will be used instead.
*/
publishVideo<T extends boolean>(enabled: T, resource?: T extends false ? boolean : MediaStreamTrack): Promise<void> {
return new Promise(async (resolve, reject) => {
if (this.stream.videoActive !== enabled) {
const affectedMediaStream: MediaStream = this.stream.displayMyRemote() ? this.stream.localMediaStreamWhenSubscribedToRemote! : this.stream.getMediaStream();
let mustRestartMediaStream = false;
affectedMediaStream.getVideoTracks().forEach((track) => {
track.enabled = enabled;
if (!enabled && resource === true) {
track.stop();
} else if (enabled && track.readyState === 'ended') {
// Resource was freed
mustRestartMediaStream = true;
}
});
// There is a Virtual Background filter applied that must be removed in case the hardware must be freed
if (!enabled && resource === true && !!this.stream.filter && this.stream.filter.type.startsWith('VB:')) {
this.stream.lastVBFilter = this.stream.filter; // Save the filter to be re-applied in case of unmute
await this.stream.removeFilterAux(true);
}
if (mustRestartMediaStream) {
const oldVideoTrack = affectedMediaStream.getVideoTracks()[0];
affectedMediaStream.removeTrack(oldVideoTrack);
const replaceVideoTrack = async (tr: MediaStreamTrack) => {
affectedMediaStream.addTrack(tr);
if (this.stream.isLocalStreamPublished) {
await this.replaceTrackInRtcRtpSender(tr);
}
if (!!this.stream.lastVBFilter) {
setTimeout(async () => {
let options = this.stream.lastVBFilter!.options;
const lastExecMethod = this.stream.lastVBFilter!.lastExecMethod;
if (!!lastExecMethod && lastExecMethod.method === 'update') {
options = Object.assign({}, options, lastExecMethod.params);
}
await this.stream.applyFilter(this.stream.lastVBFilter!.type, options);
delete this.stream.lastVBFilter;
}, 1);
}
}
if (!!resource && resource instanceof MediaStreamTrack) {
await replaceVideoTrack(resource);
} else {
try {
const mediaStream = await navigator.mediaDevices.getUserMedia({ audio: false, video: this.stream.lastVideoTrackConstraints });
await replaceVideoTrack(mediaStream.getVideoTracks()[0]);
} catch (error) {
return reject(error);
}
}
}
if (!!this.session && !!this.stream.streamId) {
this.session.openvidu.sendRequest(
'streamPropertyChanged',
{
streamId: this.stream.streamId,
property: 'videoActive',
newValue: enabled,
reason: 'publishVideo'
},
(error, response) => {
if (error) {
logger.error("Error sending 'streamPropertyChanged' event", error);
} else {
this.session.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this.session, this.stream, 'videoActive', enabled, !enabled, 'publishVideo')]);
this.emitEvent('streamPropertyChanged', [new StreamPropertyChangedEvent(this, this.stream, 'videoActive', enabled, !enabled, 'publishVideo')]);
this.session.sendVideoData(this.stream.streamManager);
}
});
}
this.stream.videoActive = enabled;
logger.info("'Publisher' has " + (enabled ? 'published' : 'unpublished') + ' its video stream');
return resolve();
}
});
}
/**
* Call this method before [[Session.publish]] if you prefer to subscribe to your Publisher's remote stream instead of using the local stream, as any other user would do.
*/
subscribeToRemote(value?: boolean): void {
value = (value !== undefined) ? value : true;
this.isSubscribedToRemote = value;
this.stream.subscribeToMyRemote(value);
}
/**
* See [[EventDispatcher.on]]
*/
on<K extends keyof PublisherEventMap>(type: K, handler: (event: PublisherEventMap[K]) => void): this {
super.on(<any>type, handler);
if (type === 'streamCreated') {
if (!!this.stream && this.stream.isLocalStreamPublished) {
this.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
} else {
this.stream.ee.on('stream-created-by-publisher', () => {
this.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
});
}
}
if (type === 'accessAllowed') {
if (this.accessAllowed) {
this.emitEvent('accessAllowed', []);
}
}
if (type === 'accessDenied') {
if (this.accessDenied) {
this.emitEvent('accessDenied', []);
}
}
return this;
}
/**
* See [[EventDispatcher.once]]
*/
once<K extends keyof PublisherEventMap>(type: K, handler: (event: PublisherEventMap[K]) => void): this {
super.once(<any>type, handler);
if (type === 'streamCreated') {
if (!!this.stream && this.stream.isLocalStreamPublished) {
this.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
} else {
this.stream.ee.once('stream-created-by-publisher', () => {
this.emitEvent('streamCreated', [new StreamEvent(false, this, 'streamCreated', this.stream, '')]);
});
}
}
if (type === 'accessAllowed') {
if (this.accessAllowed) {
this.emitEvent('accessAllowed', []);
}
}
if (type === 'accessDenied') {
if (this.accessDenied) {
this.emitEvent('accessDenied', []);
}
}
return this;
}
/**
* See [[EventDispatcher.off]]
*/
off<K extends keyof PublisherEventMap>(type: K, handler?: (event: PublisherEventMap[K]) => void): this {
super.off(<any>type, handler);
return this;
}
/**
* Replaces the current video or audio track with a different one. This allows you to replace an ongoing track with a different one
* without having to renegotiate the whole WebRTC connection (that is, initializing a new Publisher, unpublishing the previous one
* and publishing the new one).
*
* You can get this new MediaStreamTrack by using the native Web API or simply with [[OpenVidu.getUserMedia]] method.
*
* **WARNING: this method has been proven to work in the majority of cases, but there may be some combinations of published/replaced tracks that may be incompatible
* between them and break the connection in OpenVidu Server. A complete renegotiation may be the only solution in this case.
* Visit [RTCRtpSender.replaceTrack](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpSender/replaceTrack) documentation for further details.**
*
* @param track The [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) object to replace the current one.
* If it is an audio track, the current audio track will be the replaced one. If it is a video track, the current video track will be the replaced one.
*
* @returns A Promise (to which you can optionally subscribe to) that is resolved if the track was successfully replaced and rejected with an Error object in other case
*/
async replaceTrack(track: MediaStreamTrack): Promise<void> {
return this.replaceTrackAux(track, true);
}
/* Hidden methods */
/**
* @hidden
*/
initialize(): Promise<void> {
return new Promise((resolve, reject) => {
let constraints: MediaStreamConstraints = {};
let constraintsAux: MediaStreamConstraints = {};
const timeForDialogEvent = 2000;
let startTime;
const errorCallback = (openViduError: OpenViduError) => {
this.accessDenied = true;
this.accessAllowed = false;
logger.error(`Publisher initialization failed. ${openViduError.name}: ${openViduError.message}`)
return reject(openViduError);
};
const successCallback = (mediaStream: MediaStream) => {
this.accessAllowed = true;
this.accessDenied = false;
if (typeof MediaStreamTrack !== 'undefined' && this.properties.audioSource instanceof MediaStreamTrack) {
mediaStream.removeTrack(mediaStream.getAudioTracks()[0]);
mediaStream.addTrack((<MediaStreamTrack>this.properties.audioSource));
}
if (typeof MediaStreamTrack !== 'undefined' && this.properties.videoSource instanceof MediaStreamTrack) {
mediaStream.removeTrack(mediaStream.getVideoTracks()[0]);
mediaStream.addTrack((<MediaStreamTrack>this.properties.videoSource));
}
// Apply PublisherProperties.publishAudio and PublisherProperties.publishVideo
if (!!mediaStream.getAudioTracks()[0]) {
const enabled = (this.stream.audioActive !== undefined && this.stream.audioActive !== null) ? this.stream.audioActive : !!this.stream.outboundStreamOpts.publisherProperties.publishAudio;
mediaStream.getAudioTracks()[0].enabled = enabled;
}
if (!!mediaStream.getVideoTracks()[0]) {
const enabled = (this.stream.videoActive !== undefined && this.stream.videoActive !== null) ? this.stream.videoActive : !!this.stream.outboundStreamOpts.publisherProperties.publishVideo;
mediaStream.getVideoTracks()[0].enabled = enabled;
}
// Set Content Hint on all MediaStreamTracks
for (const track of mediaStream.getAudioTracks()) {
if (!track.contentHint?.length) {
// contentHint for audio: "", "speech", "speech-recognition", "music".
// https://w3c.github.io/mst-content-hint/#audio-content-hints
track.contentHint = '';
logger.info(`Audio track Content Hint set: '${track.contentHint}'`);
}
}
for (const track of mediaStream.getVideoTracks()) {
if (!track.contentHint?.length) {
// contentHint for video: "", "motion", "detail", "text".
// https://w3c.github.io/mst-content-hint/#video-content-hints
switch (this.stream.typeOfVideo) {
case TypeOfVideo.SCREEN:
track.contentHint = "detail";
break;
case TypeOfVideo.CUSTOM:
logger.warn("CUSTOM type video track was provided without Content Hint!");
track.contentHint = "motion";
break;
case TypeOfVideo.CAMERA:
case TypeOfVideo.IPCAM:
default:
track.contentHint = "motion";
break;
}
logger.info(`Video track Content Hint set: '${track.contentHint}'`);
}
}
this.initializeVideoReference(mediaStream);
if (!this.stream.displayMyRemote()) {
// When we are subscribed to our remote we don't still set the MediaStream object in the video elements to
// avoid early 'streamPlaying' event
this.stream.updateMediaStreamInVideos();
}
delete this.firstVideoElement;
if (this.stream.isSendVideo()) {
// Has video track
this.getVideoDimensions().then(dimensions => {
this.stream.videoDimensions = {
width: dimensions.width,
height: dimensions.height
};
if (this.stream.isSendScreen()) {
// Set interval to listen for screen resize events
this.screenShareResizeInterval = setInterval(() => {
const settings: MediaTrackSettings = mediaStream.getVideoTracks()[0].getSettings();
const newWidth = settings.width;
const newHeight = settings.height;
const widthChanged = newWidth != null && newWidth !== this.stream.videoDimensions.width;
const heightChanged = newHeight != null && newHeight !== this.stream.videoDimensions.height;
if (this.stream.isLocalStreamPublished && (widthChanged || heightChanged)) {
this.openvidu.sendVideoDimensionsChangedEvent(
this,
'screenResized',
this.stream.videoDimensions.width,
this.stream.videoDimensions.height,
newWidth || 0,
newHeight || 0
);
}
}, 650);
}
this.stream.isLocalStreamReadyToPublish = true;
this.stream.ee.emitEvent('stream-ready-to-publish', []);
});
} else {
// Only audio track (no videoDimensions)
this.stream.isLocalStreamReadyToPublish = true;
this.stream.ee.emitEvent('stream-ready-to-publish', []);
}
return resolve();
};
const getMediaSuccess = (mediaStream: MediaStream, definedAudioConstraint) => {
this.clearPermissionDialogTimer(startTime, timeForDialogEvent);
if (this.stream.isSendScreen() && this.stream.isSendAudio()) {
// When getting desktop as user media audio constraint must be false. Now we can ask for it if required
constraintsAux.audio = definedAudioConstraint;
constraintsAux.video = false;
startTime = Date.now();
this.setPermissionDialogTimer(timeForDialogEvent);
navigator.mediaDevices.getUserMedia(constraintsAux)
.then(audioOnlyStream => {
this.clearPermissionDialogTimer(startTime, timeForDialogEvent);
mediaStream.addTrack(audioOnlyStream.getAudioTracks()[0]);
successCallback(mediaStream);
})
.catch(error => {
this.clearPermissionDialogTimer(startTime, timeForDialogEvent);
mediaStream.getAudioTracks().forEach((track) => {
track.stop();
});
mediaStream.getVideoTracks().forEach((track) => {
track.stop();
});
errorCallback(this.openvidu.generateAudioDeviceError(error, constraints));
return;
});
} else {
successCallback(mediaStream);
}
};
const getMediaError = error => {
logger.error(`getMediaError: ${error.toString()}`);
this.clearPermissionDialogTimer(startTime, timeForDialogEvent);
if (error.name === 'Error') {
// Safari OverConstrainedError has as name property 'Error' instead of 'OverConstrainedError'
error.name = error.constructor.name;
}
let errorName, errorMessage;
switch (error.name.toLowerCase()) {
case 'notfounderror':
navigator.mediaDevices.getUserMedia({
audio: false,
video: constraints.video
})
.then(mediaStream => {
mediaStream.getVideoTracks().forEach((track) => {
track.stop();
});
errorName = OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;
errorMessage = error.toString();
errorCallback(new OpenViduError(errorName, errorMessage));
}).catch(e => {
errorName = OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND;
errorMessage = error.toString();
errorCallback(new OpenViduError(errorName, errorMessage));
});
break;
case 'notallowederror':
errorName = this.stream.isSendScreen() ? OpenViduErrorName.SCREEN_CAPTURE_DENIED : OpenViduErrorName.DEVICE_ACCESS_DENIED;
errorMessage = error.toString();
errorCallback(new OpenViduError(errorName, errorMessage));
break;
case 'overconstrainederror':
navigator.mediaDevices.getUserMedia({
audio: false,
video: constraints.video
})
.then(mediaStream => {
mediaStream.getVideoTracks().forEach((track) => {
track.stop();
});
if (error.constraint.toLowerCase() === 'deviceid') {
errorName = OpenViduErrorName.INPUT_AUDIO_DEVICE_NOT_FOUND;
errorMessage = "Audio input device with deviceId '" + (<ConstrainDOMStringParameters>(<MediaTrackConstraints>constraints.audio).deviceId!!).exact + "' not found";
} else {
errorName = OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR;
errorMessage = "Audio input device doesn't support the value passed for constraint '" + error.constraint + "'";
}
errorCallback(new OpenViduError(errorName, errorMessage));
}).catch(e => {
if (error.constraint.toLowerCase() === 'deviceid') {
errorName = OpenViduErrorName.INPUT_VIDEO_DEVICE_NOT_FOUND;
errorMessage = "Video input device with deviceId '" + (<ConstrainDOMStringParameters>(<MediaTrackConstraints>constraints.video).deviceId!!).exact + "' not found";
} else {
errorName = OpenViduErrorName.PUBLISHER_PROPERTIES_ERROR;
errorMessage = "Video input device doesn't support the value passed for constraint '" + error.constraint + "'";
}
errorCallback(new OpenViduError(errorName, errorMessage));
});
break;
case 'aborterror':
case 'notreadableerror':
errorName = OpenViduErrorName.DEVICE_ALREADY_IN_USE;
errorMessage = error.toString();
errorCallback(new OpenViduError(errorName, errorMessage));
break;
default:
errorName = OpenViduErrorName.GENERIC_ERROR;
errorMessage = error.toString();
errorCallback(new OpenViduError(errorName, errorMessage));
break;
}
}
this.openvidu.generateMediaConstraints(this.properties)
.then(myConstraints => {
if (!!myConstraints.videoTrack && !!myConstraints.audioTrack ||
!!myConstraints.audioTrack && myConstraints.constraints?.video === false ||
!!myConstraints.videoTrack && myConstraints.constraints?.audio === false) {
// No need to call getUserMedia at all. MediaStreamTracks already provided
successCallback(this.openvidu.addAlreadyProvidedTracks(myConstraints, new MediaStream(), this.stream));
// Return as we do not need to process further
return;
}
constraints = myConstraints.constraints;
const outboundStreamOptions = {
mediaConstraints: constraints,
publisherProperties: this.properties
};
this.stream.setOutboundStreamOptions(outboundStreamOptions);
const definedAudioConstraint = ((constraints.audio === undefined) ? true : constraints.audio);
constraintsAux.audio = this.stream.isSendScreen() ? false : definedAudioConstraint;
constraintsAux.video = constraints.video;
startTime = Date.now();
this.setPermissionDialogTimer(timeForDialogEvent);
if (this.stream.isSendScreen() && navigator.mediaDevices['getDisplayMedia'] && !platform.isElectron()) {
navigator.mediaDevices['getDisplayMedia']({ video: true })
.then(mediaStream => {
this.openvidu.addAlreadyProvidedTracks(myConstraints, mediaStream);
getMediaSuccess(mediaStream, definedAudioConstraint);
})
.catch(error => {
getMediaError(error);
});
} else {
this.stream.lastVideoTrackConstraints = constraintsAux.video;
navigator.mediaDevices.getUserMedia(constraintsAux)
.then(mediaStream => {
this.openvidu.addAlreadyProvidedTracks(myConstraints, mediaStream, this.stream);
getMediaSuccess(mediaStream, definedAudioConstraint);
})
.catch(error => {
getMediaError(error);
});
}
})
.catch((error: OpenViduError) => {
errorCallback(error);
});
});
}
/**
* @hidden
*/
async replaceTrackAux(track: MediaStreamTrack, updateLastConstraints: boolean): Promise<void> {
// Set field "enabled" of the new track to the previous value
const trackOriginalEnabledValue: boolean = track.enabled;
if (track.kind === 'video') {
track.enabled = this.stream.videoActive;
} else if (track.kind === 'audio') {
track.enabled = this.stream.audioActive;
}
try {
if (this.stream.isLocalStreamPublished) {
// Only if the Publisher has been published is necessary to call native Web API RTCRtpSender.replaceTrack
// If it has not been published yet, replacing it on the MediaStream object is enough
await this.replaceTrackInMediaStream(track, updateLastConstraints);
return await this.replaceTrackInRtcRtpSender(track);
} else {
// Publisher not published. Simply replace the track on the local MediaStream
return await this.replaceTrackInMediaStream(track, updateLastConstraints);
}
} catch (error) {
track.enabled = trackOriginalEnabledValue;
throw error;
}
}
/**
* @hidden
*
* To obtain the videoDimensions we wait for the video reference to have enough metadata
* and then try to use MediaStreamTrack.getSettingsMethod(). If not available, then we
* use the HTMLVideoElement properties videoWidth and videoHeight
*/
getVideoDimensions(): Promise<{ width: number, height: number }> {
return new Promise((resolve, reject) => {
// Ionic iOS and Safari iOS supposedly require the video element to actually exist inside the DOM
const requiresDomInsertion: boolean = platform.isIonicIos() || platform.isIOSWithSafari();
let loadedmetadataListener;
const resolveDimensions = () => {
let width: number;
let height: number;
if (typeof this.stream.getMediaStream().getVideoTracks()[0].getSettings === 'function') {
const settings = this.stream.getMediaStream().getVideoTracks()[0].getSettings();
width = settings.width || this.videoReference.videoWidth;
height = settings.height || this.videoReference.videoHeight;
} else {
logger.warn('MediaStreamTrack does not have getSettings method on ' + platform.getDescription());
width = this.videoReference.videoWidth;
height = this.videoReference.videoHeight;
}
if (loadedmetadataListener != null) {
this.videoReference.removeEventListener('loadedmetadata', loadedmetadataListener);
}
if (requiresDomInsertion) {
document.body.removeChild(this.videoReference);
}
return resolve({ width, height });
}
if (this.videoReference.readyState >= 1) {
// The video already has metadata available
// No need of loadedmetadata event
resolveDimensions();
} else {
// The video does not have metadata available yet
// Must listen to loadedmetadata event
loadedmetadataListener = () => {
if (!this.videoReference.videoWidth) {
let interval = setInterval(() => {
if (!!this.videoReference.videoWidth) {
clearInterval(interval);
resolveDimensions();
}
}, 40);
} else {
resolveDimensions();
}
};
this.videoReference.addEventListener('loadedmetadata', loadedmetadataListener);
if (requiresDomInsertion) {
document.body.appendChild(this.videoReference);
}
}
});
}
/**
* @hidden
*/
reestablishStreamPlayingEvent() {
if (this.ee.getListeners('streamPlaying').length > 0) {
this.addPlayEventToFirstVideo();
}
}
/**
* @hidden
*/
initializeVideoReference(mediaStream: MediaStream) {
this.videoReference = document.createElement('video');
this.videoReference.setAttribute('muted', 'true');
this.videoReference.style.display = 'none';
if (platform.isSafariBrowser() || (platform.isIPhoneOrIPad() && (platform.isChromeMobileBrowser() || platform.isEdgeMobileBrowser() || platform.isOperaMobileBrowser() || platform.isFirefoxMobileBrowser()))) {
this.videoReference.setAttribute('playsinline', 'true');
}
this.stream.setMediaStream(mediaStream);
if (!!this.firstVideoElement) {
this.createVideoElement(this.firstVideoElement.targetElement, <VideoInsertMode>this.properties.insertMode);
}
this.videoReference.srcObject = mediaStream;
}
/**
* @hidden
*/
async replaceTrackInMediaStream(track: MediaStreamTrack, updateLastConstraints: boolean): Promise<void> {
const mediaStream: MediaStream = this.stream.displayMyRemote() ? this.stream.localMediaStreamWhenSubscribedToRemote! : this.stream.getMediaStream();
let removedTrack: MediaStreamTrack;
if (track.kind === 'video') {
removedTrack = mediaStream.getVideoTracks()[0];
if (updateLastConstraints) {
this.stream.lastVideoTrackConstraints = track.getConstraints();
}
} else {
removedTrack = mediaStream.getAudioTracks()[0];
}
mediaStream.removeTrack(removedTrack);
removedTrack.stop();
mediaStream.addTrack(track);
if (track.kind === 'video' && this.stream.isLocalStreamPublished && updateLastConstraints) {
this.openvidu.sendNewVideoDimensionsIfRequired(this, 'trackReplaced', 50, 30);
this.session.sendVideoData(this.stream.streamManager, 5, true, 5);
}
}
/* Private methods */
private setPermissionDialogTimer(waitTime: number): void {
this.permissionDialogTimeout = setTimeout(() => {
this.emitEvent('accessDialogOpened', []);
}, waitTime);
}
private clearPermissionDialogTimer(startTime: number, waitTime: number): void {
clearTimeout(this.permissionDialogTimeout);
if ((Date.now() - startTime) > waitTime) {
// Permission dialog was shown and now is closed
this.emitEvent('accessDialogClosed', []);
}
}
private async replaceTrackInRtcRtpSender(track: MediaStreamTrack): Promise<void> {
const senders: RTCRtpSender[] = this.stream.getRTCPeerConnection().getSenders();
let sender: RTCRtpSender | undefined;
if (track.kind === 'video') {
sender = senders.find(s => !!s.track && s.track.kind === 'video');
if (!sender) {
throw new Error('There\'s no replaceable track for that kind of MediaStreamTrack in this Publisher object');
}
} else if (track.kind === 'audio') {
sender = senders.find(s => !!s.track && s.track.kind === 'audio');
if (!sender) {
throw new Error('There\'s no replaceable track for that kind of MediaStreamTrack in this Publisher object');
}
} else {
throw new Error('Unknown track kind ' + track.kind);
}
await (sender as RTCRtpSender).replaceTrack(track);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,584 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Stream } from './Stream';
import { Subscriber } from './Subscriber';
import { EventDispatcher } from './EventDispatcher';
import { StreamManagerVideo } from '../OpenViduInternal/Interfaces/Public/StreamManagerVideo';
import { StreamManagerEventMap } from '../OpenViduInternal/Events/EventMap/StreamManagerEventMap';
import { StreamManagerEvent } from '../OpenViduInternal/Events/StreamManagerEvent';
import { VideoElementEvent } from '../OpenViduInternal/Events/VideoElementEvent';
import { ExceptionEvent, ExceptionEventName } from '../OpenViduInternal/Events/ExceptionEvent';
import { VideoInsertMode } from '../OpenViduInternal/Enums/VideoInsertMode';
import { OpenViduLogger } from '../OpenViduInternal/Logger/OpenViduLogger';
import { PlatformUtils } from '../OpenViduInternal/Utils/Platform';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* @hidden
*/
let platform: PlatformUtils;
/**
* Interface in charge of displaying the media streams in the HTML DOM. This wraps any [[Publisher]] and [[Subscriber]] object.
* You can insert as many video players fo the same Stream as you want by calling [[StreamManager.addVideoElement]] or
* [[StreamManager.createVideoElement]].
* The use of StreamManager wrapper is particularly useful when you don't need to differentiate between Publisher or Subscriber streams or just
* want to directly manage your own video elements (even more than one video element per Stream). This scenario is pretty common in
* declarative, MVC frontend frameworks such as Angular, React or Vue.js
*
* See available event listeners at [[StreamManagerEventMap]].
*/
export abstract class StreamManager extends EventDispatcher {
/**
* The Stream represented in the DOM by the Publisher/Subscriber
*/
stream: Stream;
/**
* All the videos displaying the Stream of this Publisher/Subscriber
*/
videos: StreamManagerVideo[] = [];
/**
* Whether the Stream represented in the DOM is local or remote
* - `false` for [[Publisher]]
* - `true` for [[Subscriber]]
*/
remote: boolean;
/**
* The DOM HTMLElement assigned as target element when creating the video for the Publisher/Subscriber. This property is only defined if:
* - [[Publisher]] has been initialized by calling method [[OpenVidu.initPublisher]] with a valid `targetElement` parameter
* - [[Subscriber]] has been initialized by calling method [[Session.subscribe]] with a valid `targetElement` parameter
*/
targetElement: HTMLElement;
/**
* `id` attribute of the DOM video element displaying the Publisher/Subscriber's stream. This property is only defined if:
* - [[Publisher]] has been initialized by calling method [[OpenVidu.initPublisher]] with a valid `targetElement` parameter
* - [[Subscriber]] has been initialized by calling method [[Session.subscribe]] with a valid `targetElement` parameter
*/
id: string;
/**
* @hidden
*/
protected firstVideoElement?: StreamManagerVideo;
/**
* @hidden
*/
protected element: HTMLElement;
/**
* @hidden
*/
protected canPlayListener: EventListener;
/**
* @hidden
*/
private streamPlayingEventExceptionTimeout?: NodeJS.Timeout;
/**
* @hidden
*/
private lazyLaunchVideoElementCreatedEvent = false;
/**
* @hidden
*/
constructor(stream: Stream, targetElement?: HTMLElement | string) {
super();
platform = PlatformUtils.getInstance();
this.stream = stream;
this.stream.streamManager = this;
this.remote = !this.stream.isLocal();
if (!!targetElement) {
let targEl;
if (typeof targetElement === 'string') {
targEl = document.getElementById(targetElement);
} else if (targetElement instanceof HTMLElement) {
targEl = targetElement;
}
if (!!targEl) {
this.firstVideoElement = {
targetElement: targEl,
video: document.createElement('video'),
id: '',
canplayListenerAdded: false
};
if (platform.isSafariBrowser() || (platform.isIPhoneOrIPad() && (platform.isChromeMobileBrowser() || platform.isEdgeMobileBrowser() || platform.isOperaMobileBrowser() || platform.isFirefoxMobileBrowser()))) {
this.firstVideoElement.video.setAttribute('playsinline', 'true');
}
this.targetElement = targEl;
this.element = targEl;
}
}
this.canPlayListener = () => {
this.deactivateStreamPlayingEventExceptionTimeout();
this.ee.emitEvent('streamPlaying', [new StreamManagerEvent(this, 'streamPlaying', undefined)]);
};
}
/**
* See [[EventDispatcher.on]]
*/
on<K extends keyof StreamManagerEventMap>(type: K, handler: (event: StreamManagerEventMap[K]) => void): this {
super.onAux(type, "Event '" + type + "' triggered by '" + (this.remote ? 'Subscriber' : 'Publisher') + "'", handler);
if (type === 'videoElementCreated') {
if (!!this.stream && this.lazyLaunchVideoElementCreatedEvent) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent(this.videos[0].video, this, 'videoElementCreated')]);
this.lazyLaunchVideoElementCreatedEvent = false;
}
}
if (type === 'streamPlaying') {
if (this.videos[0] && this.videos[0].video &&
this.videos[0].video.currentTime > 0 &&
this.videos[0].video.paused === false &&
this.videos[0].video.ended === false &&
this.videos[0].video.readyState === 4) {
this.ee.emitEvent('streamPlaying', [new StreamManagerEvent(this, 'streamPlaying', undefined)]);
}
}
if (this.stream.hasAudio) {
if (type === 'publisherStartSpeaking') {
this.stream.enableHarkSpeakingEvent();
}
if (type === 'publisherStopSpeaking') {
this.stream.enableHarkStoppedSpeakingEvent();
}
if (type === 'streamAudioVolumeChange') {
this.stream.enableHarkVolumeChangeEvent(false);
}
}
return this;
}
/**
* See [[EventDispatcher.once]]
*/
once<K extends keyof StreamManagerEventMap>(type: K, handler: (event: StreamManagerEventMap[K]) => void): this {
super.onceAux(type, "Event '" + type + "' triggered once by '" + (this.remote ? 'Subscriber' : 'Publisher') + "'", handler);
if (type === 'videoElementCreated') {
if (!!this.stream && this.lazyLaunchVideoElementCreatedEvent) {
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent(this.videos[0].video, this, 'videoElementCreated')]);
}
}
if (type === 'streamPlaying') {
if (this.videos[0] && this.videos[0].video &&
this.videos[0].video.currentTime > 0 &&
this.videos[0].video.paused === false &&
this.videos[0].video.ended === false &&
this.videos[0].video.readyState === 4) {
this.ee.emitEvent('streamPlaying', [new StreamManagerEvent(this, 'streamPlaying', undefined)]);
}
}
if (this.stream.hasAudio) {
if (type === 'publisherStartSpeaking') {
this.stream.enableOnceHarkSpeakingEvent();
}
if (type === 'publisherStopSpeaking') {
this.stream.enableOnceHarkStoppedSpeakingEvent();
}
if (type === 'streamAudioVolumeChange') {
this.stream.enableOnceHarkVolumeChangeEvent(false);
}
}
return this;
}
/**
* See [[EventDispatcher.off]]
*/
off<K extends keyof StreamManagerEventMap>(type: K, handler?: (event: StreamManagerEventMap[K]) => void): this {
super.offAux(type, handler);
if (type === 'publisherStartSpeaking') {
// Both StreamManager and Session can have "publisherStartSpeaking" event listeners
const remainingStartSpeakingEventListeners = this.ee.getListeners(type).length + this.stream.session.ee.getListeners(type).length;
if (remainingStartSpeakingEventListeners === 0) {
this.stream.disableHarkSpeakingEvent(false);
}
}
if (type === 'publisherStopSpeaking') {
// Both StreamManager and Session can have "publisherStopSpeaking" event listeners
const remainingStopSpeakingEventListeners = this.ee.getListeners(type).length + this.stream.session.ee.getListeners(type).length;
if (remainingStopSpeakingEventListeners === 0) {
this.stream.disableHarkStoppedSpeakingEvent(false);
}
}
if (type === 'streamAudioVolumeChange') {
// Only StreamManager can have "streamAudioVolumeChange" event listeners
const remainingVolumeEventListeners = this.ee.getListeners(type).length;
if (remainingVolumeEventListeners === 0) {
this.stream.disableHarkVolumeChangeEvent(false);
}
}
return this;
}
/**
* Makes `video` element parameter display this [[stream]]. This is useful when you are
* [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.
*
* @returns 1 if the video wasn't associated to any other Publisher/Subscriber and has been successfully added to this one.
* 0 if the video was already added to this Publisher/Subscriber. -1 if the video was previously associated to any other
* Publisher/Subscriber and has been successfully disassociated from that one and properly added to this one.
*/
addVideoElement(video: HTMLVideoElement): number {
this.initializeVideoProperties(video);
if (!this.remote && this.stream.displayMyRemote()) {
if (video.srcObject !== this.stream.getMediaStream()) {
video.srcObject = this.stream.getMediaStream();
}
}
// If the video element is already part of this StreamManager do nothing
for (const v of this.videos) {
if (v.video === video) {
return 0;
}
}
let returnNumber = 1;
for (const streamManager of this.stream.session.streamManagers) {
if (streamManager.disassociateVideo(video)) {
returnNumber = -1;
break;
}
}
this.stream.session.streamManagers.forEach(streamManager => {
streamManager.disassociateVideo(video);
});
this.pushNewStreamManagerVideo({
video,
id: video.id,
canplayListenerAdded: false
});
logger.info('New video element associated to ', this);
return returnNumber;
}
/**
* Creates a new video element displaying this [[stream]]. This allows you to have multiple video elements displaying the same media stream.
*
* #### Events dispatched
*
* The Publisher/Subscriber object will dispatch a `videoElementCreated` event once the HTML video element has been added to DOM. See [[VideoElementEvent]]
*
* @param targetElement HTML DOM element (or its `id` attribute) in which the video element of the Publisher/Subscriber will be inserted
* @param insertMode How the video element will be inserted accordingly to `targetElemet`
*
* @returns The created HTMLVideoElement
*/
createVideoElement(targetElement?: string | HTMLElement, insertMode?: VideoInsertMode): HTMLVideoElement {
let targEl;
if (typeof targetElement === 'string') {
targEl = document.getElementById(targetElement);
if (!targEl) {
throw new Error("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
}
} else if (targetElement instanceof HTMLElement) {
targEl = targetElement;
} else {
throw new Error("The provided 'targetElement' couldn't be resolved to any HTML element: " + targetElement);
}
const video = this.createVideo();
this.initializeVideoProperties(video);
let insMode = !!insertMode ? insertMode : VideoInsertMode.APPEND;
switch (insMode) {
case VideoInsertMode.AFTER:
targEl.parentNode!!.insertBefore(video, targEl.nextSibling);
break;
case VideoInsertMode.APPEND:
targEl.appendChild(video);
break;
case VideoInsertMode.BEFORE:
targEl.parentNode!!.insertBefore(video, targEl);
break;
case VideoInsertMode.PREPEND:
targEl.insertBefore(video, targEl.childNodes[0]);
break;
case VideoInsertMode.REPLACE:
targEl.parentNode!!.replaceChild(video, targEl);
break;
default:
insMode = VideoInsertMode.APPEND;
targEl.appendChild(video);
break;
}
const v: StreamManagerVideo = {
targetElement: targEl,
video,
insertMode: insMode,
id: video.id,
canplayListenerAdded: false
};
this.pushNewStreamManagerVideo(v);
this.ee.emitEvent('videoElementCreated', [new VideoElementEvent(v.video, this, 'videoElementCreated')]);
this.lazyLaunchVideoElementCreatedEvent = !!this.firstVideoElement;
return video;
}
/**
* Updates the current configuration for the [[PublisherSpeakingEvent]] feature and the [StreamManagerEvent.streamAudioVolumeChange](/en/stable/api/openvidu-browser/classes/StreamManagerEvent.html) feature for this specific
* StreamManager audio stream, overriding the global options set with [[OpenVidu.setAdvancedConfiguration]]. This way you can customize the audio events options
* for each specific StreamManager and change them dynamically.
*
* @param publisherSpeakingEventsOptions New options to be applied to this StreamManager's audio stream. It is an object which includes the following optional properties:
* - `interval`: (number) how frequently the analyser polls the audio stream to check if speaking has started/stopped or audio volume has changed. Default **100** (ms)
* - `threshold`: (number) the volume at which _publisherStartSpeaking_, _publisherStopSpeaking_ events will be fired. Default **-50** (dB)
*/
updatePublisherSpeakingEventsOptions(publisherSpeakingEventsOptions: { interval?: number, threshold?: number }): void {
const currentHarkOptions = !!this.stream.harkOptions ? this.stream.harkOptions : (this.stream.session.openvidu.advancedConfiguration.publisherSpeakingEventsOptions || {});
const newInterval = (typeof publisherSpeakingEventsOptions.interval === 'number') ?
publisherSpeakingEventsOptions.interval : ((typeof currentHarkOptions.interval === 'number') ? currentHarkOptions.interval : 100);
const newThreshold = (typeof publisherSpeakingEventsOptions.threshold === 'number') ?
publisherSpeakingEventsOptions.threshold : ((typeof currentHarkOptions.threshold === 'number') ? currentHarkOptions.threshold : -50);
this.stream.harkOptions = {
interval: newInterval,
threshold: newThreshold
};
if (!!this.stream.speechEvent) {
this.stream.speechEvent.setInterval(newInterval);
this.stream.speechEvent.setThreshold(newThreshold);
}
}
/* Hidden methods */
/**
* @hidden
*/
initializeVideoProperties(video: HTMLVideoElement): void {
if (!(!this.remote && this.stream.displayMyRemote())) {
// Avoid setting the MediaStream into the srcObject if remote subscription before publishing
if (video.srcObject !== this.stream.getMediaStream()) {
// If srcObject already set don't do it again
video.srcObject = this.stream.getMediaStream();
}
}
video.autoplay = true;
video.controls = false;
if (platform.isSafariBrowser() || (platform.isIPhoneOrIPad() && (platform.isChromeMobileBrowser() || platform.isEdgeMobileBrowser() || platform.isOperaMobileBrowser() || platform.isFirefoxMobileBrowser()))) {
video.setAttribute('playsinline', 'true');
}
if (!video.id) {
video.id = (this.remote ? 'remote-' : 'local-') + 'video-' + this.stream.streamId;
// DEPRECATED property: assign once the property id if the user provided a valid targetElement
if (!this.id && !!this.targetElement) {
this.id = video.id;
}
}
if (this.remote && this.isMirroredVideo(video)) {
// Subscriber video associated to a previously mirrored video element
this.removeMirrorVideo(video);
} else if (!this.remote && !this.stream.displayMyRemote()) {
// Publisher video
video.muted = true;
if (this.isMirroredVideo(video) && !this.stream.outboundStreamOpts.publisherProperties.mirror) {
// If the video was already rotated and now is set to not mirror
this.removeMirrorVideo(video);
} else if (this.stream.outboundStreamOpts.publisherProperties.mirror && !this.stream.isSendScreen()) {
// If the video is now set to mirror and is not screen share
this.mirrorVideo(video);
}
}
}
/**
* @hidden
*/
removeAllVideos(): void {
for (let i = this.stream.session.streamManagers.length - 1; i >= 0; --i) {
if (this.stream.session.streamManagers[i] === this) {
this.stream.session.streamManagers.splice(i, 1);
}
}
this.videos.forEach(streamManagerVideo => {
// Remove oncanplay event listener (only OpenVidu browser listener, not the user ones)
if (!!streamManagerVideo.video && !!streamManagerVideo.video.removeEventListener) {
streamManagerVideo.video.removeEventListener('canplay', this.canPlayListener);
}
streamManagerVideo.canplayListenerAdded = false;
if (!!streamManagerVideo.targetElement) {
// Only remove from DOM videos created by OpenVidu Browser (those generated by passing a valid targetElement in OpenVidu.initPublisher
// and Session.subscribe or those created by StreamManager.createVideoElement). All this videos triggered a videoElementCreated event
streamManagerVideo.video.parentNode!.removeChild(streamManagerVideo.video);
this.ee.emitEvent('videoElementDestroyed', [new VideoElementEvent(streamManagerVideo.video, this, 'videoElementDestroyed')]);
}
// Remove srcObject from the video
this.removeSrcObject(streamManagerVideo);
// Remove from collection of videos every video managed by OpenVidu Browser
this.videos.filter(v => !v.targetElement);
});
}
/**
* @hidden
*/
disassociateVideo(video: HTMLVideoElement): boolean {
let disassociated = false;
for (let i = 0; i < this.videos.length; i++) {
if (this.videos[i].video === video) {
this.videos[i].video.removeEventListener('canplay', this.canPlayListener);
this.videos.splice(i, 1);
disassociated = true;
logger.info('Video element disassociated from ', this);
break;
}
}
return disassociated;
}
/**
* @hidden
*/
addPlayEventToFirstVideo() {
if ((!!this.videos[0]) && (!!this.videos[0].video) && (!this.videos[0].canplayListenerAdded)) {
this.activateStreamPlayingEventExceptionTimeout();
this.videos[0].video.addEventListener('canplay', this.canPlayListener);
this.videos[0].canplayListenerAdded = true;
}
}
/**
* @hidden
*/
updateMediaStream(mediaStream: MediaStream) {
this.videos.forEach(streamManagerVideo => {
streamManagerVideo.video.srcObject = mediaStream;
if (platform.isIonicIos()) {
// iOS Ionic. LIMITATION: must reinsert the video in the DOM for
// the media stream to be updated
const vParent = streamManagerVideo.video.parentElement;
const newVideo = streamManagerVideo.video;
vParent!!.replaceChild(newVideo, streamManagerVideo.video);
streamManagerVideo.video = newVideo;
}
});
}
/**
* @hidden
*/
emitEvent(type: string, eventArray: any[]): void {
this.ee.emitEvent(type, eventArray);
}
/**
* @hidden
*/
createVideo(): HTMLVideoElement {
return document.createElement('video');
}
/**
* @hidden
*/
removeSrcObject(streamManagerVideo: StreamManagerVideo) {
streamManagerVideo.video.srcObject = null;
this.deactivateStreamPlayingEventExceptionTimeout();
}
/**
* @hidden
*/
abstract replaceTrackInMediaStream(track: MediaStreamTrack, updateLastConstraints: boolean): Promise<void>;
/* Private methods */
protected pushNewStreamManagerVideo(streamManagerVideo: StreamManagerVideo) {
this.videos.push(streamManagerVideo);
this.addPlayEventToFirstVideo();
if (this.stream.session.streamManagers.indexOf(this) === -1) {
this.stream.session.streamManagers.push(this);
}
}
private mirrorVideo(video: HTMLVideoElement): void {
if (!platform.isIonicIos()) {
video.style.transform = 'rotateY(180deg)';
video.style.webkitTransform = 'rotateY(180deg)';
}
}
private removeMirrorVideo(video: HTMLVideoElement): void {
video.style.transform = 'unset';
video.style.webkitTransform = 'unset';
}
private isMirroredVideo(video: HTMLVideoElement): boolean {
return video.style.transform === 'rotateY(180deg)' || video.style.webkitTransform === 'rotateY(180deg)';
}
private activateStreamPlayingEventExceptionTimeout() {
if (!this.remote) {
// ExceptionEvent NO_STREAM_PLAYING_EVENT is only for subscribers
return;
}
if (this.streamPlayingEventExceptionTimeout != null) {
// The timeout is already activated
return;
}
// Trigger ExceptionEvent NO_STREAM_PLAYING_EVENT if after timeout there is no 'canplay' event
const msTimeout = this.stream.session.openvidu.advancedConfiguration.noStreamPlayingEventExceptionTimeout || 4000;
this.streamPlayingEventExceptionTimeout = setTimeout(() => {
const msg = 'StreamManager of Stream ' + this.stream.streamId + ' (' + (this.remote ? 'Subscriber' : 'Publisher') + ') did not trigger "streamPlaying" event in ' + msTimeout + ' ms';
logger.warn(msg);
this.stream.session.emitEvent('exception', [new ExceptionEvent(this.stream.session, ExceptionEventName.NO_STREAM_PLAYING_EVENT, (<any>this) as Subscriber, msg)]);
delete this.streamPlayingEventExceptionTimeout;
}, msTimeout);
}
private deactivateStreamPlayingEventExceptionTimeout() {
clearTimeout(this.streamPlayingEventExceptionTimeout as any);
delete this.streamPlayingEventExceptionTimeout;
}
}

View File

@ -1,97 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Stream } from './Stream';
import { StreamManager } from './StreamManager';
import { SubscriberProperties } from '../OpenViduInternal/Interfaces/Public/SubscriberProperties';
import { OpenViduLogger } from '../OpenViduInternal/Logger/OpenViduLogger';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* Packs remote media streams. Participants automatically receive them when others publish their streams. Initialized with [[Session.subscribe]] method
*
* See available event listeners at [[StreamManagerEventMap]].
*/
export class Subscriber extends StreamManager {
/**
* @hidden
*/
properties: SubscriberProperties;
/**
* @hidden
*/
constructor(stream: Stream, targEl: string | HTMLElement, properties: SubscriberProperties) {
super(stream, targEl);
this.element = this.targetElement;
this.stream = stream;
this.properties = properties;
}
/**
* Subscribe or unsubscribe from the audio stream (if available). Calling this method twice in a row passing same value will have no effect
* @param value `true` to subscribe to the audio stream, `false` to unsubscribe from it
*/
subscribeToAudio(value: boolean): Subscriber {
this.stream.getMediaStream().getAudioTracks().forEach((track) => {
track.enabled = value;
});
this.stream.audioActive = value;
logger.info("'Subscriber' has " + (value ? 'subscribed to' : 'unsubscribed from') + ' its audio stream');
return this;
}
/**
* Subscribe or unsubscribe from the video stream (if available). Calling this method twice in a row passing same value will have no effect
* @param value `true` to subscribe to the video stream, `false` to unsubscribe from it
*/
subscribeToVideo(value: boolean): Subscriber {
this.stream.getMediaStream().getVideoTracks().forEach((track) => {
track.enabled = value;
});
this.stream.videoActive = value;
logger.info("'Subscriber' has " + (value ? 'subscribed to' : 'unsubscribed from') + ' its video stream');
return this;
}
/* Hidden methods */
/**
* @hidden
*/
async replaceTrackInMediaStream(track: MediaStreamTrack, updateLastConstraints: boolean): Promise<void> {
const mediaStream: MediaStream = this.stream.getMediaStream();
let removedTrack: MediaStreamTrack;
if (track.kind === 'video') {
removedTrack = mediaStream.getVideoTracks()[0];
if (updateLastConstraints) {
this.stream.lastVideoTrackConstraints = track.getConstraints();
}
} else {
removedTrack = mediaStream.getAudioTracks()[0];
}
mediaStream.removeTrack(removedTrack);
removedTrack.stop();
mediaStream.addTrack(track);
}
}

View File

@ -1,35 +0,0 @@
{
//"allowUnusedLabels": true,
"allowUnreachableCode": false,
"buildOnSave": false,
"compileOnSave": true,
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"emitBOM": false,
"forceConsistentCasingInFileNames": true,
"lib": [
"dom",
"es2015.promise",
"es5",
"scripthost"
],
"module": "commonjs",
"noFallthroughCasesInSwitch": true,
//"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
//"noUnusedLocals": true,
//"noUnusedParameters": true,
"outDir": "../../lib",
"preserveConstEnums": true,
"removeComments": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"suppressExcessPropertyErrors": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5"
}
}

View File

@ -1,23 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
export enum LocalRecorderState {
READY = 'READY',
RECORDING = 'RECORDING',
PAUSED = 'PAUSED',
FINISHED = 'FINISHED'
}

View File

@ -1,144 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* Defines property [[OpenViduError.name]]
*/
export enum OpenViduErrorName {
/**
* Browser is not supported by OpenVidu.
* Returned upon unsuccessful [[Session.connect]]
*/
BROWSER_NOT_SUPPORTED = 'BROWSER_NOT_SUPPORTED',
/**
* The user hasn't granted permissions to the required input device when the browser asked for them.
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
DEVICE_ACCESS_DENIED = 'DEVICE_ACCESS_DENIED',
/**
* The required input device is probably being used by other process when the browser asked for it.
* This error can also be triggered when the user granted permission to use the devices but a hardware
* error occurred at the OS, browser or web page level, which prevented access to the device.
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
DEVICE_ALREADY_IN_USE = "DEVICE_ALREADY_IN_USE",
/**
* The user hasn't granted permissions to capture some desktop screen when the browser asked for them.
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
SCREEN_CAPTURE_DENIED = 'SCREEN_CAPTURE_DENIED',
/**
* Browser does not support screen sharing.
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
SCREEN_SHARING_NOT_SUPPORTED = 'SCREEN_SHARING_NOT_SUPPORTED',
/**
* Only for Chrome, there's no screen sharing extension installed
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
SCREEN_EXTENSION_NOT_INSTALLED = 'SCREEN_EXTENSION_NOT_INSTALLED',
/**
* Only for Chrome, the screen sharing extension is installed but is disabled
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
SCREEN_EXTENSION_DISABLED = 'SCREEN_EXTENSION_DISABLED',
/**
* No video input device found with the provided deviceId (property [[PublisherProperties.videoSource]])
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
INPUT_VIDEO_DEVICE_NOT_FOUND = 'INPUT_VIDEO_DEVICE_NOT_FOUND',
/**
* No audio input device found with the provided deviceId (property [[PublisherProperties.audioSource]])
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
INPUT_AUDIO_DEVICE_NOT_FOUND = 'INPUT_AUDIO_DEVICE_NOT_FOUND',
/**
* There was an unknown error when trying to access the specified audio device
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
INPUT_AUDIO_DEVICE_GENERIC_ERROR = 'INPUT_AUDIO_DEVICE_GENERIC_ERROR',
/**
* Method [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]] has been called with properties `videoSource` and `audioSource` of
* [[PublisherProperties]] parameter both set to *false* or *null*
*/
NO_INPUT_SOURCE_SET = 'NO_INPUT_SOURCE_SET',
/**
* Some media property of [[PublisherProperties]] such as `frameRate` or `resolution` is not supported
* by the input devices (whenever it is possible they are automatically adjusted to the most similar value).
* Returned upon unsuccessful [[OpenVidu.initPublisher]] or [[OpenVidu.getUserMedia]]
*/
PUBLISHER_PROPERTIES_ERROR = 'PUBLISHER_PROPERTIES_ERROR',
/**
* The client tried to call a method without the required permissions. This can occur for methods [[Session.publish]],
* [[Session.forceUnpublish]], [[Session.forceDisconnect]], [[Stream.applyFilter]], [[Stream.removeFilter]]
*/
OPENVIDU_PERMISSION_DENIED = 'OPENVIDU_PERMISSION_DENIED',
/**
* There is no connection to the Session. This error will be thrown when any method requiring a connection to
* openvidu-server is called before successfully calling method [[Session.connect]]
*/
OPENVIDU_NOT_CONNECTED = 'OPENVIDU_NOT_CONNECTED',
/**
* Error related to [Virtual Background](/en/stable/advanced-features/virtual-background/)
*/
VIRTUAL_BACKGROUND_ERROR = 'VIRTUAL_BACKGROUND_ERROR',
/**
* Generic error
*/
GENERIC_ERROR = 'GENERIC_ERROR'
}
/**
* Simple object to identify runtime errors on the client side
*/
export class OpenViduError {
/**
* Uniquely identifying name of the error
*/
name: OpenViduErrorName;
/**
* Full description of the error
*/
message: string;
/**
* @hidden
*/
constructor(name: OpenViduErrorName, message: string) {
this.name = name;
this.message = message;
}
}

View File

@ -1,23 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
export enum TypeOfVideo {
CAMERA = 'CAMERA',
SCREEN = 'SCREEN',
CUSTOM = 'CUSTOM',
IPCAM = 'IPCAM'
}

View File

@ -1,44 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* How the video will be inserted in the DOM for Publishers and Subscribers. See [[PublisherProperties.insertMode]] and [[SubscriberProperties.insertMode]]
*/
export enum VideoInsertMode {
/**
* Video inserted after the target element (as next sibling)
*/
AFTER = 'AFTER',
/**
* Video inserted as last child of the target element
*/
APPEND = 'APPEND',
/**
* Video inserted before the target element (as previous sibling)
*/
BEFORE = 'BEFORE',
/**
* Video inserted as first child of the target element
*/
PREPEND = 'PREPEND',
/**
* Video replaces target element
*/
REPLACE = 'REPLACE'
}

View File

@ -1,63 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Connection } from '../../OpenVidu/Connection';
import { Session } from '../../OpenVidu/Session';
/**
* Triggered by:
* - [[connectionCreated]]
* - [[connectionDestroyed]]
*/
export class ConnectionEvent extends Event {
/**
* Connection object that was created or destroyed
*/
connection: Connection;
/**
* For `connectionDestroyed` event:
* - "disconnect": the remote user has called `Session.disconnect()`
* - "forceDisconnectByUser": the remote user has been evicted from the Session by other user calling `Session.forceDisconnect()`
* - "forceDisconnectByServer": the remote user has been evicted from the Session by the application
* - "sessionClosedByServer": the Session has been closed by the application
* - "networkDisconnect": the remote user network connection has dropped
* - "nodeCrashed": a node has crashed in the server side
*
* For `connectionCreated` event an empty string
*/
reason: string;
/**
* @hidden
*/
constructor(cancelable: boolean, target: Session, type: string, connection: Connection, reason: string) {
super(cancelable, target, type);
this.connection = connection;
this.reason = reason;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,66 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Connection } from '../../OpenVidu/Connection';
import { Session } from '../../OpenVidu/Session';
import { Event } from './Event';
/**
* **This feature is part of OpenVidu Pro tier** <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" style="display: inline-block; background-color: rgb(0, 136, 170); color: white; font-weight: bold; padding: 0px 5px; margin-right: 5px; border-radius: 3px; font-size: 13px; line-height:21px; font-family: Montserrat, sans-serif">PRO</a>
*
* Triggered by [[connectionPropertyChanged]]
*/
export class ConnectionPropertyChangedEvent extends Event {
/**
* The Connection whose property has changed
*/
connection: Connection;
/**
* The property of the stream that changed. This value is either `"role"` or `"record"`
*/
changedProperty: string;
/**
* New value of the property (after change, current value)
*/
newValue: Object;
/**
* Previous value of the property (before change)
*/
oldValue: Object;
/**
* @hidden
*/
constructor(target: Session, connection: Connection, changedProperty: string, newValue: Object, oldValue: Object) {
super(false, target, 'connectionPropertyChanged');
this.connection = connection;
this.changedProperty = changedProperty;
this.newValue = newValue;
this.oldValue = oldValue;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,85 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Filter } from '../../OpenVidu/Filter';
import { StreamManager } from '../../OpenVidu/StreamManager';
import { Session } from '../../OpenVidu/Session';
export abstract class Event {
/**
* Whether the event has a default behavior that may be prevented by calling [[Event.preventDefault]]
*/
cancelable: boolean;
/**
* The object that dispatched the event
*/
target: Session | StreamManager | Filter;
/**
* The type of event. This is the same string you pass as first parameter when calling method `on()` of any object implementing [[EventDispatcher]] interface
*/
type: string;
/**
* @hidden
*/
hasBeenPrevented = false;
/**
* @hidden
*/
constructor(cancelable: boolean, target: Session | StreamManager | Filter, type: string) {
this.cancelable = cancelable;
this.target = target;
this.type = type;
}
/**
* Whether the default beahivour of the event has been prevented or not. Call [[Event.preventDefault]] to prevent it
*/
isDefaultPrevented(): boolean {
return this.hasBeenPrevented;
}
/**
* Prevents the default behavior of the event. The following events have a default behavior:
*
* - `sessionDisconnected`: dispatched by [[Session]] object, automatically unsubscribes the leaving participant from every Subscriber object of the session (this includes closing the RTCPeerConnection and disposing all MediaStreamTracks)
* and also deletes any HTML video element associated to each Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
* by calling [[Subscriber.createVideoElement]]). For every video removed, each Subscriber object will also dispatch a `videoElementDestroyed` event.
*
* - `streamDestroyed`:
* - If dispatched by a [[Publisher]] (*you* have unpublished): automatically stops all media tracks and deletes any HTML video element associated to it (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement`
* in method [[OpenVidu.initPublisher]] or by calling [[Publisher.createVideoElement]]). For every video removed, the Publisher object will also dispatch a `videoElementDestroyed` event.
* - If dispatched by [[Session]] (*other user* has unpublished): automatically unsubscribes the proper Subscriber object from the session (this includes closing the RTCPeerConnection and disposing all MediaStreamTracks)
* and also deletes any HTML video element associated to that Subscriber (only those created by OpenVidu Browser, either by passing a valid parameter as `targetElement` in method [[Session.subscribe]] or
* by calling [[Subscriber.createVideoElement]]). For every video removed, the Subscriber object will also dispatch a `videoElementDestroyed` event.
*/
preventDefault() {
// tslint:disable-next-line:no-empty
this.callDefaultBehavior = () => { };
this.hasBeenPrevented = true;
}
/**
* @hidden
*/
abstract callDefaultBehavior();
}

View File

@ -1,21 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* All OpenVidu Browser events inherit from this interface
*/
export interface EventMap { }

View File

@ -1,71 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { StreamEvent } from '../StreamEvent';
import { StreamManagerEventMap } from './StreamManagerEventMap';
/**
* Events dispatched by [[Publisher]] object. Manage event listeners with
* [[Publisher.on]], [[Publisher.once]] and [[Publisher.off]] methods.
*/
export interface PublisherEventMap extends StreamManagerEventMap {
/**
* Event dispatched when the [[Publisher]] has been published to the session (see [[Session.publish]]).
*/
streamCreated: StreamEvent;
/**
* Event dispatched when the [[Publisher]] has been unpublished from the session.
*/
streamDestroyed: StreamEvent;
/**
* Event dispatched when a Publisher tries to access some media input device and has the required permissions to do so.
*
* This happens when calling [[OpenVidu.initPublisher]] or [[OpenVidu.initPublisherAsync]] and the application
* has permissions to use the devices. This usually means the user has accepted the permissions dialog that the
* browser will show when trying to access the camera/microphone/screen.
*/
accessAllowed: never;
/**
* Event dispatched when a Publisher tries to access some media input device and does NOT have the required permissions to do so.
*
* This happens when calling [[OpenVidu.initPublisher]] or [[OpenVidu.initPublisherAsync]] and the application
* lacks the required permissions to use the devices. This usually means the user has NOT accepted the permissions dialog that the
* browser will show when trying to access the camera/microphone/screen.
*/
accessDenied: never;
/**
* Event dispatched when the pop-up shown by the browser to request permissions for the input media devices is opened.
*
* You can use this event to alert the user about granting permissions for your website. Note that this event is artificially
* generated based only on time intervals when accessing media devices. A heavily overloaded client device that simply takes more
* than usual to access the media device could produce a false trigger of this event.
*/
accessDialogOpened: never;
/**
* Event dispatched after the user clicks on "Allow" or "Block" in the pop-up shown by the browser to request permissions
* for the input media devices.
*
* This event can only be triggered after an [[accessDialogOpened]] event has been previously triggered.
*/
accessDialogClosed: never;
}

View File

@ -1,174 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { EventMap } from './EventMap';
import { ConnectionEvent } from '../ConnectionEvent';
import { ConnectionPropertyChangedEvent } from '../ConnectionPropertyChangedEvent';
import { ExceptionEvent } from '../ExceptionEvent';
import { NetworkQualityLevelChangedEvent } from '../NetworkQualityLevelChangedEvent';
import { PublisherSpeakingEvent } from '../PublisherSpeakingEvent';
import { RecordingEvent } from '../RecordingEvent';
import { SessionDisconnectedEvent } from '../SessionDisconnectedEvent';
import { SignalEvent } from '../SignalEvent';
import { StreamEvent } from '../StreamEvent';
import { StreamPropertyChangedEvent } from '../StreamPropertyChangedEvent';
/**
* Events dispatched by [[Session]] object. Manage event listeners with
* [[Session.on]], [[Session.once]] and [[Session.off]] methods.
*/
export interface SessionEventMap extends EventMap {
/**
* Event dispatched when a new user has connected to the session.
*
* It is fired for both the local user and remote users.
*/
connectionCreated: ConnectionEvent;
/**
* Event dispatched when a remote user has left the session.
*
* For the local user see [[sessionDisconnected]].
*/
connectionDestroyed: ConnectionEvent;
/**
* **This feature is part of OpenVidu Pro tier** <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" style="display: inline-block; background-color: rgb(0, 136, 170); color: white; font-weight: bold; padding: 0px 5px; margin-right: 5px; border-radius: 3px; font-size: 13px; line-height:21px; font-family: Montserrat, sans-serif">PRO</a>
*
* Event dispatched when a property of the local [[Connection]] object changes.
*
* It is fired only for the local user.
*
* The properties that may change are [[Connection.role]] and [[Connection.record]].
* The only way the Connection properties may change is by updating them through:
*
* - [API REST](/en/stable/reference-docs/REST-API/#patch-connection)
* - [openvidu-java-client](/en/stable/reference-docs/openvidu-java-client/#update-a-connection)
* - [openvidu-node-client](/en/stable/reference-docs/openvidu-node-client/#update-a-connection)<br><br>
*/
connectionPropertyChanged: ConnectionPropertyChangedEvent;
/**
* Event dispatched when the local user has left the session.
*
* For remote users see [[connectionDestroyed]].
*/
sessionDisconnected: SessionDisconnectedEvent;
/**
* Event dispatched when a user has started publishing media to the session (see [[Session.publish]]).
*
* It is fired for both the local user and remote users.
*/
streamCreated: StreamEvent;
/**
* Event dispatched when a user stops publishing media to the session.
*
* It is fired for both the local user and remote users.
*/
streamDestroyed: StreamEvent;
/**
* Event dispatched when a Stream undergoes any change in any of its mutable properties
* (see [[StreamPropertyChangedEvent.changedProperty]]).
*
* It is fired for both remote streams (owned by a [[Subscriber]]) or local streams (owned by a [[Publisher]]).
*/
streamPropertyChanged: StreamPropertyChangedEvent;
/**
* Event dispatched when a user has started speaking.
*
* It is fired for both the local user and remote users.
*
* Extra information:
* - This event will only be triggered for **streams that have audio tracks** ([[Stream.hasAudio]] must be true).
* - Further configuration can be applied on how the event is dispatched by setting property `publisherSpeakingEventsOptions` in the call of [[OpenVidu.setAdvancedConfiguration]].
*/
publisherStartSpeaking: PublisherSpeakingEvent;
/**
* Event dispatched when a user has stopped speaking.
*
* It is fired for both the local user and remote users.
*
* Extra information:
* - This event will only be triggered for **streams that have audio tracks** ([[Stream.hasAudio]] must be true).
* - Further configuration can be applied on how the event is dispatched by setting property `publisherSpeakingEventsOptions` in the call of [[OpenVidu.setAdvancedConfiguration]].
*/
publisherStopSpeaking: PublisherSpeakingEvent;
/**
* @hidden
*/
[key: `signal:${string}`]: SignalEvent;
/**
* Event dispatched when a signal is received (see [Send text messages between users](/en/stable/cheatsheet/send-messages)).
*
* If the listener is added as **`signal:TYPE`**, only signals of type **`TYPE`** will trigger the event.
*/
signal: SignalEvent;
/**
* Event dispatched when the session has started being recorded.
*
* Property **`OPENVIDU_RECORDING_NOTIFICATION`** of [OpenVidu Server configuration](/en/stable/reference-docs/openvidu-config/)
* defines which users should receive this events (by default, only users with role `PUBLISHER` or `MODERATOR`)
*/
recordingStarted: RecordingEvent;
/**
* Event dispatched when the session has stopped being recorded.
*
* Property **`OPENVIDU_RECORDING_NOTIFICATION`** of [OpenVidu Server configuration](/en/stable/reference-docs/openvidu-config/)
* defines which users should receive this events (by default, only users with role `PUBLISHER` or `MODERATOR`)
*/
recordingStopped: RecordingEvent;
/**
* **This feature is part of OpenVidu Pro tier** <a href="https://docs.openvidu.io/en/stable/openvidu-pro/" style="display: inline-block; background-color: rgb(0, 136, 170); color: white; font-weight: bold; padding: 0px 5px; margin-right: 5px; border-radius: 3px; font-size: 13px; line-height:21px; font-family: Montserrat, sans-serif">PRO</a>
*
* Event dispatched when the network quality level of a [[Connection]] changes. See [network quality](/en/stable/advanced-features/network-quality/).
*/
networkQualityLevelChanged: NetworkQualityLevelChangedEvent;
/**
* Event dispatched when the local user has lost its connection to the session, and starts the automatic reconnection process.
*
* See [Reconnection events](/en/stable/advanced-features/automatic-reconnection/#reconnection-events).
*/
reconnecting: never;
/**
* Event dispatched when the local user has successfully recovered its connection to the session after losing it.
*
* If the connection was recovered but OpenVidu Server already evicted the user due to timeout, then this event will
* not be dispatched. A [[sessionDisconnected]] event with reason `networkDisconnect` will be triggered instead.
*
* See [Reconnection events](/en/stable/advanced-features/automatic-reconnection/#reconnection-events).
*/
reconnected: never;
/**
* This event acts as a global handler for asynchronous errors that may be triggered for multiple reasons and from multiple origins.
* To see the different types of exceptions go to [[ExceptionEventName]].
*/
exception: ExceptionEvent;
}

View File

@ -1,81 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { EventMap } from './EventMap';
import { PublisherSpeakingEvent } from '../PublisherSpeakingEvent';
import { StreamManagerEvent } from '../StreamManagerEvent';
import { StreamPropertyChangedEvent } from '../StreamPropertyChangedEvent';
import { VideoElementEvent } from '../VideoElementEvent';
/**
* Events dispatched by [[StreamManager]] object. Manage event listeners with
* [[StreamManager.on]], [[StreamManager.once]] and [[StreamManager.off]] methods.
*/
export interface StreamManagerEventMap extends EventMap {
/**
* Event dispatched when a new HTML video element has been inserted into DOM by OpenVidu Browser library. See
* [Manage video players](/en/stable/cheatsheet/manage-videos) section.
*/
videoElementCreated: VideoElementEvent;
/**
* Event dispatched when an HTML video element has been removed from DOM by OpenVidu Browser library. See
* [Manage video players](/en/stable/cheatsheet/manage-videos) section.
*/
videoElementDestroyed: VideoElementEvent;
/**
* Event dispatched when the media stream starts playing (one of its videos has media and has begun to play).
* This event will be dispatched when these 3 conditions are met:
* 1. The StreamManager has no video associated in the DOM.
* 2. It is associated to one video.
* 3. That video starts playing. Internally the expected Web API event is [HTMLMediaElement.canplay](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canplay_event).
*/
streamPlaying: StreamManagerEvent;
/**
* Event dispatched when the volume of the media stream's audio track changes. Only applies if [[Stream.hasAudio]] is `true`.
* The frequency this event is fired with is defined by property `interval` of
* [[OpenViduAdvancedConfiguration.publisherSpeakingEventsOptions]] (default 100ms)
*/
streamAudioVolumeChange: StreamManagerEvent;
/**
* Event dispatched when a Stream undergoes any change in any of its mutable properties
* (see [[StreamPropertyChangedEvent.changedProperty]]).
*/
streamPropertyChanged: StreamPropertyChangedEvent;
/**
* Event dispatched when the user owning the stream has started speaking.
*
* Extra information:
* - This event will only be triggered for **streams that have audio tracks** ([[Stream.hasAudio]] must be true).
* - Further configuration can be applied on how the event is dispatched by setting property `publisherSpeakingEventsOptions` in the call of [[OpenVidu.setAdvancedConfiguration]].
*/
publisherStartSpeaking: PublisherSpeakingEvent;
/**
* Event dispatched when the user owning the stream has stopped speaking.
*
* Extra information:
* - This event will only be triggered for **streams that have audio tracks** ([[Stream.hasAudio]] must be true).
* - Further configuration can be applied on how the event is dispatched by setting property `publisherSpeakingEventsOptions` in the call of [[OpenVidu.setAdvancedConfiguration]].
*/
publisherStopSpeaking: PublisherSpeakingEvent;
}

View File

@ -1,131 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Session } from '../../OpenVidu/Session';
import { Stream } from '../../OpenVidu/Stream';
import { Subscriber } from '../../OpenVidu/Subscriber';
import { Event } from './Event';
/**
* Defines property [[ExceptionEvent.name]]
*/
export enum ExceptionEventName {
/**
* There was an unexpected error on the server-side processing an ICE candidate generated and sent by the client-side.
*
* [[ExceptionEvent]] objects with this [[ExceptionEvent.name]] will have as [[ExceptionEvent.origin]] property a [[Session]] object.
*/
ICE_CANDIDATE_ERROR = 'ICE_CANDIDATE_ERROR',
/**
* The [ICE connection state](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/iceConnectionState)
* of an [RTCPeerConnection](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection) reached `failed` status.
*
* This is a terminal error that won't have any kind of possible recovery. If the client is still connected to OpenVidu Server,
* then an automatic reconnection process of the media stream is immediately performed. If the ICE connection has broken due to
* a total network drop, then no automatic reconnection process will be possible.
*
* [[ExceptionEvent]] objects with this [[ExceptionEvent.name]] will have as [[ExceptionEvent.origin]] property a [[Stream]] object.
*/
ICE_CONNECTION_FAILED = 'ICE_CONNECTION_FAILED',
/**
* The [ICE connection state](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/iceConnectionState)
* of an [RTCPeerConnection](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection) reached `disconnected` status.
*
* This is not a terminal error, and it is possible for the ICE connection to be reconnected. If the client is still connected to
* OpenVidu Server and after certain timeout the ICE connection has not reached a success or terminal status, then an automatic
* reconnection process of the media stream is performed. If the ICE connection has broken due to a total network drop, then no
* automatic reconnection process will be possible.
*
* You can customize the timeout for the reconnection attempt with property [[OpenViduAdvancedConfiguration.iceConnectionDisconnectedExceptionTimeout]],
* which by default is 4000 milliseconds.
*
* [[ExceptionEvent]] objects with this [[ExceptionEvent.name]] will have as [[ExceptionEvent.origin]] property a [[Stream]] object.
*/
ICE_CONNECTION_DISCONNECTED = 'ICE_CONNECTION_DISCONNECTED',
/**
* A [[Subscriber]] object has not fired event `streamPlaying` after certain timeout. `streamPlaying` event belongs to [[StreamManagerEvent]]
* category. It wraps Web API native event [canplay](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canplay_event).
*
* OpenVidu Browser can take care of the video players (see [here](/en/stable/cheatsheet/manage-videos/#let-openvidu-take-care-of-the-video-players)),
* or you can take care of video players on your own (see [here](/en/stable/cheatsheet/manage-videos/#you-take-care-of-the-video-players)).
* Either way, whenever a [[Subscriber]] object is commanded to attach its [[Stream]] to a video element, it is supposed to fire `streamPlaying`
* event shortly after. If it does not, then we can safely assume that something wrong has happened while playing the remote video and the
* application may be notified through this specific ExceptionEvent.
*
* The timeout can be configured with property [[OpenViduAdvancedConfiguration.noStreamPlayingEventExceptionTimeout]]. By default it is 4000 milliseconds.
*
* This is just an informative exception. It only means that a remote Stream that is supposed to be playing by a video player has not done so
* in a reasonable time. But the lack of the event can be caused by multiple reasons. If a Subscriber is not playing its Stream, the origin
* of the problem could be located at the Publisher side. Or may be caused by a transient network problem. But it also could be a problem with
* autoplay permissions. Bottom line, the cause can be very varied, and depending on the application the lack of the event could even be expected.
*
* [[ExceptionEvent]] objects with this [[ExceptionEvent.name]] will have as [[ExceptionEvent.origin]] property a [[Subscriber]] object.
*/
NO_STREAM_PLAYING_EVENT = 'NO_STREAM_PLAYING_EVENT'
}
/**
* Triggered by [[SessionEventMap.exception]]
*/
export class ExceptionEvent extends Event {
/**
* Name of the exception
*/
name: ExceptionEventName;
/**
* Object affected by the exception. Depending on the [[ExceptionEvent.name]] property:
* - [[Session]]: `ICE_CANDIDATE_ERROR`
* - [[Stream]]: `ICE_CONNECTION_FAILED`, `ICE_CONNECTION_DISCONNECTED`
* - [[Subscriber]]: `NO_STREAM_PLAYING_EVENT`
*/
origin: Session | Stream | Subscriber;
/**
* Informative description of the exception
*/
message: string;
/**
* Any extra information associated to the exception
*/
data?: any;
/**
* @hidden
*/
constructor(session: Session, name: ExceptionEventName, origin: Session | Stream | Subscriber, message: string, data?: any) {
super(false, session, 'exception');
this.name = name;
this.origin = origin;
this.message = message;
this.data = data;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,46 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Filter } from '../../OpenVidu/Filter';
/**
* Defines every event dispatched by audio/video stream filters. You can subscribe to filter events by calling [[Filter.addEventListener]]
*/
export class FilterEvent extends Event {
/**
* Data of the event
*/
data: Object;
/**
* @hidden
*/
constructor(target: Filter, eventType: string, data: Object) {
super(false, target, eventType);
this.data = data;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,58 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Session } from '../../OpenVidu/Session';
import { Connection } from '../../OpenVidu/Connection';
/**
* Triggered by [[networkQualityLevelChanged]]
*/
export class NetworkQualityLevelChangedEvent extends Event {
/**
* New value of the network quality level
*/
newValue: number;
/**
* Old value of the network quality level
*/
oldValue: number;
/**
* Connection for whom the network quality level changed
*/
connection: Connection
/**
* @hidden
*/
constructor(target: Session, newValue: number, oldValue: number, connection: Connection) {
super(false, target, 'networkQualityLevelChanged');
this.newValue = newValue;
this.oldValue = oldValue;
this.connection = connection;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,57 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Connection } from '../../OpenVidu/Connection';
import { Session } from '../../OpenVidu/Session';
import { StreamManager } from '../../OpenVidu/StreamManager';
/**
* Triggered by:
* - `publisherStartSpeaking` (available for [Session](/en/stable/api/openvidu-browser/interfaces/SessionEventMap.html#publisherStartSpeaking) and [StreamManager](/en/stable/api/openvidu-browser/interfaces/StreamManagerEventMap.html#publisherStartSpeaking) objects)
* - `publisherStopSpeaking` (available for [Session](/en/stable/api/openvidu-browser/interfaces/SessionEventMap.html#publisherStopSpeaking) and [StreamManager](/en/stable/api/openvidu-browser/interfaces/StreamManagerEventMap.html#publisherStopSpeaking) objects)
*/
export class PublisherSpeakingEvent extends Event {
/**
* The client that started or stopped speaking
*/
connection: Connection;
/**
* The streamId of the Stream affected by the speaking event
*/
streamId: string;
/**
* @hidden
*/
constructor(target: Session | StreamManager, type: string, connection: Connection, streamId: string) {
super(false, target, type);
this.type = type;
this.connection = connection;
this.streamId = streamId;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,73 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Session } from '../../OpenVidu/Session';
/**
* Triggered by:
* - [[recordingStarted]]
* - [[recordingStopped]]
*/
export class RecordingEvent extends Event {
/**
* The recording ID generated in openvidu-server
*/
id: string;
/**
* The recording name you supplied to openvidu-server. For example, to name your recording file MY_RECORDING:
* - With **API REST**: POST to `/api/recordings/start` passing JSON body `{"session":"sessionId","name":"MY_RECORDING"}`
* - With **openvidu-java-client**: `OpenVidu.startRecording(sessionId, "MY_RECORDING")` or `OpenVidu.startRecording(sessionId, new RecordingProperties.Builder().name("MY_RECORDING").build())`
* - With **openvidu-node-client**: `OpenVidu.startRecording(sessionId, "MY_RECORDING")` or `OpenVidu.startRecording(sessionId, {name: "MY_RECORDING"})`
*
* If no name is supplied, this property will be undefined and the recorded file will be named after property [[id]]
*/
name?: string;
/**
* 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](/en/stable/advanced-features/recording/#automatic-stop-of-recordings)
* - "nodeCrashed": a node has crashed in the server side
*
* For 'recordingStarted' empty string
*/
reason?: string;
/**
* @hidden
*/
constructor(target: Session, type: string, id: string, name: string, reason?: string) {
super(false, target, type);
this.id = id;
if (name !== id) {
this.name = name;
}
this.reason = reason;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,83 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Session } from '../../OpenVidu/Session';
import { OpenViduLogger } from '../Logger/OpenViduLogger';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* Triggered by [[sessionDisconnected]]
*/
export class SessionDisconnectedEvent extends Event {
/**
* - "disconnect": you have called `Session.disconnect()`
* - "forceDisconnectByUser": you have been evicted from the Session by other user calling `Session.forceDisconnect()`
* - "forceDisconnectByServer": you have been evicted from the Session by the application
* - "sessionClosedByServer": the Session has been closed by the application
* - "networkDisconnect": your network connection has dropped. Before a SessionDisconnectedEvent with this reason is triggered,
* Session object will always have previously dispatched a `reconnecting` event. If the reconnection process succeeds,
* Session object will dispatch a `reconnected` event. If it fails, Session object will dispatch a SessionDisconnectedEvent
* with reason "networkDisconnect"
* - "nodeCrashed": a node has crashed in the server side. You can use this reason to ask your application's backend to reconnect
* to a new session to replace the crashed one
*/
reason: string;
/**
* @hidden
*/
constructor(target: Session, reason: string) {
super(true, target, 'sessionDisconnected');
this.reason = reason;
}
/**
* @hidden
*/
callDefaultBehavior() {
logger.info("Calling default behavior upon '" + this.type + "' event dispatched by 'Session'");
const session = <Session>this.target;
// Dispose and delete all remote Connections
session.remoteConnections.forEach(remoteConnection => {
const connectionId = remoteConnection.connectionId;
if (!!session.remoteConnections.get(connectionId)?.stream) {
session.remoteConnections.get(connectionId)?.stream!.disposeWebRtcPeer();
session.remoteConnections.get(connectionId)?.stream!.disposeMediaStream();
if (session.remoteConnections.get(connectionId)?.stream!.streamManager) {
session.remoteConnections.get(connectionId)?.stream!.streamManager.removeAllVideos();
}
const streamId = session.remoteConnections.get(connectionId)?.stream?.streamId;
if (!!streamId) {
session.remoteStreamsCreated.delete(streamId);
}
session.remoteConnections.get(connectionId)?.dispose();
}
session.remoteConnections.delete(connectionId);
});
}
}

View File

@ -1,67 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Connection } from '../../OpenVidu/Connection';
import { Session } from '../../OpenVidu/Session';
/**
* Triggered by [[SessionEventMap.signal]]
*/
export class SignalEvent extends Event {
/**
* The type of signal. It is string `"signal"` for those signals sent with no [[SignalOptions.type]] property, and `"signal:type"` if was sent with a
* valid [[SignalOptions.type]] property.
*
* The client must be specifically subscribed to `Session.on('signal:type', function(signalEvent) {...})` to trigger that type of signal.
*
* Subscribing to `Session.on('signal', function(signalEvent) {...})` will trigger all signals, no matter their type.
*/
type: string;
/**
* The message of the signal (can be empty)
*/
data?: string;
/**
* The client that sent the signal. This property is undefined if the signal
* was directly generated by the application server (not by other client)
*/
from?: Connection;
/**
* @hidden
*/
constructor(target: Session, type?: string, data?: string, from?: Connection) {
super(false, target, 'signal');
if (!!type) {
this.type = 'signal:' + type;
}
this.data = data;
this.from = from;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,116 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Publisher } from '../../OpenVidu/Publisher';
import { Session } from '../../OpenVidu/Session';
import { Stream } from '../../OpenVidu/Stream';
import { OpenViduLogger } from '../Logger/OpenViduLogger';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* Triggered by:
* - `streamCreated` (available for [Session](/en/stable/api/openvidu-browser/interfaces/SessionEventMap.html#streamCreated) and [Publisher](/en/stable/api/openvidu-browser/interfaces/PublisherEventMap.html#streamCreated) objects)
* - `streamDestroyed]` (available for [Session](/en/stable/api/openvidu-browser/interfaces/SessionEventMap.html#streamDestroyed) and [Publisher](/en/stable/api/openvidu-browser/interfaces/PublisherEventMap.html#streamDestroyed) objects)
*/
export class StreamEvent extends Event {
/**
* Stream object that was created or destroyed
*/
stream: Stream;
/**
* For 'streamDestroyed' event:
* - "unpublish": method `Session.unpublish()` has been called
* - "disconnect": method `Session.disconnect()` has been called
* - "forceUnpublishByUser": some user has called `Session.forceUnpublish()` over the Stream
* - "forceDisconnectByUser": some user has called `Session.forceDisconnect()` over the Stream
* - "forceUnpublishByServer": the user's stream has been unpublished from the Session by the application
* - "forceDisconnectByServer": the user has been evicted from the Session by the application
* - "sessionClosedByServer": the Session has been closed by the application
* - "networkDisconnect": the user's network connection has dropped
* - "nodeCrashed": a node has crashed in the server side
*
* For 'streamCreated' empty string
*/
reason: string;
/**
* @hidden
*/
constructor(cancelable: boolean, target: Session | Publisher, type: string, stream: Stream, reason: string) {
super(cancelable, target, type);
this.stream = stream;
this.reason = reason;
}
/**
* @hidden
*/
callDefaultBehavior() {
if (this.type === 'streamDestroyed') {
if (this.target instanceof Session) {
// Remote Stream
logger.info("Calling default behavior upon '" + this.type + "' event dispatched by 'Session'");
this.stream.disposeWebRtcPeer();
} else if (this.target instanceof Publisher) {
// Local Stream
logger.info("Calling default behavior upon '" + this.type + "' event dispatched by 'Publisher'");
clearInterval((<Publisher>this.target).screenShareResizeInterval);
this.stream.isLocalStreamReadyToPublish = false;
// Delete Publisher object from OpenVidu publishers array
const openviduPublishers = (<Publisher>this.target).openvidu.publishers;
for (let i = 0; i < openviduPublishers.length; i++) {
if (openviduPublishers[i] === (<Publisher>this.target)) {
openviduPublishers.splice(i, 1);
break;
}
}
}
// Dispose the MediaStream local object
this.stream.disposeMediaStream();
// Remove from DOM all video elements associated to this Stream, if there's a StreamManager defined
// (method Session.subscribe must have been called)
if (this.stream.streamManager) this.stream.streamManager.removeAllVideos();
// Delete stream from Session.remoteStreamsCreated map
this.stream.session.remoteStreamsCreated.delete(this.stream.streamId);
// Delete StreamOptionsServer from remote Connection
const remoteConnection = this.stream.session.remoteConnections.get(this.stream.connection.connectionId);
if (!!remoteConnection && !!remoteConnection.remoteOptions) {
const streamOptionsServer = remoteConnection.remoteOptions.streams;
for (let i = streamOptionsServer.length - 1; i >= 0; --i) {
if (streamOptionsServer[i].id === this.stream.streamId) {
streamOptionsServer.splice(i, 1);
}
}
}
}
}
}

View File

@ -1,51 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { StreamManager } from '../../OpenVidu/StreamManager';
/**
* Triggered by:
* - [[streamPlaying]]
* - [[streamAudioVolumeChange]]
*/
export class StreamManagerEvent extends Event {
/**
* For `streamAudioVolumeChange` event:
* - `{newValue: number, oldValue: number}`: new and old audio volume values. These values are between -100 (silence) and 0 (loudest possible volume).
* They are not exact and depend on how the browser is managing the audio track, but -100 and 0 can be taken as limit values.
*
* For `streamPlaying` event undefined
*/
value: Object | undefined;
/**
* @hidden
*/
constructor(target: StreamManager, type: string, value: Object | undefined) {
super(false, target, type);
this.value = value;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,75 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Session } from '../../OpenVidu/Session';
import { Stream } from '../../OpenVidu/Stream';
import { StreamManager } from '../../OpenVidu/StreamManager';
/**
* Triggered by `streamPropertyChanged` (available for [Session](/en/stable/api/openvidu-browser/interfaces/SessionEventMap.html#streamPropertyChanged) and [StreamManager](/en/stable/api/openvidu-browser/interfaces/StreamManagerEventMap.html#streamPropertyChanged) objects)
*/
export class StreamPropertyChangedEvent extends Event {
/**
* The Stream whose property has changed. You can always identify the user publishing the changed stream by consulting property [[Stream.connection]]
*/
stream: Stream;
/**
* The property of the stream that changed. This value is either `"videoActive"`, `"audioActive"`, `"videoDimensions"` or `"filter"`
*/
changedProperty: string;
/**
* Cause of the change on the stream's property:
* - For `videoActive`: `"publishVideo"`
* - For `audioActive`: `"publishAudio"`
* - For `videoDimensions`: `"deviceRotated"`, `"screenResized"` or `"trackReplaced"`
* - For `filter`: `"applyFilter"`, `"execFilterMethod"` or `"removeFilter"`
*/
reason: string;
/**
* New value of the property (after change, current value)
*/
newValue: Object;
/**
* Previous value of the property (before change)
*/
oldValue: Object;
/**
* @hidden
*/
constructor(target: Session | StreamManager, stream: Stream, changedProperty: string, newValue: Object, oldValue: Object, reason: string) {
super(false, target, 'streamPropertyChanged');
this.stream = stream;
this.changedProperty = changedProperty;
this.newValue = newValue;
this.oldValue = oldValue;
this.reason = reason;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,48 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { StreamManager } from '../../OpenVidu/StreamManager';
/**
* Triggered by:
* - [[videoElementCreated]]
* - [[videoElementDestroyed]]
*/
export class VideoElementEvent extends Event {
/**
* Video element that was created or destroyed
*/
element: HTMLVideoElement;
/**
* @hidden
*/
constructor(element: HTMLVideoElement, target: StreamManager, type: string) {
super(false, target, type);
this.element = element;
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
}

View File

@ -1,22 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
export interface CustomMediaStreamConstraints {
constraints: MediaStreamConstraints;
audioTrack: MediaStreamTrack | undefined;
videoTrack: MediaStreamTrack | undefined;
}

View File

@ -1,21 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
export interface IceServerProperties {
url: string;
username?: string;
credential?: string;
}

View File

@ -1,34 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Connection } from '../../../OpenVidu/Connection';
import { Filter } from '../../../OpenVidu/Filter';
import { TypeOfVideo } from '../../Enums/TypeOfVideo';
export interface InboundStreamOptions {
id: string;
createdAt: number;
connection: Connection;
hasAudio: boolean;
hasVideo: boolean;
audioActive: boolean;
videoActive: boolean;
typeOfVideo: TypeOfVideo;
frameRate: number;
videoDimensions: { width: number, height: number };
filter?: Filter;
}

View File

@ -1,40 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { RemoteConnectionOptions } from './RemoteConnectionOptions';
import { IceServerProperties } from './IceServerProperties';
export interface LocalConnectionOptions {
id: string;
finalUserId: string;
createdAt: number;
metadata: string;
value: RemoteConnectionOptions[];
session: string; // OpenVidu Session identifier
sessionId: string; // JSON-RPC session identifier
role: string;
record: boolean;
coturnIp: string;
coturnPort: number;
turnUsername: string;
turnCredential: string;
version: string;
mediaServer: string;
videoSimulcast: boolean;
life: number;
customIceServers?: IceServerProperties[]
}

View File

@ -1,23 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { PublisherProperties } from '../Public/PublisherProperties';
export interface OutboundStreamOptions {
publisherProperties: PublisherProperties;
mediaConstraints: MediaStreamConstraints;
}

View File

@ -1,25 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { StreamOptionsServer } from './StreamOptionsServer';
export interface RemoteConnectionOptions {
id: string;
createdAt: number;
metadata: string;
streams: StreamOptionsServer[];
}

View File

@ -1,22 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
export interface SessionOptions {
sessionId: string;
participantId: string;
metadata: string;
}

View File

@ -1,24 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Connection } from '../../../OpenVidu/Connection';
export interface SignalOptions {
type?: string;
to?: Connection[];
data?: string;
}

View File

@ -1,32 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Filter } from '../../../OpenVidu/Filter';
import { TypeOfVideo } from '../../Enums/TypeOfVideo';
export interface StreamOptionsServer {
id: string;
createdAt: number;
hasAudio: boolean;
hasVideo: boolean;
audioActive: boolean;
videoActive: boolean;
typeOfVideo: TypeOfVideo;
frameRate: number;
videoDimensions: string;
filter: Filter;
}

View File

@ -1,43 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* See [[Session.capabilities]]
*/
export interface Capabilities {
/**
* `true` if the client can call [[Session.forceDisconnect]], `false` if not
*/
forceDisconnect: boolean;
/**
* `true` if the client can call [[Session.forceUnpublish]], `false` if not
*/
forceUnpublish: boolean;
/**
* `true` if the client can call [[Session.publish]], `false` if not
*/
publish: boolean;
/**
* `true` if the client can call [[Session.subscribe]], `false` if not (true for every user for now)
*/
subscribe: boolean;
}

View File

@ -1,37 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* See [[OpenVidu.getDevices]]
*/
export interface Device {
/**
* `"videoinput"`, `"audioinput"`
*/
kind: string;
/**
* Unique ID for the device. Use it on `audioSource` or `videoSource` properties of [[PublisherProperties]]
*/
deviceId: string;
/**
* Description of the device. An empty string if the user hasn't granted permissions to the site to access the device
*/
label: string;
}

View File

@ -1,74 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/**
* See [[OpenVidu.setAdvancedConfiguration]]
*/
export interface OpenViduAdvancedConfiguration {
/**
* Array of [RTCIceServer](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer) to be used by OpenVidu Browser. By default OpenVidu will generate the required credentials to use the COTURN server hosted along OpenVidu Server
* You can also set this property to string 'freeice' to force the use of free STUN servers instead (got thanks to [freeice](https://github.com/DamonOehlman/freeice) library).
*/
iceServers?: RTCIceServer[] | string;
/**
* URL to a custom screen share extension for Chrome (always based on ours: [openvidu-screen-sharing-chrome-extension](https://github.com/OpenVidu/openvidu-screen-sharing-chrome-extension)) to be used instead of the default one.
* Must be something like this: `https://chrome.google.com/webstore/detail/YOUR_WEBSTORE_EXTENSION_NAME/YOUR_EXTENSION_ID`
*/
screenShareChromeExtension?: string;
/**
* Custom configuration for the [[PublisherSpeakingEvent]] feature and the [StreamManagerEvent.streamAudioVolumeChange](/en/stable/api/openvidu-browser/classes/StreamManagerEvent.html) feature. It is an object which includes the following optional properties:
* - `interval`: (number) how frequently the analyser polls the audio stream to check if speaking has started/stopped or audio volume has changed. Default **100** (ms)
* - `threshold`: (number) the volume at which _publisherStartSpeaking_ and _publisherStopSpeaking_ events will be fired. Default **-50** (dB)
*
* This sets the global default configuration that will affect all streams, but you can later customize these values for each specific stream by calling [[StreamManager.updatePublisherSpeakingEventsOptions]]
*/
publisherSpeakingEventsOptions?: {
interval?: number;
threshold?: number;
};
/**
* Determines the automatic reconnection process policy. Whenever the client's network drops, OpenVidu Browser starts a reconnection process with OpenVidu Server. After network is recovered, OpenVidu Browser automatically
* inspects all of its media streams to see their status. For any of them that are broken, it asks OpenVidu Server for a forced and silent reconnection.
*
* This policy is technically enough to recover any broken media connection after a network drop, but in practice it has been proven that OpenVidu Browser may think a media connection has properly recovered when in fact it has not.
* This is not a common case, and it only affects Publisher streams, but it may occur. This property allows **forcing OpenVidu Browser to reconnect all of its outgoing media streams** after a network drop regardless of their supposed status.
*
* Default to `false`.
*/
forceMediaReconnectionAfterNetworkDrop?: boolean;
/**
* The milliseconds that must elapse after triggering [[ExceptionEvent]] of name [`ICE_CONNECTION_DISCONNECTED`](/en/stable/api/openvidu-browser/enums/ExceptionEventName.html#ICE_CONNECTION_DISCONNECTED) to perform an automatic reconnection process of the affected media stream.
* This automatic reconnection process can only take place if the client still has network connection to OpenVidu Server. If the ICE connection has broken because of a total network drop,
* then no reconnection process will be possible at all.
*
* Default to `4000`.
*/
iceConnectionDisconnectedExceptionTimeout?: number;
/**
* The milliseconds that must elapse for the [[ExceptionEvent]] of name [`NO_STREAM_PLAYING_EVENT`](/en/stable/api/openvidu-browser/enums/ExceptionEventName.html#NO_STREAM_PLAYING_EVENT) to be fired.
*
* Default to `4000`.
*/
noStreamPlayingEventExceptionTimeout?: number;
}

View File

@ -1,102 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Filter } from '../../../OpenVidu/Filter';
import { VideoInsertMode } from '../../Enums/VideoInsertMode';
/**
* See [[OpenVidu.initPublisher]]
*/
export interface PublisherProperties {
/**
* Which device should provide the audio source. Can be:
* - Property `deviceId` of a [[Device]]
* - A MediaStreamTrack obtained from a MediaStream object with [[OpenVidu.getUserMedia]]
* - `false` or null to have a video-only publisher
* @default _Default microphone_
*/
audioSource?: string | MediaStreamTrack | boolean;
/**
* Desired framerate of the video in frames per second.
* Limiting the framerate has always effect on browsers Chrome and Opera. Firefox requires that the input device explicitly supports the desired framerate.
* @default undefined
*/
frameRate?: number;
/**
* How the video element of the publisher should be inserted in the DOM
* @default VideoInsertMode.APPEND
*/
insertMode?: VideoInsertMode | string;
/**
* Whether the publisher's video will be mirrored in the page or not. Only affects the local view of the publisher in the browser (remote streams will not be mirrored). If `videoSource` is set to "screen" this property is fixed to `false`
* @default true
*/
mirror?: boolean;
/**
* Whether to initially publish to the session with the audio unmuted or muted. Only makes sense if property `audioSource` is NOT set to *false* or *null*. You can change the audio state later during the session with [[Publisher.publishAudio]]
* @default true
*/
publishAudio?: boolean;
/**
* Whether to initially publish to the session with the video enabled or disabled. Only makes sense if property `videoSource` is NOT set to *false* or *null*. You can change the video state later during the session with [[Publisher.publishVideo]]
* @default true
*/
publishVideo?: boolean;
/**
* Resolution of the video: `"320x240"`, `"640x480"`, `"1280x720"` (low, medium and high quality respectively)
* @default "640x480"
*/
resolution?: string;
/**
* Which device should provide the video source. Can be:
* - Property `deviceId` of a [[Device]]
* - `"screen"` to screen-share. We provide a default screen-shraring extension for Chrome that can run in any domain, but you can customize it so it has your own icon, your own name, etc. Visit this
* [GitHub repository](https://github.com/OpenVidu/openvidu-screen-sharing-chrome-extension/) to learn how. Once you have uploaded your own extension to Chrome Web Store,
* simply call `OpenVidu.setAdvancedConfiguration({screenShareChromeExtension : "https://chrome.google.com/webstore/detail/YOUR_EXTENSION_NAME/YOUR_EXTENSION_ID"})` before calling `OpenVidu.initPublisher(targetElement, {videoSource: "screen"})`.
* For Firefox (<66) `"screen"` string will ask for permissions to share the entire screen. To ask for a specific window or application, use `"window"` string instead (this only applies to Firefox).
* - A MediaStreamTrack obtained from a MediaStream object with [[OpenVidu.getUserMedia]]
* - `false` or null to have an audio-only publisher
* @default _Default camera_
*/
videoSource?: string | MediaStreamTrack | boolean;
/**
* Use Simulcast video on WebRTC Publishers.
* Senders will encode duplicate video streams with different qualities,
* so the media server is able to select the most appropriate quality stream
* for each Subscriber.
* This setting is honored only if OpenVidu Server was configured to use the
* mediasoup media server. Otherwise, Simulcast will be disabled.
*/
videoSimulcast?: boolean;
/**
* **WARNING**: experimental option. This property may change in the near future
*
* Define a filter to apply in the Publisher's stream
*/
filter?: Filter;
}

View File

@ -1,41 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Connection } from '../../../OpenVidu/Connection';
/**
* See [[Session.signal]]
*/
export interface SignalOptions {
/**
* The actual message of the signal.
*/
data?: string;
/**
* The participants to whom to send the signal. They will only receive it if they are subscribed to
* event `Session.on('signal')`. If empty or undefined, the signal will be send to all participants.
*/
to?: Connection[];
/**
* The type of the signal. Participants subscribed to event `Session.on('signal:type')` will
* receive it. Participants subscribed to `Session.on('signal')` will receive all signals.
*/
type?: string;
}

View File

@ -1,61 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { VideoInsertMode } from '../../Enums/VideoInsertMode';
export interface StreamManagerVideo {
/**
* DOM video element displaying the StreamManager's stream
*/
video: HTMLVideoElement;
/**
* `id` attribute of the DOM video element displaying the StreamManager's stream
*/
id: string;
/**
* The DOM HTMLElement assigned as target element when creating a video for the StreamManager. This property is defined when:
* - [[OpenVidu.initPublisher]] or [[Session.subscribe]] methods have been called passing a valid `targetElement` parameter.
* - [[StreamManager.createVideoElement]] has been called.
*
* This property is undefined when:
* - [[OpenVidu.initPublisher]] or [[Session.subscribe]] methods have been called passing *null* or *undefined* as `targetElement` parameter.
* - [[StreamManager.addVideoElement]] has been called.
*/
targetElement?: HTMLElement;
/**
* How the DOM video element should be inserted with respect to `targetElement`. This property is defined when:
* - [[OpenVidu.initPublisher]] or [[Session.subscribe]] methods have been called passing a valid `targetElement` parameter.
* - [[StreamManager.createVideoElement]] has been called.
*
* This property is undefined when:
* - [[OpenVidu.initPublisher]] or [[Session.subscribe]] methods have been called passing *null* or *undefined* as `targetElement` parameter.
* - [[StreamManager.addVideoElement]] has been called.
*/
insertMode?: VideoInsertMode;
/**
* @hidden
*/
canplayListenerAdded: boolean;
}

View File

@ -1,43 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { VideoInsertMode } from '../../Enums/VideoInsertMode';
/**
* See [[Session.subscribe]]
*/
export interface SubscriberProperties {
/**
* How the video element of the subscriber should be inserted in the DOM
* @default VideoInsertMode.APPEND
*/
insertMode?: VideoInsertMode | string;
/**
* Whether to initially subscribe to the audio track of the stream or not. You can change the audio state later with [[Subscriber.subscribeToAudio]]
* @default true
*/
subscribeToAudio?: boolean;
/**
* Whether to initially subscribe to the video track of the stream or not. You can change the video state later with [[Subscriber.subscribeToVideo]]
* @default true
*/
subscribeToVideo?: boolean;
}

View File

@ -1,61 +0,0 @@
function Mapper() {
var sources = {};
this.forEach = function (callback) {
for (var key in sources) {
var source = sources[key];
for (var key2 in source)
callback(source[key2]);
};
};
this.get = function (id, source) {
var ids = sources[source];
if (ids == undefined)
return undefined;
return ids[id];
};
this.remove = function (id, source) {
var ids = sources[source];
if (ids == undefined)
return;
delete ids[id];
// Check it's empty
for (var i in ids) {
return false
}
delete sources[source];
};
this.set = function (value, id, source) {
if (value == undefined)
return this.remove(id, source);
var ids = sources[source];
if (ids == undefined)
sources[source] = ids = {};
ids[id] = value;
};
};
Mapper.prototype.pop = function (id, source) {
var value = this.get(id, source);
if (value == undefined)
return undefined;
this.remove(id, source);
return value;
};
module.exports = Mapper;

View File

@ -1,21 +0,0 @@
/*
* (C) Copyright 2014 Kurento (http://kurento.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
var JsonRpcClient = require('./jsonrpcclient');
exports.JsonRpcClient = JsonRpcClient;

View File

@ -1,275 +0,0 @@
/*
* (C) Copyright 2014 Kurento (http://kurento.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
var RpcBuilder = require('../');
var WebSocketWithReconnection = require('./transports/webSocketWithReconnection');
var OpenViduLogger = require('../../../Logger/OpenViduLogger').OpenViduLogger;
Date.now = Date.now || function () {
return +new Date;
};
var PING_INTERVAL = 5000;
var RECONNECTING = 'RECONNECTING';
var CONNECTED = 'CONNECTED';
var DISCONNECTED = 'DISCONNECTED';
var Logger = OpenViduLogger.getInstance();
/**
*
* heartbeat: interval in ms for each heartbeat message,
* <pre>
* ws : {
* uri : URI to conntect to,
* onconnected : callback method to invoke when connection is successful,
* ondisconnect : callback method to invoke when the connection is lost (max retries for reconnecting reached),
* onreconnecting : callback method to invoke when the client is reconnecting,
* onreconnected : callback method to invoke when the client successfully reconnects,
* onerror : callback method to invoke when there is an error
* },
* rpc : {
* requestTimeout : timeout for a request,
* sessionStatusChanged: callback method for changes in session status,
* mediaRenegotiation: mediaRenegotiation
* }
* </pre>
*/
function JsonRpcClient(configuration) {
var self = this;
var wsConfig = configuration.ws;
var notReconnectIfNumLessThan = -1;
var pingNextNum = 0;
var enabledPings = true;
var pingPongStarted = false;
var pingInterval;
var status = DISCONNECTED;
var onreconnecting = wsConfig.onreconnecting;
var onreconnected = wsConfig.onreconnected;
var onconnected = wsConfig.onconnected;
var onerror = wsConfig.onerror;
configuration.rpc.pull = function (params, request) {
request.reply(null, "push");
}
wsConfig.onreconnecting = function () {
Logger.debug("--------- ONRECONNECTING -----------");
if (status === RECONNECTING) {
Logger.error("Websocket already in RECONNECTING state when receiving a new ONRECONNECTING message. Ignoring it");
return;
}
stopPing();
status = RECONNECTING;
if (onreconnecting) {
onreconnecting();
}
}
wsConfig.onreconnected = function () {
Logger.debug("--------- ONRECONNECTED -----------");
if (status === CONNECTED) {
Logger.error("Websocket already in CONNECTED state when receiving a new ONRECONNECTED message. Ignoring it");
return;
}
status = CONNECTED;
updateNotReconnectIfLessThan();
if (onreconnected) {
onreconnected();
}
}
wsConfig.onconnected = function () {
Logger.debug("--------- ONCONNECTED -----------");
if (status === CONNECTED) {
Logger.error("Websocket already in CONNECTED state when receiving a new ONCONNECTED message. Ignoring it");
return;
}
status = CONNECTED;
enabledPings = true;
usePing();
if (onconnected) {
onconnected();
}
}
wsConfig.onerror = function (error) {
Logger.debug("--------- ONERROR -----------");
status = DISCONNECTED;
stopPing();
if (onerror) {
onerror(error);
}
}
var ws = new WebSocketWithReconnection(wsConfig);
Logger.debug('Connecting websocket to URI: ' + wsConfig.uri);
var rpcBuilderOptions = {
request_timeout: configuration.rpc.requestTimeout,
ping_request_timeout: configuration.rpc.heartbeatRequestTimeout
};
var rpc = new RpcBuilder(RpcBuilder.packers.JsonRPC, rpcBuilderOptions, ws,
function (request) {
Logger.debug('Received request: ' + JSON.stringify(request));
try {
var func = configuration.rpc[request.method];
if (func === undefined) {
Logger.error("Method " + request.method + " not registered in client");
} else {
func(request.params, request);
}
} catch (err) {
Logger.error('Exception processing request: ' + JSON.stringify(request));
Logger.error(err);
}
});
this.send = function (method, params, callback) {
var requestTime = Date.now();
rpc.encode(method, params, function (error, result) {
if (error) {
try {
Logger.error("ERROR:" + error.message + " in Request: method:" +
method + " params:" + JSON.stringify(params) + " request:" +
error.request);
if (error.data) {
Logger.error("ERROR DATA:" + JSON.stringify(error.data));
}
} catch (e) {}
error.requestTime = requestTime;
}
if (callback) {
if (result != undefined && result.value !== 'pong') {
Logger.debug('Response: ' + JSON.stringify(result));
}
callback(error, result);
}
});
}
function updateNotReconnectIfLessThan() {
Logger.debug("notReconnectIfNumLessThan = " + pingNextNum + ' (old=' +
notReconnectIfNumLessThan + ')');
notReconnectIfNumLessThan = pingNextNum;
}
function sendPing() {
if (enabledPings) {
var params = null;
if (pingNextNum == 0 || pingNextNum == notReconnectIfNumLessThan) {
params = {
interval: configuration.heartbeat || PING_INTERVAL
};
}
pingNextNum++;
self.send('ping', params, (function (pingNum) {
return function (error, result) {
if (error) {
Logger.debug("Error in ping request #" + pingNum + " (" +
error.message + ")");
if (pingNum > notReconnectIfNumLessThan) {
enabledPings = false;
updateNotReconnectIfLessThan();
Logger.debug("Server did not respond to ping message #" +
pingNum + ". Reconnecting... ");
ws.reconnectWs();
}
}
}
})(pingNextNum));
} else {
Logger.debug("Trying to send ping, but ping is not enabled");
}
}
/*
* If configuration.hearbeat has any value, the ping-pong will work with the interval
* of configuration.hearbeat
*/
function usePing() {
if (!pingPongStarted) {
Logger.debug("Starting ping (if configured)")
pingPongStarted = true;
if (configuration.heartbeat != undefined) {
pingInterval = setInterval(sendPing, configuration.heartbeat);
sendPing();
}
}
}
function stopPing() {
clearInterval(pingInterval);
pingPongStarted = false;
enabledPings = false;
pingNextNum = -1;
rpc.cancel();
}
this.close = function (code, reason) {
Logger.debug("Closing with code: " + code + " because: " + reason);
if (pingInterval != undefined) {
Logger.debug("Clearing ping interval");
clearInterval(pingInterval);
}
pingPongStarted = false;
enabledPings = false;
ws.close(code, reason);
}
this.reconnect = function () {
ws.reconnectWs();
}
this.resetPing = function () {
enabledPings = true;
pingNextNum = 0;
usePing();
}
this.getReadyState = function () {
return ws.getReadyState();
}
}
module.exports = JsonRpcClient;

View File

@ -1,20 +0,0 @@
/*
* (C) Copyright 2014 Kurento (http://kurento.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
var WebSocketWithReconnection = require('./webSocketWithReconnection');
exports.WebSocketWithReconnection = WebSocketWithReconnection;

View File

@ -1,170 +0,0 @@
/*
* (C) Copyright 2013-2015 Kurento (http://kurento.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
"use strict";
var OpenViduLogger = require('../../../../Logger/OpenViduLogger').OpenViduLogger;
var Logger = OpenViduLogger.getInstance();
var MAX_RETRIES = 2000; // Forever...
var RETRY_TIME_MS = 3000; // FIXME: Implement exponential wait times...
var CONNECTING = 0;
var OPEN = 1;
var CLOSING = 2;
var CLOSED = 3;
/*
config = {
uri : wsUri,
onconnected : callback method to invoke when connection is successful,
ondisconnect : callback method to invoke when the connection is lost (max retries for reconnecting reached),
onreconnecting : callback method to invoke when the client is reconnecting,
onreconnected : callback method to invoke when the client successfully reconnects,
};
*/
function WebSocketWithReconnection(config) {
var closing = false;
var registerMessageHandler;
var wsUri = config.uri;
var reconnecting = false;
var ws = new WebSocket(wsUri);
ws.onopen = () => {
Logger.debug("WebSocket connected to " + wsUri);
if (config.onconnected) {
config.onconnected();
}
};
ws.onerror = error => {
Logger.error(
"Could not connect to " + wsUri + " (invoking onerror if defined)",
error
);
if (config.onerror) {
config.onerror(error);
}
};
var reconnectionOnClose = () => {
if (ws.readyState === CLOSED) {
if (closing) {
Logger.debug("Connection closed by user");
} else {
if (config.ismasternodecrashed()) {
Logger.error("Master Node has crashed. Stopping reconnection process");
} else {
Logger.debug("Connection closed unexpectedly. Reconnecting...");
reconnect(MAX_RETRIES, 1);
}
}
} else {
Logger.debug("Close callback from previous websocket. Ignoring it");
}
};
ws.onclose = reconnectionOnClose;
function reconnect(maxRetries, numRetries) {
Logger.debug(
"reconnect (attempt #" + numRetries + ", max=" + maxRetries + ")"
);
if (numRetries === 1) {
if (reconnecting) {
Logger.warn(
"Trying to reconnect when already reconnecting... Ignoring this reconnection."
);
return;
} else {
reconnecting = true;
}
if (config.onreconnecting) {
config.onreconnecting();
}
}
reconnectAux(maxRetries, numRetries);
}
function addReconnectionQueryParamsIfMissing(uriString) {
var searchParams = new URLSearchParams((new URL(uriString)).search);
if (!searchParams.has("reconnect")) {
uriString = (Array.from(searchParams).length > 0) ? (uriString + '&reconnect=true') : (uriString + '?reconnect=true');
}
return uriString;
}
function reconnectAux(maxRetries, numRetries) {
Logger.debug("Reconnection attempt #" + numRetries);
ws.close(4104, 'Connection closed for reconnection');
wsUri = addReconnectionQueryParamsIfMissing(wsUri);
ws = new WebSocket(wsUri);
ws.onopen = () => {
Logger.debug(
"Reconnected to " + wsUri + " after " + numRetries + " attempts..."
);
reconnecting = false;
registerMessageHandler();
if (config.onreconnected()) {
config.onreconnected();
}
ws.onclose = reconnectionOnClose;
};
ws.onerror = error => {
Logger.warn("Reconnection error: ", error);
if (numRetries === maxRetries) {
if (config.ondisconnect) {
config.ondisconnect();
}
} else {
setTimeout(() => {
reconnect(maxRetries, numRetries + 1);
}, RETRY_TIME_MS);
}
};
}
this.close = (code, reason) => {
closing = true;
ws.close(code, reason);
};
this.reconnectWs = () => {
Logger.debug("reconnectWs");
reconnect(MAX_RETRIES, 1);
};
this.send = message => {
ws.send(message);
};
this.addEventListener = (type, callback) => {
registerMessageHandler = () => {
ws.addEventListener(type, callback);
};
registerMessageHandler();
};
this.getReadyState = () => {
return ws.readyState;
}
}
module.exports = WebSocketWithReconnection;

View File

@ -1,754 +0,0 @@
/*
* (C) Copyright 2014 Kurento (http://kurento.org/)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
var defineProperty_IE8 = false
if (Object.defineProperty) {
try {
Object.defineProperty({}, "x", {});
} catch (e) {
defineProperty_IE8 = true
}
}
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
fBound = function () {
return fToBind.apply(this instanceof fNOP && oThis ?
this :
oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
fNOP.prototype = this.prototype;
fBound.prototype = new fNOP();
return fBound;
};
}
var EventEmitter = require('events').EventEmitter;
var inherits = require('inherits');
var packers = require('./packers');
var Mapper = require('./Mapper');
var BASE_TIMEOUT = 5000;
function unifyResponseMethods(responseMethods) {
if (!responseMethods) return {};
for (var key in responseMethods) {
var value = responseMethods[key];
if (typeof value == 'string')
responseMethods[key] = {
response: value
}
};
return responseMethods;
};
function unifyTransport(transport) {
if (!transport) return;
// Transport as a function
if (transport instanceof Function)
return {
send: transport
};
// WebSocket & DataChannel
if (transport.send instanceof Function)
return transport;
// Message API (Inter-window & WebWorker)
if (transport.postMessage instanceof Function) {
transport.send = transport.postMessage;
return transport;
}
// Stream API
if (transport.write instanceof Function) {
transport.send = transport.write;
return transport;
}
// Transports that only can receive messages, but not send
if (transport.onmessage !== undefined) return;
if (transport.pause instanceof Function) return;
throw new SyntaxError("Transport is not a function nor a valid object");
};
/**
* Representation of a RPC notification
*
* @class
*
* @constructor
*
* @param {String} method -method of the notification
* @param params - parameters of the notification
*/
function RpcNotification(method, params) {
if (defineProperty_IE8) {
this.method = method
this.params = params
} else {
Object.defineProperty(this, 'method', {
value: method,
enumerable: true
});
Object.defineProperty(this, 'params', {
value: params,
enumerable: true
});
}
};
/**
* @class
*
* @constructor
*
* @param {object} packer
*
* @param {object} [options]
*
* @param {object} [transport]
*
* @param {Function} [onRequest]
*/
function RpcBuilder(packer, options, transport, onRequest) {
var self = this;
if (!packer)
throw new SyntaxError('Packer is not defined');
if (!packer.pack || !packer.unpack)
throw new SyntaxError('Packer is invalid');
var responseMethods = unifyResponseMethods(packer.responseMethods);
if (options instanceof Function) {
if (transport != undefined)
throw new SyntaxError("There can't be parameters after onRequest");
onRequest = options;
transport = undefined;
options = undefined;
};
if (options && options.send instanceof Function) {
if (transport && !(transport instanceof Function))
throw new SyntaxError("Only a function can be after transport");
onRequest = transport;
transport = options;
options = undefined;
};
if (transport instanceof Function) {
if (onRequest != undefined)
throw new SyntaxError("There can't be parameters after onRequest");
onRequest = transport;
transport = undefined;
};
if (transport && transport.send instanceof Function)
if (onRequest && !(onRequest instanceof Function))
throw new SyntaxError("Only a function can be after transport");
options = options || {};
EventEmitter.call(this);
if (onRequest)
this.on('request', onRequest);
if (defineProperty_IE8)
this.peerID = options.peerID
else
Object.defineProperty(this, 'peerID', {
value: options.peerID
});
var max_retries = options.max_retries || 0;
function transportMessage(event) {
self.decode(event.data || event);
};
this.getTransport = function () {
return transport;
}
this.setTransport = function (value) {
// Remove listener from old transport
if (transport) {
// W3C transports
if (transport.removeEventListener)
transport.removeEventListener('message', transportMessage);
// Node.js Streams API
else if (transport.removeListener)
transport.removeListener('data', transportMessage);
};
// Set listener on new transport
if (value) {
// W3C transports
if (value.addEventListener)
value.addEventListener('message', transportMessage);
// Node.js Streams API
else if (value.addListener)
value.addListener('data', transportMessage);
};
transport = unifyTransport(value);
}
if (!defineProperty_IE8)
Object.defineProperty(this, 'transport', {
get: this.getTransport.bind(this),
set: this.setTransport.bind(this)
})
this.setTransport(transport);
var request_timeout = options.request_timeout || BASE_TIMEOUT;
var ping_request_timeout = options.ping_request_timeout || request_timeout;
var response_timeout = options.response_timeout || BASE_TIMEOUT;
var duplicates_timeout = options.duplicates_timeout || BASE_TIMEOUT;
var requestID = 0;
var requests = new Mapper();
var responses = new Mapper();
var processedResponses = new Mapper();
var message2Key = {};
/**
* Store the response to prevent to process duplicate request later
*/
function storeResponse(message, id, dest) {
var response = {
message: message,
/** Timeout to auto-clean old responses */
timeout: setTimeout(function () {
responses.remove(id, dest);
},
response_timeout)
};
responses.set(response, id, dest);
};
/**
* Store the response to ignore duplicated messages later
*/
function storeProcessedResponse(ack, from) {
var timeout = setTimeout(function () {
processedResponses.remove(ack, from);
},
duplicates_timeout);
processedResponses.set(timeout, ack, from);
};
/**
* Representation of a RPC request
*
* @class
* @extends RpcNotification
*
* @constructor
*
* @param {String} method -method of the notification
* @param params - parameters of the notification
* @param {Integer} id - identifier of the request
* @param [from] - source of the notification
*/
function RpcRequest(method, params, id, from, transport) {
RpcNotification.call(this, method, params);
this.getTransport = function () {
return transport;
}
this.setTransport = function (value) {
transport = unifyTransport(value);
}
if (!defineProperty_IE8)
Object.defineProperty(this, 'transport', {
get: this.getTransport.bind(this),
set: this.setTransport.bind(this)
})
var response = responses.get(id, from);
/**
* @constant {Boolean} duplicated
*/
if (!(transport || self.getTransport())) {
if (defineProperty_IE8)
this.duplicated = Boolean(response)
else
Object.defineProperty(this, 'duplicated', {
value: Boolean(response)
});
}
var responseMethod = responseMethods[method];
this.pack = packer.pack.bind(packer, this, id)
/**
* Generate a response to this request
*
* @param {Error} [error]
* @param {*} [result]
*
* @returns {string}
*/
this.reply = function (error, result, transport) {
// Fix optional parameters
if (error instanceof Function || error && error.send instanceof Function) {
if (result != undefined)
throw new SyntaxError("There can't be parameters after callback");
transport = error;
result = null;
error = undefined;
} else if (result instanceof Function ||
result && result.send instanceof Function) {
if (transport != undefined)
throw new SyntaxError("There can't be parameters after callback");
transport = result;
result = null;
};
transport = unifyTransport(transport);
// Duplicated request, remove old response timeout
if (response)
clearTimeout(response.timeout);
if (from != undefined) {
if (error)
error.dest = from;
if (result)
result.dest = from;
};
var message;
// New request or overriden one, create new response with provided data
if (error || result != undefined) {
if (self.peerID != undefined) {
if (error)
error.from = self.peerID;
else
result.from = self.peerID;
}
// Protocol indicates that responses has own request methods
if (responseMethod) {
if (responseMethod.error == undefined && error)
message = {
error: error
};
else {
var method = error ?
responseMethod.error :
responseMethod.response;
message = {
method: method,
params: error || result
};
}
} else
message = {
error: error,
result: result
};
message = packer.pack(message, id);
}
// Duplicate & not-overriden request, re-send old response
else if (response)
message = response.message;
// New empty reply, response null value
else
message = packer.pack({
result: null
}, id);
// Store the response to prevent to process a duplicated request later
storeResponse(message, id, from);
// Return the stored response so it can be directly send back
transport = transport || this.getTransport() || self.getTransport();
if (transport)
return transport.send(message);
return message;
}
};
inherits(RpcRequest, RpcNotification);
function cancel(message) {
var key = message2Key[message];
if (!key) return;
delete message2Key[message];
var request = requests.pop(key.id, key.dest);
if (!request) return;
clearTimeout(request.timeout);
// Start duplicated responses timeout
storeProcessedResponse(key.id, key.dest);
};
/**
* Allow to cancel a request and don't wait for a response
*
* If `message` is not given, cancel all the request
*/
this.cancel = function (message) {
if (message) return cancel(message);
for (var message in message2Key)
cancel(message);
};
this.close = function () {
// Prevent to receive new messages
var transport = this.getTransport();
if (transport && transport.close)
transport.close(4003, "Cancel request");
// Request & processed responses
this.cancel();
processedResponses.forEach(clearTimeout);
// Responses
responses.forEach(function (response) {
clearTimeout(response.timeout);
});
};
/**
* Generates and encode a JsonRPC 2.0 message
*
* @param {String} method -method of the notification
* @param params - parameters of the notification
* @param [dest] - destination of the notification
* @param {object} [transport] - transport where to send the message
* @param [callback] - function called when a response to this request is
* received. If not defined, a notification will be send instead
*
* @returns {string} A raw JsonRPC 2.0 request or notification string
*/
this.encode = function (method, params, dest, transport, callback) {
// Fix optional parameters
if (params instanceof Function) {
if (dest != undefined)
throw new SyntaxError("There can't be parameters after callback");
callback = params;
transport = undefined;
dest = undefined;
params = undefined;
} else if (dest instanceof Function) {
if (transport != undefined)
throw new SyntaxError("There can't be parameters after callback");
callback = dest;
transport = undefined;
dest = undefined;
} else if (transport instanceof Function) {
if (callback != undefined)
throw new SyntaxError("There can't be parameters after callback");
callback = transport;
transport = undefined;
};
if (self.peerID != undefined) {
params = params || {};
params.from = self.peerID;
};
if (dest != undefined) {
params = params || {};
params.dest = dest;
};
// Encode message
var message = {
method: method,
params: params
};
if (callback) {
var id = requestID++;
var retried = 0;
message = packer.pack(message, id);
function dispatchCallback(error, result) {
self.cancel(message);
callback(error, result);
};
var request = {
message: message,
callback: dispatchCallback,
responseMethods: responseMethods[method] || {}
};
var encode_transport = unifyTransport(transport);
function sendRequest(transport) {
var rt = (method === 'ping' ? ping_request_timeout : request_timeout);
request.timeout = setTimeout(timeout, rt * Math.pow(2, retried++));
message2Key[message] = {
id: id,
dest: dest
};
requests.set(request, id, dest);
transport = transport || encode_transport || self.getTransport();
if (transport)
return transport.send(message);
return message;
};
function retry(transport) {
transport = unifyTransport(transport);
console.warn(retried + ' retry for request message:', message);
var timeout = processedResponses.pop(id, dest);
clearTimeout(timeout);
return sendRequest(transport);
};
function timeout() {
if (retried < max_retries)
return retry(transport);
var error = new Error('Request has timed out');
error.request = message;
error.retry = retry;
dispatchCallback(error)
};
return sendRequest(transport);
};
// Return the packed message
message = packer.pack(message);
transport = transport || this.getTransport();
if (transport)
return transport.send(message);
return message;
};
/**
* Decode and process a JsonRPC 2.0 message
*
* @param {string} message - string with the content of the message
*
* @returns {RpcNotification|RpcRequest|undefined} - the representation of the
* notification or the request. If a response was processed, it will return
* `undefined` to notify that it was processed
*
* @throws {TypeError} - Message is not defined
*/
this.decode = function (message, transport) {
if (!message)
throw new TypeError("Message is not defined");
try {
message = packer.unpack(message);
} catch (e) {
// Ignore invalid messages
return console.debug(e, message);
};
var id = message.id;
var ack = message.ack;
var method = message.method;
var params = message.params || {};
var from = params.from;
var dest = params.dest;
// Ignore messages send by us
if (self.peerID != undefined && from == self.peerID) return;
// Notification
if (id == undefined && ack == undefined) {
var notification = new RpcNotification(method, params);
if (self.emit('request', notification)) return;
return notification;
};
function processRequest() {
// If we have a transport and it's a duplicated request, reply inmediatly
transport = unifyTransport(transport) || self.getTransport();
if (transport) {
var response = responses.get(id, from);
if (response)
return transport.send(response.message);
};
var idAck = (id != undefined) ? id : ack;
var request = new RpcRequest(method, params, idAck, from, transport);
if (self.emit('request', request)) return;
return request;
};
function processResponse(request, error, result) {
request.callback(error, result);
};
function duplicatedResponse(timeout) {
console.warn("Response already processed", message);
// Update duplicated responses timeout
clearTimeout(timeout);
storeProcessedResponse(ack, from);
};
// Request, or response with own method
if (method) {
// Check if it's a response with own method
if (dest == undefined || dest == self.peerID) {
var request = requests.get(ack, from);
if (request) {
var responseMethods = request.responseMethods;
if (method == responseMethods.error)
return processResponse(request, params);
if (method == responseMethods.response)
return processResponse(request, null, params);
return processRequest();
}
var processed = processedResponses.get(ack, from);
if (processed)
return duplicatedResponse(processed);
}
// Request
return processRequest();
};
var error = message.error;
var result = message.result;
// Ignore responses not send to us
if (error && error.dest && error.dest != self.peerID) return;
if (result && result.dest && result.dest != self.peerID) return;
// Response
var request = requests.get(ack, from);
if (!request) {
var processed = processedResponses.get(ack, from);
if (processed)
return duplicatedResponse(processed);
return console.warn("No callback was defined for this message", message);
};
// Process response
processResponse(request, error, result);
};
};
inherits(RpcBuilder, EventEmitter);
RpcBuilder.RpcNotification = RpcNotification;
module.exports = RpcBuilder;
var clients = require('./clients');
var transports = require('./clients/transports');
RpcBuilder.clients = clients;
RpcBuilder.clients.transports = transports;
RpcBuilder.packers = packers;

View File

@ -1,95 +0,0 @@
/**
* JsonRPC 2.0 packer
*/
/**
* Pack a JsonRPC 2.0 message
*
* @param {Object} message - object to be packaged. It requires to have all the
* fields needed by the JsonRPC 2.0 message that it's going to be generated
*
* @return {String} - the stringified JsonRPC 2.0 message
*/
function pack(message, id) {
var result = {
jsonrpc: "2.0"
};
// Request
if (message.method) {
result.method = message.method;
if (message.params)
result.params = message.params;
// Request is a notification
if (id != undefined)
result.id = id;
}
// Response
else if (id != undefined) {
if (message.error) {
if (message.result !== undefined)
throw new TypeError("Both result and error are defined");
result.error = message.error;
} else if (message.result !== undefined)
result.result = message.result;
else
throw new TypeError("No result or error is defined");
result.id = id;
};
return JSON.stringify(result);
};
/**
* Unpack a JsonRPC 2.0 message
*
* @param {String} message - string with the content of the JsonRPC 2.0 message
*
* @throws {TypeError} - Invalid JsonRPC version
*
* @return {Object} - object filled with the JsonRPC 2.0 message content
*/
function unpack(message) {
var result = message;
if (typeof message === 'string' || message instanceof String) {
result = JSON.parse(message);
}
// Check if it's a valid message
var version = result.jsonrpc;
if (version !== '2.0')
throw new TypeError("Invalid JsonRPC version '" + version + "': " + message);
// Response
if (result.method == undefined) {
if (result.id == undefined)
throw new TypeError("Invalid message: " + message);
var result_defined = result.result !== undefined;
var error_defined = result.error !== undefined;
// Check only result or error is defined, not both or none
if (result_defined && error_defined)
throw new TypeError("Both result and error are defined: " + message);
if (!result_defined && !error_defined)
throw new TypeError("No result or error is defined: " + message);
result.ack = result.id;
delete result.id;
}
// Return unpacked message
return result;
};
exports.pack = pack;
exports.unpack = unpack;

View File

@ -1,10 +0,0 @@
function pack(message) {
throw new TypeError("Not yet implemented");
};
function unpack(message) {
throw new TypeError("Not yet implemented");
};
exports.pack = pack;
exports.unpack = unpack;

View File

@ -1,6 +0,0 @@
var JsonRPC = require('./JsonRPC');
var XmlRPC = require('./XmlRPC');
exports.JsonRPC = JsonRPC;
exports.XmlRPC = XmlRPC;

View File

@ -1,42 +0,0 @@
type ConsoleFunction = (...data: any) => void;
export class ConsoleLogger {
/**
* @hidden
*/
logger: Console
/**
* @hidden
*/
log: ConsoleFunction
/**
* @hidden
*/
info: ConsoleFunction
/**
* @hidden
*/
debug: ConsoleFunction
/**
* @hidden
*/
warn: ConsoleFunction
/**
* @hidden
*/
error: ConsoleFunction
constructor(console: Console) {
this.logger = console;
this.log = window.console.log,
this.info = window.console.info,
this.debug = window.console.debug,
this.warn = window.console.warn,
this.error = window.console.error
}
}

View File

@ -1,283 +0,0 @@
import { JL } from 'jsnlog'
import { OpenVidu } from "../../OpenVidu/OpenVidu";
import { ConsoleLogger } from './ConsoleLogger';
import { OpenViduLoggerConfiguration } from "./OpenViduLoggerConfiguration";
export class OpenViduLogger {
private static instance: OpenViduLogger;
private JSNLOG_URL: string = "/openvidu/elk/openvidu-browser-logs";
private MAX_JSNLOG_BATCH_LOG_MESSAGES: number = 100;
private MAX_MSECONDS_BATCH_MESSAGES: number = 5000;
private MAX_LENGTH_STRING_JSON: number = 1000;
private defaultConsoleLogger: ConsoleLogger = new ConsoleLogger(window.console);
private currentAppender: any;
private isProdMode = false;
private isJSNLogSetup = false;
// This two variables are used to restart JSNLog
// on different sessions and different userIds
private loggingSessionId: string | undefined;
/**
* @hidden
*/
static configureJSNLog(openVidu: OpenVidu, token: string) {
try {
// If dev mode or...
if ((window['LOG_JSNLOG_RESULTS']) ||
// If instance is created and it is OpenVidu Pro
(this.instance && openVidu.isAtLeastPro
// If logs are enabled
&& this.instance.isOpenViduBrowserLogsDebugActive(openVidu)
// Only reconfigure it if session or finalUserId has changed
&& this.instance.canConfigureJSNLog(openVidu, this.instance))) {
// Check if app logs can be sent
// and replace console.log function to send
// logs of the application
if (openVidu.sendBrowserLogs === OpenViduLoggerConfiguration.debug_app) {
this.instance.replaceWindowConsole();
}
// isJSNLogSetup will not be true until completed setup
this.instance.isJSNLogSetup = false;
this.instance.info("Configuring JSNLogs.");
const finalUserId = openVidu.finalUserId;
const sessionId = openVidu.session.sessionId;
const beforeSendCallback = (xhr) => {
// If 401 or 403 or 404 modify ready and status so JSNLog don't retry to send logs
// https://github.com/mperdeck/jsnlog.js/blob/v2.30.0/jsnlog.ts#L805-L818
const parentReadyStateFunction = xhr.onreadystatechange;
xhr.onreadystatechange = () => {
if (this.isInvalidResponse(xhr)) {
Object.defineProperty(xhr, "readyState", { value: 4 });
Object.defineProperty(xhr, "status", { value: 200 });
// Disable JSNLog too to not send periodically errors
this.instance.disableLogger();
}
parentReadyStateFunction();
}
// Headers to identify and authenticate logs
xhr.setRequestHeader('Authorization', "Basic " + btoa(`${finalUserId}%/%${sessionId}` + ":" + token));
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest')
// Additional headers for OpenVidu
xhr.setRequestHeader('OV-Final-User-Id', finalUserId);
xhr.setRequestHeader('OV-Session-Id', sessionId);
xhr.setRequestHeader('OV-Token', token);
}
// Creation of the appender.
this.instance.currentAppender = JL.createAjaxAppender(`appender-${finalUserId}-${sessionId}`);
this.instance.currentAppender.setOptions({
beforeSend: beforeSendCallback,
maxBatchSize: 1000,
batchSize: this.instance.MAX_JSNLOG_BATCH_LOG_MESSAGES,
batchTimeout: this.instance.MAX_MSECONDS_BATCH_MESSAGES
});
// Avoid circular dependencies
const logSerializer = (obj): string => {
const getCircularReplacer = () => {
const seen = new WeakSet();
return (key, value) => {
if (typeof value === "object" && value != null) {
if (seen.has(value) || (HTMLElement && value instanceof HTMLElement)) {
return;
}
seen.add(value);
}
return value;
};
};
// Cut long messages
let stringifyJson = JSON.stringify(obj, getCircularReplacer());
if (stringifyJson.length > this.instance.MAX_LENGTH_STRING_JSON) {
stringifyJson = `${stringifyJson.substring(0, this.instance.MAX_LENGTH_STRING_JSON)}...`;
}
if (window['LOG_JSNLOG_RESULTS']) {
console.log(stringifyJson);
}
return stringifyJson;
};
// Initialize JL to send logs
JL.setOptions({
defaultAjaxUrl: openVidu.httpUri + this.instance.JSNLOG_URL,
serialize: logSerializer,
enabled: true
});
JL().setOptions({
appenders: [this.instance.currentAppender]
});
this.instance.isJSNLogSetup = true;
this.instance.loggingSessionId = sessionId;
this.instance.info("JSNLog configured.");
}
} catch (e) {
// Print error
console.error("Error configuring JSNLog: ");
console.error(e);
// Restore defaults values just in case any exception happen-
this.instance.disableLogger();
}
}
/**
* @hidden
*/
static getInstance(): OpenViduLogger {
if (!OpenViduLogger.instance) {
OpenViduLogger.instance = new OpenViduLogger();
}
return OpenViduLogger.instance;
}
private static isInvalidResponse(xhr: XMLHttpRequest) {
return xhr.status == 401 || xhr.status == 403 || xhr.status == 404 || xhr.status == 0;
}
private canConfigureJSNLog(openVidu: OpenVidu, logger: OpenViduLogger): boolean {
return openVidu.session.sessionId != logger.loggingSessionId
}
private isOpenViduBrowserLogsDebugActive(openVidu: OpenVidu) {
return openVidu.sendBrowserLogs === OpenViduLoggerConfiguration.debug ||
openVidu.sendBrowserLogs === OpenViduLoggerConfiguration.debug_app;
}
// Return console functions with jsnlog integration
private getConsoleWithJSNLog() {
return function (openViduLogger: OpenViduLogger) {
return {
log: function (...args) {
openViduLogger.defaultConsoleLogger.log.apply(openViduLogger.defaultConsoleLogger.logger, arguments);
if (openViduLogger.isJSNLogSetup) {
JL().info(arguments);
}
},
info: function (...args) {
openViduLogger.defaultConsoleLogger.info.apply(openViduLogger.defaultConsoleLogger.logger, arguments);
if (openViduLogger.isJSNLogSetup) {
JL().info(arguments);
}
},
debug: function (...args) {
openViduLogger.defaultConsoleLogger.debug.apply(openViduLogger.defaultConsoleLogger.logger, arguments);
},
warn: function (...args) {
openViduLogger.defaultConsoleLogger.warn.apply(openViduLogger.defaultConsoleLogger.logger, arguments);
if (openViduLogger.isJSNLogSetup) {
JL().warn(arguments);
}
},
error: function (...args) {
openViduLogger.defaultConsoleLogger.error.apply(openViduLogger.defaultConsoleLogger.logger, arguments);
if (openViduLogger.isJSNLogSetup) {
JL().error(arguments);
}
}
};
}(this);
}
private replaceWindowConsole() {
window.console = this.defaultConsoleLogger.logger;
window.console.log = this.getConsoleWithJSNLog().log;
window.console.info = this.getConsoleWithJSNLog().info;
window.console.debug = this.getConsoleWithJSNLog().debug;
window.console.warn = this.getConsoleWithJSNLog().warn;
window.console.error = this.getConsoleWithJSNLog().error;
}
private disableLogger() {
JL.setOptions({ enabled: false });
this.isJSNLogSetup = false;
this.loggingSessionId = undefined;
this.currentAppender = undefined;
window.console = this.defaultConsoleLogger.logger;
window.console.log = this.defaultConsoleLogger.log;
window.console.info = this.defaultConsoleLogger.info;
window.console.debug = this.defaultConsoleLogger.debug;
window.console.warn = this.defaultConsoleLogger.warn;
window.console.error = this.defaultConsoleLogger.error;
}
/**
* @hidden
*/
log(...args: any[]) {
if (!this.isProdMode) {
this.defaultConsoleLogger.log.apply(this.defaultConsoleLogger.logger, arguments);
}
if (this.isJSNLogSetup) {
JL().info(arguments);
}
}
/**
* @hidden
*/
debug(...args: any[]) {
if (!this.isProdMode) {
this.defaultConsoleLogger.debug.apply(this.defaultConsoleLogger.logger, arguments);
}
}
/**
* @hidden
*/
info(...args: any[]) {
if (!this.isProdMode) {
this.defaultConsoleLogger.info.apply(this.defaultConsoleLogger.logger, arguments);
}
if (this.isJSNLogSetup) {
JL().info(arguments);
}
}
/**
* @hidden
*/
warn(...args: any[]) {
this.defaultConsoleLogger.warn.apply(this.defaultConsoleLogger.logger, arguments);
if (this.isJSNLogSetup) {
JL().warn(arguments);
}
}
/**
* @hidden
*/
error(...args: any[]) {
this.defaultConsoleLogger.error.apply(this.defaultConsoleLogger.logger, arguments);
if (this.isJSNLogSetup) {
JL().error(arguments);
}
}
/**
* @hidden
*/
flush() {
if (this.isJSNLogSetup && this.currentAppender != null) {
this.currentAppender.sendBatch();
}
}
enableProdMode() {
this.isProdMode = true;
}
}

View File

@ -1,5 +0,0 @@
export enum OpenViduLoggerConfiguration {
disabled = 'disabled',
debug = 'debug',
debug_app = 'debug_app'
}

View File

@ -1,220 +0,0 @@
// Last time updated on June 08, 2018
// Latest file can be found here: https://cdn.webrtc-experiment.com/getScreenId.js
// Muaz Khan - www.MuazKhan.com
// MIT License - www.WebRTC-Experiment.com/licence
// Documentation - https://github.com/muaz-khan/getScreenId.
// ______________
// getScreenId.js
/*
getScreenId(function (error, sourceId, screen_constraints) {
// error == null || 'permission-denied' || 'not-installed' || 'installed-disabled' || 'not-chrome'
// sourceId == null || 'string' || 'firefox'
if(microsoftEdge) {
navigator.getDisplayMedia(screen_constraints).then(onSuccess, onFailure);
}
else {
navigator.mediaDevices.getUserMedia(screen_constraints).then(onSuccess)catch(onFailure);
}
}, 'pass second parameter only if you want system audio');
*/
window.getScreenId = function (firefoxString, callback, custom_parameter) {
if (navigator.userAgent.indexOf('Edge') !== -1 && (!!navigator.msSaveOrOpenBlob || !!navigator.msSaveBlob)) {
// microsoft edge => navigator.getDisplayMedia(screen_constraints).then(onSuccess, onFailure);
callback({
video: true
});
return;
}
// for Firefox:
// sourceId == 'firefox'
// screen_constraints = {...}
if (!!navigator.mozGetUserMedia) {
callback(null, 'firefox', {
video: {
mozMediaSource: firefoxString,
mediaSource: firefoxString
}
});
return;
}
window.addEventListener('message', onIFrameCallback);
function onIFrameCallback(event) {
if (!event.data) return;
if (event.data.chromeMediaSourceId) {
if (event.data.chromeMediaSourceId === 'PermissionDeniedError') {
callback('permission-denied');
} else {
callback(null, event.data.chromeMediaSourceId, getScreenConstraints(null, event.data.chromeMediaSourceId, event.data.canRequestAudioTrack));
}
// this event listener is no more needed
window.removeEventListener('message', onIFrameCallback);
}
if (event.data.chromeExtensionStatus) {
callback(event.data.chromeExtensionStatus, null, getScreenConstraints(event.data.chromeExtensionStatus));
// this event listener is no more needed
window.removeEventListener('message', onIFrameCallback);
}
}
if (!custom_parameter) {
setTimeout(postGetSourceIdMessage, 100);
}
else {
setTimeout(function () {
postGetSourceIdMessage(custom_parameter);
}, 100);
}
};
function getScreenConstraints(error, sourceId, canRequestAudioTrack) {
var screen_constraints = {
audio: false,
video: {
mandatory: {
chromeMediaSource: error ? 'screen' : 'desktop',
maxWidth: window.screen.width > 1920 ? window.screen.width : 1920,
maxHeight: window.screen.height > 1080 ? window.screen.height : 1080
},
optional: []
}
};
if (!!canRequestAudioTrack) {
screen_constraints.audio = {
mandatory: {
chromeMediaSource: error ? 'screen' : 'desktop',
// echoCancellation: true
},
optional: []
};
}
if (sourceId) {
screen_constraints.video.mandatory.chromeMediaSourceId = sourceId;
if (screen_constraints.audio && screen_constraints.audio.mandatory) {
screen_constraints.audio.mandatory.chromeMediaSourceId = sourceId;
}
}
return screen_constraints;
}
function postGetSourceIdMessage(custom_parameter) {
if (!iframe) {
loadIFrame(function () {
postGetSourceIdMessage(custom_parameter);
});
return;
}
if (!iframe.isLoaded) {
setTimeout(function () {
postGetSourceIdMessage(custom_parameter);
}, 100);
return;
}
if (!custom_parameter) {
iframe.contentWindow.postMessage({
captureSourceId: true
}, '*');
}
else if (!!custom_parameter.forEach) {
iframe.contentWindow.postMessage({
captureCustomSourceId: custom_parameter
}, '*');
}
else {
iframe.contentWindow.postMessage({
captureSourceIdWithAudio: true
}, '*');
}
}
var iframe;
// this function is used in RTCMultiConnection v3
window.getScreenConstraints = function (callback) {
loadIFrame(function () {
getScreenId(function (error, sourceId, screen_constraints) {
if (!screen_constraints) {
screen_constraints = {
video: true
};
}
callback(error, screen_constraints.video);
});
});
};
function loadIFrame(loadCallback) {
if (iframe) {
loadCallback();
return;
}
iframe = document.createElement('iframe');
iframe.onload = function () {
iframe.isLoaded = true;
loadCallback();
};
iframe.src = 'https://openvidu.github.io/openvidu-screen-sharing-chrome-extension/';
iframe.style.display = 'none';
(document.body || document.documentElement).appendChild(iframe);
}
window.getChromeExtensionStatus = function (callback) {
// for Firefox:
if (!!navigator.mozGetUserMedia) {
callback('installed-enabled');
return;
}
window.addEventListener('message', onIFrameCallback);
function onIFrameCallback(event) {
if (!event.data) return;
if (event.data.chromeExtensionStatus) {
callback(event.data.chromeExtensionStatus);
// this event listener is no more needed
window.removeEventListener('message', onIFrameCallback);
}
}
setTimeout(postGetChromeExtensionStatusMessage, 100);
};
function postGetChromeExtensionStatusMessage() {
if (!iframe) {
loadIFrame(postGetChromeExtensionStatusMessage);
return;
}
if (!iframe.isLoaded) {
setTimeout(postGetChromeExtensionStatusMessage, 100);
return;
}
iframe.contentWindow.postMessage({
getChromeExtensionStatus: true
}, '*');
}
exports.getScreenId = window.getScreenId;

View File

@ -1,167 +0,0 @@
// global variables
var chromeMediaSource = 'screen';
var sourceId;
var screenCallback;
if(typeof window !== 'undefined' && typeof navigator !== 'undefined' && typeof navigator.userAgent !== 'undefined'){
var isFirefox = typeof window.InstallTrigger !== 'undefined';
var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
var isChrome = !!window.chrome && !isOpera;
window.addEventListener('message', function (event) {
if (event.origin != window.location.origin) {
return;
}
onMessageCallback(event.data);
});
}
// and the function that handles received messages
function onMessageCallback(data) {
// "cancel" button is clicked
if (data == 'PermissionDeniedError') {
if (screenCallback)
return screenCallback('PermissionDeniedError');
else
throw new Error('PermissionDeniedError');
}
// extension notified his presence
if (data == 'rtcmulticonnection-extension-loaded') {
chromeMediaSource = 'desktop';
}
// extension shared temp sourceId
if (data.sourceId && screenCallback) {
screenCallback(sourceId = data.sourceId, data.canRequestAudioTrack === true);
}
}
// this method can be used to check if chrome extension is installed & enabled.
function isChromeExtensionAvailable(callback) {
if (!callback) return;
if (chromeMediaSource == 'desktop') return callback(true);
// ask extension if it is available
window.postMessage('are-you-there', '*');
setTimeout(function () {
if (chromeMediaSource == 'screen') {
callback(false);
} else callback(true);
}, 2000);
}
// this function can be used to get "source-id" from the extension
function getSourceId(callback) {
if (!callback)
throw '"callback" parameter is mandatory.';
if (sourceId)
return callback(sourceId);
screenCallback = callback;
window.postMessage('get-sourceId', '*');
}
// this function can be used to get "source-id" from the extension
function getCustomSourceId(arr, callback) {
if (!arr || !arr.forEach) throw '"arr" parameter is mandatory and it must be an array.';
if (!callback) throw '"callback" parameter is mandatory.';
if (sourceId) return callback(sourceId);
screenCallback = callback;
window.postMessage({
'get-custom-sourceId': arr
}, '*');
}
// this function can be used to get "source-id" from the extension
function getSourceIdWithAudio(callback) {
if (!callback) throw '"callback" parameter is mandatory.';
if (sourceId) return callback(sourceId);
screenCallback = callback;
window.postMessage('audio-plus-tab', '*');
}
function getChromeExtensionStatus(extensionid, callback) {
if (isFirefox)
return callback('not-chrome');
if (arguments.length != 2) {
callback = extensionid;
extensionid = 'lfcgfepafnobdloecchnfaclibenjold'; // default extension-id
}
var image = document.createElement('img');
image.src = 'chrome-extension://' + extensionid + '/icon.png';
image.onload = function () {
chromeMediaSource = 'screen';
window.postMessage('are-you-there', '*');
setTimeout(function () {
if (chromeMediaSource == 'screen') {
callback('installed-disabled');
} else
callback('installed-enabled');
}, 2000);
};
image.onerror = function () {
callback('not-installed');
};
}
function getScreenConstraintsWithAudio(callback) {
getScreenConstraints(callback, true);
}
// this function explains how to use above methods/objects
function getScreenConstraints(callback, captureSourceIdWithAudio) {
sourceId = '';
var firefoxScreenConstraints = {
mozMediaSource: 'window',
mediaSource: 'window'
};
if (isFirefox)
return callback(null, firefoxScreenConstraints);
// this statement defines getUserMedia constraints
// that will be used to capture content of screen
var screen_constraints = {
mandatory: {
chromeMediaSource: chromeMediaSource,
maxWidth: screen.width > 1920 ? screen.width : 1920,
maxHeight: screen.height > 1080 ? screen.height : 1080
},
optional: []
};
// this statement verifies chrome extension availability
// if installed and available then it will invoke extension API
// otherwise it will fallback to command-line based screen capturing API
if (chromeMediaSource == 'desktop' && !sourceId) {
if (captureSourceIdWithAudio) {
getSourceIdWithAudio(function (sourceId, canRequestAudioTrack) {
screen_constraints.mandatory.chromeMediaSourceId = sourceId;
if (canRequestAudioTrack) {
screen_constraints.canRequestAudioTrack = true;
}
callback(sourceId == 'PermissionDeniedError' ? sourceId : null, screen_constraints);
});
}
else {
getSourceId(function (sourceId) {
screen_constraints.mandatory.chromeMediaSourceId = sourceId;
callback(sourceId == 'PermissionDeniedError' ? sourceId : null, screen_constraints);
});
}
return;
}
// this statement sets gets 'sourceId" and sets "chromeMediaSourceId"
if (chromeMediaSource == 'desktop') {
screen_constraints.mandatory.chromeMediaSourceId = sourceId;
}
// now invoking native getUserMedia API
callback(null, screen_constraints);
}
exports.getScreenConstraints = getScreenConstraints;
exports.getScreenConstraintsWithAudio = getScreenConstraintsWithAudio;
exports.isChromeExtensionAvailable = isChromeExtensionAvailable;
exports.getChromeExtensionStatus = getChromeExtensionStatus;
exports.getSourceId = getSourceId;

View File

@ -1,215 +0,0 @@
import platform = require('platform');
export class PlatformUtils {
protected static instance: PlatformUtils;
constructor() { }
static getInstance(): PlatformUtils {
if (!this.instance) {
this.instance = new PlatformUtils();
}
return PlatformUtils.instance;
}
public isChromeBrowser(): boolean {
return platform.name === "Chrome";
}
/**
* @hidden
*/
public isSafariBrowser(): boolean {
return platform.name === "Safari";
}
/**
* @hidden
*/
public isChromeMobileBrowser(): boolean {
return platform.name === "Chrome Mobile";
}
/**
* @hidden
*/
public isFirefoxBrowser(): boolean {
return platform.name === "Firefox";
}
/**
* @hidden
*/
public isFirefoxMobileBrowser(): boolean {
return platform.name === "Firefox Mobile" || platform.name === "Firefox for iOS";
}
/**
* @hidden
*/
public isOperaBrowser(): boolean {
return platform.name === "Opera";
}
/**
* @hidden
*/
public isOperaMobileBrowser(): boolean {
return platform.name === "Opera Mobile";
}
/**
* @hidden
*/
public isEdgeBrowser(): boolean {
const version = platform?.version ? parseFloat(platform.version) : -1;
return platform.name === "Microsoft Edge" && version >= 80;
}
/**
* @hidden
*/
public isEdgeMobileBrowser(): boolean {
const version = platform?.version ? parseFloat(platform.version) : -1;
return platform.name === "Microsoft Edge" && (platform.os?.family === 'Android' || platform.os?.family === 'iOS') && version > 45;
}
/**
* @hidden
*/
public isAndroidBrowser(): boolean {
return platform.name === "Android Browser";
}
/**
* @hidden
*/
public isElectron(): boolean {
return platform.name === "Electron";
}
/**
* @hidden
*/
public isSamsungBrowser(): boolean {
return (
platform.name === "Samsung Internet Mobile" ||
platform.name === "Samsung Internet"
);
}
/**
* @hidden
*/
public isIPhoneOrIPad(): boolean {
const userAgent = !!platform.ua ? platform.ua : navigator.userAgent;
const isTouchable = "ontouchend" in document;
const isIPad = /\b(\w*Macintosh\w*)\b/.test(userAgent) && isTouchable;
const isIPhone =
/\b(\w*iPhone\w*)\b/.test(userAgent) &&
/\b(\w*Mobile\w*)\b/.test(userAgent) &&
isTouchable;
return isIPad || isIPhone;
}
/**
* @hidden
*/
public isIOSWithSafari(): boolean {
const userAgent = !!platform.ua ? platform.ua : navigator.userAgent;
return this.isIPhoneOrIPad() && (
/\b(\w*Apple\w*)\b/.test(navigator.vendor) &&
/\b(\w*Safari\w*)\b/.test(userAgent) &&
!/\b(\w*CriOS\w*)\b/.test(userAgent) &&
!/\b(\w*FxiOS\w*)\b/.test(userAgent)
);
}
/**
* @hidden
*/
public isIonicIos(): boolean {
return this.isIPhoneOrIPad() && platform.ua!!.indexOf("Safari") === -1;
}
/**
* @hidden
*/
public isIonicAndroid(): boolean {
return (
platform.os!!.family === "Android" && platform.name == "Android Browser"
);
}
/**
* @hidden
*/
public isMobileDevice(): boolean {
return platform.os!!.family === "iOS" || platform.os!!.family === "Android";
}
/**
* @hidden
*/
public isReactNative(): boolean {
return false;
}
/**
* @hidden
*/
public isChromium(): boolean {
return this.isChromeBrowser() || this.isChromeMobileBrowser() ||
this.isOperaBrowser() || this.isOperaMobileBrowser() ||
this.isEdgeBrowser() || this.isEdgeMobileBrowser() ||
this.isSamsungBrowser() ||
this.isIonicAndroid() || this.isIonicIos() ||
this.isElectron();
}
/**
* @hidden
*/
public canScreenShare(): boolean {
const version = platform?.version ? parseFloat(platform.version) : -1;
// Reject mobile devices
if (this.isMobileDevice()) {
return false;
}
return (
this.isChromeBrowser() ||
this.isFirefoxBrowser() ||
this.isOperaBrowser() ||
this.isElectron() ||
this.isEdgeBrowser() ||
(this.isSafariBrowser() && version >= 13)
);
}
/**
* @hidden
*/
public getName(): string {
return platform.name || "";
}
/**
* @hidden
*/
public getVersion(): string {
return platform.version || "";
}
/**
* @hidden
*/
public getFamily(): string {
return platform.os!!.family || "";
}
/**
* @hidden
*/
public getDescription(): string {
return platform.description || "";
}
}

View File

@ -1,592 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import freeice = require('freeice');
import { v4 as uuidv4 } from 'uuid';
import { TypeOfVideo } from '../Enums/TypeOfVideo';
import { ExceptionEventName } from '../Events/ExceptionEvent';
import { OpenViduLogger } from '../Logger/OpenViduLogger';
import { PlatformUtils } from '../Utils/Platform';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* @hidden
*/
let platform: PlatformUtils;
export interface WebRtcPeerConfiguration {
mediaConstraints: {
audio: boolean;
video: boolean;
};
simulcast: boolean;
mediaServer: string;
onIceCandidate: (event: RTCIceCandidate) => void;
onIceConnectionStateException: (exceptionName: ExceptionEventName, message: string, data?: any) => void;
iceServers?: RTCIceServer[];
mediaStream?: MediaStream | null;
mode?: 'sendonly' | 'recvonly' | 'sendrecv';
id?: string;
typeOfVideo: TypeOfVideo | undefined;
}
export class WebRtcPeer {
pc: RTCPeerConnection;
remoteCandidatesQueue: RTCIceCandidate[] = [];
localCandidatesQueue: RTCIceCandidate[] = [];
// Same as WebRtcPeerConfiguration but without optional fields.
protected configuration: Required<WebRtcPeerConfiguration>;
private iceCandidateList: RTCIceCandidate[] = [];
private candidategatheringdone = false;
constructor(configuration: WebRtcPeerConfiguration) {
platform = PlatformUtils.getInstance();
this.configuration = {
...configuration,
iceServers:
!!configuration.iceServers &&
configuration.iceServers.length > 0
? configuration.iceServers
: freeice(),
mediaStream:
configuration.mediaStream !== undefined
? configuration.mediaStream
: null,
mode: !!configuration.mode ? configuration.mode : "sendrecv",
id: !!configuration.id ? configuration.id : this.generateUniqueId(),
};
// prettier-ignore
logger.debug(`[WebRtcPeer] configuration:\n${JSON.stringify(this.configuration, null, 2)}`);
this.pc = new RTCPeerConnection({ iceServers: this.configuration.iceServers });
this.pc.addEventListener("icecandidate", (event: RTCPeerConnectionIceEvent) => {
if (event.candidate !== null) {
// `RTCPeerConnectionIceEvent.candidate` is supposed to be an RTCIceCandidate:
// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceevent-candidate
//
// But in practice, it is actually an RTCIceCandidateInit that can be used to
// obtain a proper candidate, using the RTCIceCandidate constructor:
// https://w3c.github.io/webrtc-pc/#dom-rtcicecandidate-constructor
const candidateInit: RTCIceCandidateInit = event.candidate as RTCIceCandidateInit;
const iceCandidate = new RTCIceCandidate(candidateInit);
this.configuration.onIceCandidate(iceCandidate);
if (iceCandidate.candidate !== '') {
this.localCandidatesQueue.push(iceCandidate);
}
}
});
this.pc.addEventListener('signalingstatechange', () => {
if (this.pc.signalingState === 'stable') {
// SDP Offer/Answer finished. Add stored remote candidates.
while (this.iceCandidateList.length > 0) {
let candidate = this.iceCandidateList.shift();
this.pc.addIceCandidate(<RTCIceCandidate>candidate);
}
}
});
}
getId(): string {
return this.configuration.id;
}
/**
* This method frees the resources used by WebRtcPeer
*/
dispose() {
logger.debug('Disposing WebRtcPeer');
if (this.pc) {
if (this.pc.signalingState === 'closed') {
return;
}
this.pc.close();
this.remoteCandidatesQueue = [];
this.localCandidatesQueue = [];
}
}
// DEPRECATED LEGACY METHOD: Old WebRTC versions don't implement
// Transceivers, and instead depend on the deprecated
// "offerToReceiveAudio" and "offerToReceiveVideo".
private createOfferLegacy(): Promise<RTCSessionDescriptionInit> {
if (!!this.configuration.mediaStream) {
this.deprecatedPeerConnectionTrackApi();
}
const hasAudio = this.configuration.mediaConstraints.audio;
const hasVideo = this.configuration.mediaConstraints.video;
const options: RTCOfferOptions = {
offerToReceiveAudio: this.configuration.mode !== "sendonly" && hasAudio,
offerToReceiveVideo: this.configuration.mode !== "sendonly" && hasVideo,
};
logger.debug("[createOfferLegacy] RTCPeerConnection.createOffer() options:", JSON.stringify(options));
return this.pc.createOffer(options);
}
/**
* Creates an SDP offer from the local RTCPeerConnection to send to the other peer.
* Only if the negotiation was initiated by this peer.
*/
async createOffer(): Promise<RTCSessionDescriptionInit> {
// TODO: Delete this conditional when all supported browsers are
// modern enough to implement the Transceiver methods.
if (!("addTransceiver" in this.pc)) {
logger.warn(
"[createOffer] Method RTCPeerConnection.addTransceiver() is NOT available; using LEGACY offerToReceive{Audio,Video}"
);
return this.createOfferLegacy();
} else {
logger.debug("[createOffer] Method RTCPeerConnection.addTransceiver() is available; using it");
}
// Spec doc: https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtransceiver
if (this.configuration.mode !== "recvonly") {
// To send media, assume that all desired media tracks have been
// already added by higher level code to our MediaStream.
if (!this.configuration.mediaStream) {
throw new Error(
`[WebRtcPeer.createOffer] Direction is '${this.configuration.mode}', but no stream was configured to be sent`
);
}
for (const track of this.configuration.mediaStream.getTracks()) {
const tcInit: RTCRtpTransceiverInit = {
direction: this.configuration.mode,
streams: [this.configuration.mediaStream],
};
if (track.kind === "video" && this.configuration.simulcast) {
// Check if the requested size is enough to ask for 3 layers.
const trackSettings = track.getSettings();
const trackConsts = track.getConstraints();
const trackWidth: number =
trackSettings.width ??
(trackConsts.width as ConstrainULongRange).ideal ??
(trackConsts.width as number) ??
0;
const trackHeight: number =
trackSettings.height ??
(trackConsts.height as ConstrainULongRange).ideal ??
(trackConsts.height as number) ??
0;
logger.info(`[createOffer] Video track dimensions: ${trackWidth}x${trackHeight}`);
const trackPixels = trackWidth * trackHeight;
let maxLayers = 0;
if (trackPixels >= 960 * 540) {
maxLayers = 3;
} else if (trackPixels >= 480 * 270) {
maxLayers = 2;
} else {
maxLayers = 1;
}
tcInit.sendEncodings = [];
for (let l = 0; l < maxLayers; l++) {
const layerDiv = 2 ** (maxLayers - l - 1);
const encoding: RTCRtpEncodingParameters = {
rid: "rdiv" + layerDiv.toString(),
// @ts-ignore -- Property missing from DOM types.
scalabilityMode: "L1T1",
};
if (["detail", "text"].includes(track.contentHint)) {
// Prioritize best resolution, for maximum picture detail.
encoding.scaleResolutionDownBy = 1.0;
// @ts-ignore -- Property missing from DOM types.
encoding.maxFramerate = Math.floor(30 / layerDiv);
} else {
encoding.scaleResolutionDownBy = layerDiv;
}
tcInit.sendEncodings.push(encoding);
}
}
const tc = this.pc.addTransceiver(track, tcInit);
if (track.kind === "video") {
let sendParams = tc.sender.getParameters();
let needSetParams = false;
if (!sendParams.degradationPreference?.length) {
// degradationPreference for video: "balanced", "maintain-framerate", "maintain-resolution".
// https://www.w3.org/TR/2018/CR-webrtc-20180927/#dom-rtcdegradationpreference
if (["detail", "text"].includes(track.contentHint)) {
sendParams.degradationPreference = "maintain-resolution";
} else {
sendParams.degradationPreference = "balanced";
}
logger.info(
`[createOffer] Video sender Degradation Preference set: ${sendParams.degradationPreference}`
);
// FIXME: Firefox implements degradationPreference on each individual encoding!
// (set it on every element of the sendParams.encodings array)
needSetParams = true;
}
// FIXME: Check that the simulcast encodings were applied.
// Firefox doesn't implement `RTCRtpTransceiverInit.sendEncodings`
// so the only way to enable simulcast is with `RTCRtpSender.setParameters()`.
//
// This next block can be deleted when Firefox fixes bug #1396918:
// https://bugzilla.mozilla.org/show_bug.cgi?id=1396918
//
// NOTE: This is done in a way that is compatible with all browsers, to save on
// browser-conditional code. The idea comes from WebRTC Adapter.js:
// * https://github.com/webrtcHacks/adapter/issues/998
// * https://github.com/webrtcHacks/adapter/blob/v7.7.0/src/js/firefox/firefox_shim.js#L231-L255
if (this.configuration.simulcast) {
if (sendParams.encodings?.length !== tcInit.sendEncodings!.length) {
sendParams.encodings = tcInit.sendEncodings!;
needSetParams = true;
}
}
if (needSetParams) {
logger.debug(`[createOffer] Setting new RTCRtpSendParameters to video sender`);
try {
await tc.sender.setParameters(sendParams);
} catch (error) {
let message = `[WebRtcPeer.createOffer] Cannot set RTCRtpSendParameters to video sender`;
if (error instanceof Error) {
message += `: ${error.message}`;
}
throw new Error(message);
}
}
}
// DEBUG: Uncomment for details.
// if (track.kind === "video" && this.configuration.simulcast) {
// // Print browser capabilities.
// // prettier-ignore
// logger.debug(`[createOffer] Transceiver send capabilities (static):\n${JSON.stringify(RTCRtpSender.getCapabilities?.("video"), null, 2)}`);
// // prettier-ignore
// logger.debug(`[createOffer] Transceiver recv capabilities (static):\n${JSON.stringify(RTCRtpReceiver.getCapabilities?.("video"), null, 2)}`);
// // Print requested Transceiver encodings and parameters.
// // prettier-ignore
// logger.debug(`[createOffer] Transceiver send encodings (requested):\n${JSON.stringify(tcInit.sendEncodings, null, 2)}`);
// // prettier-ignore
// logger.debug(`[createOffer] Transceiver send parameters (accepted):\n${JSON.stringify(tc.sender.getParameters(), null, 2)}`);
// }
}
} else {
// To just receive media, create new recvonly transceivers.
for (const kind of ["audio", "video"]) {
// Check if the media kind should be used.
if (!this.configuration.mediaConstraints[kind]) {
continue;
}
this.configuration.mediaStream = new MediaStream();
this.pc.addTransceiver(kind, {
direction: this.configuration.mode,
streams: [this.configuration.mediaStream],
});
}
}
let sdpOffer: RTCSessionDescriptionInit;
try {
sdpOffer = await this.pc.createOffer();
} catch (error) {
let message = `[WebRtcPeer.createOffer] Browser failed creating an SDP Offer`;
if (error instanceof Error) {
message += `: ${error.message}`;
}
throw new Error(message);
}
return sdpOffer;
}
deprecatedPeerConnectionTrackApi() {
for (const track of this.configuration.mediaStream!.getTracks()) {
this.pc.addTrack(track, this.configuration.mediaStream!);
}
}
/**
* Creates an SDP answer from the local RTCPeerConnection to send to the other peer
* Only if the negotiation was initiated by the other peer
*/
createAnswer(): Promise<RTCSessionDescriptionInit> {
return new Promise((resolve, reject) => {
// TODO: Delete this conditional when all supported browsers are
// modern enough to implement the Transceiver methods.
if ("getTransceivers" in this.pc) {
logger.debug("[createAnswer] Method RTCPeerConnection.getTransceivers() is available; using it");
// Ensure that the PeerConnection already contains one Transceiver
// for each kind of media.
// The Transceivers should have been already created internally by
// the PC itself, when `pc.setRemoteDescription(sdpOffer)` was called.
for (const kind of ["audio", "video"]) {
// Check if the media kind should be used.
if (!this.configuration.mediaConstraints[kind]) {
continue;
}
let tc = this.pc
.getTransceivers()
.find((tc) => tc.receiver.track.kind === kind);
if (tc) {
// Enforce our desired direction.
tc.direction = this.configuration.mode;
} else {
return reject(new Error(`${kind} requested, but no transceiver was created from remote description`));
}
}
this.pc
.createAnswer()
.then((sdpAnswer) => resolve(sdpAnswer))
.catch((error) => reject(error));
} else {
// TODO: Delete else branch when all supported browsers are
// modern enough to implement the Transceiver methods
let offerAudio, offerVideo = true;
if (!!this.configuration.mediaConstraints) {
offerAudio = (typeof this.configuration.mediaConstraints.audio === 'boolean') ?
this.configuration.mediaConstraints.audio : true;
offerVideo = (typeof this.configuration.mediaConstraints.video === 'boolean') ?
this.configuration.mediaConstraints.video : true;
const constraints: RTCOfferOptions = {
offerToReceiveAudio: offerAudio,
offerToReceiveVideo: offerVideo
};
this.pc!.createAnswer(constraints)
.then(sdpAnswer => resolve(sdpAnswer))
.catch(error => reject(error));
}
}
// else, there is nothing to do; the legacy createAnswer() options do
// not offer any control over which tracks are included in the answer.
});
}
/**
* This peer initiated negotiation. Step 1/4 of SDP offer-answer protocol
*/
processLocalOffer(offer: RTCSessionDescriptionInit): Promise<void> {
return new Promise((resolve, reject) => {
this.pc.setLocalDescription(offer)
.then(() => {
const localDescription = this.pc.localDescription;
if (!!localDescription) {
logger.debug('Local description set', localDescription.sdp);
return resolve();
} else {
return reject('Local description is not defined');
}
})
.catch(error => reject(error));
});
}
/**
* Other peer initiated negotiation. Step 2/4 of SDP offer-answer protocol
*/
processRemoteOffer(sdpOffer: string): Promise<void> {
return new Promise((resolve, reject) => {
const offer: RTCSessionDescriptionInit = {
type: 'offer',
sdp: sdpOffer
};
logger.debug('SDP offer received, setting remote description', offer);
if (this.pc.signalingState === 'closed') {
return reject('RTCPeerConnection is closed when trying to set remote description');
}
this.setRemoteDescription(offer)
.then(() => resolve())
.catch(error => reject(error));
});
}
/**
* Other peer initiated negotiation. Step 3/4 of SDP offer-answer protocol
*/
processLocalAnswer(answer: RTCSessionDescriptionInit): Promise<void> {
return new Promise((resolve, reject) => {
logger.debug('SDP answer created, setting local description');
if (this.pc.signalingState === 'closed') {
return reject('RTCPeerConnection is closed when trying to set local description');
}
this.pc.setLocalDescription(answer)
.then(() => resolve())
.catch(error => reject(error));
});
}
/**
* This peer initiated negotiation. Step 4/4 of SDP offer-answer protocol
*/
processRemoteAnswer(sdpAnswer: string): Promise<void> {
return new Promise((resolve, reject) => {
const answer: RTCSessionDescriptionInit = {
type: 'answer',
sdp: sdpAnswer
};
logger.debug('SDP answer received, setting remote description');
if (this.pc.signalingState === 'closed') {
return reject('RTCPeerConnection is closed when trying to set remote description');
}
this.setRemoteDescription(answer)
.then(() => {
// DEBUG: Uncomment for details.
// {
// const tc = this.pc.getTransceivers().find((tc) => tc.sender.track?.kind === "video");
// // prettier-ignore
// logger.debug(`[processRemoteAnswer] Transceiver send parameters (effective):\n${JSON.stringify(tc?.sender.getParameters(), null, 2)}`);
// }
resolve();
})
.catch((error) => reject(error));
});
}
/**
* @hidden
*/
async setRemoteDescription(sdp: RTCSessionDescriptionInit): Promise<void> {
return this.pc.setRemoteDescription(sdp);
}
/**
* Callback function invoked when an ICE candidate is received
*/
addIceCandidate(iceCandidate: RTCIceCandidate): Promise<void> {
return new Promise((resolve, reject) => {
logger.debug('Remote ICE candidate received', iceCandidate);
this.remoteCandidatesQueue.push(iceCandidate);
switch (this.pc.signalingState) {
case 'closed':
reject(new Error('PeerConnection object is closed'));
break;
case 'stable':
if (!!this.pc.remoteDescription) {
this.pc.addIceCandidate(iceCandidate).then(() => resolve()).catch(error => reject(error));
} else {
this.iceCandidateList.push(iceCandidate);
resolve();
}
break;
default:
this.iceCandidateList.push(iceCandidate);
resolve();
}
});
}
addIceConnectionStateChangeListener(otherId: string) {
this.pc.addEventListener('iceconnectionstatechange', () => {
const iceConnectionState: RTCIceConnectionState = this.pc.iceConnectionState;
switch (iceConnectionState) {
case 'disconnected':
// Possible network disconnection
const msg1 = 'IceConnectionState of RTCPeerConnection ' + this.configuration.id + ' (' + otherId + ') change to "disconnected". Possible network disconnection';
logger.warn(msg1);
this.configuration.onIceConnectionStateException(ExceptionEventName.ICE_CONNECTION_DISCONNECTED, msg1);
break;
case 'failed':
const msg2 = 'IceConnectionState of RTCPeerConnection ' + this.configuration.id + ' (' + otherId + ') to "failed"';
logger.error(msg2);
this.configuration.onIceConnectionStateException(ExceptionEventName.ICE_CONNECTION_FAILED, msg2);
break;
case 'closed':
logger.log('IceConnectionState of RTCPeerConnection ' + this.configuration.id + ' (' + otherId + ') change to "closed"');
break;
case 'new':
logger.log('IceConnectionState of RTCPeerConnection ' + this.configuration.id + ' (' + otherId + ') change to "new"');
break;
case 'checking':
logger.log('IceConnectionState of RTCPeerConnection ' + this.configuration.id + ' (' + otherId + ') change to "checking"');
break;
case 'connected':
logger.log('IceConnectionState of RTCPeerConnection ' + this.configuration.id + ' (' + otherId + ') change to "connected"');
break;
case 'completed':
logger.log('IceConnectionState of RTCPeerConnection ' + this.configuration.id + ' (' + otherId + ') change to "completed"');
break;
}
});
}
/**
* @hidden
*/
generateUniqueId(): string {
return uuidv4();
}
}
export class WebRtcPeerRecvonly extends WebRtcPeer {
constructor(configuration: WebRtcPeerConfiguration) {
configuration.mode = 'recvonly';
super(configuration);
}
}
export class WebRtcPeerSendonly extends WebRtcPeer {
constructor(configuration: WebRtcPeerConfiguration) {
configuration.mode = 'sendonly';
super(configuration);
}
}
export class WebRtcPeerSendrecv extends WebRtcPeer {
constructor(configuration: WebRtcPeerConfiguration) {
configuration.mode = 'sendrecv';
super(configuration);
}
}

View File

@ -1,459 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
// tslint:disable:no-string-literal
import { Stream } from '../../OpenVidu/Stream';
import { OpenViduLogger } from '../Logger/OpenViduLogger';
import { PlatformUtils } from '../Utils/Platform';
/**
* @hidden
*/
const logger: OpenViduLogger = OpenViduLogger.getInstance();
/**
* @hidden
*/
let platform: PlatformUtils;
interface WebrtcStatsConfig {
interval: number,
httpEndpoint: string
}
interface JSONStatsResponse {
'@timestamp': string,
participant_id: string,
session_id: string,
platform: string,
platform_description: string,
stream: string,
webrtc_stats: IWebrtcStats
}
/**
* Common WebRtcSTats for latest Chromium and Firefox versions
*/
interface IWebrtcStats {
inbound?: {
audio: {
bytesReceived: number,
packetsReceived: number,
packetsLost: number,
jitter: number
} | {},
video: {
bytesReceived: number,
packetsReceived: number,
packetsLost: number,
jitter?: number, // Firefox
jitterBufferDelay?: number, // Chrome
framesDecoded: number,
firCount: number,
nackCount: number,
pliCount: number,
frameHeight?: number, // Chrome
frameWidth?: number, // Chrome
framesDropped?: number, // Chrome
framesReceived?: number // Chrome
} | {}
},
outbound?: {
audio: {
bytesSent: number,
packetsSent: number,
} | {},
video: {
bytesSent: number,
packetsSent: number,
firCount: number,
framesEncoded: number,
nackCount: number,
pliCount: number,
qpSum: number,
frameHeight?: number, // Chrome
frameWidth?: number, // Chrome
framesSent?: number // Chrome
} | {}
},
candidatepair?: {
currentRoundTripTime?: number // Chrome
availableOutgoingBitrate?: number //Chrome
// availableIncomingBitrate?: number // No support for any browsers (https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidatePairStats/availableIncomingBitrate)
}
};
export class WebRtcStats {
private readonly STATS_ITEM_NAME = 'webrtc-stats-config';
private webRtcStatsEnabled = false;
private webRtcStatsIntervalId: NodeJS.Timer;
private statsInterval = 1;
private POST_URL: string;
constructor(private stream: Stream) {
platform = PlatformUtils.getInstance();
}
public isEnabled(): boolean {
return this.webRtcStatsEnabled;
}
public initWebRtcStats(): void {
const webrtcObj = localStorage.getItem(this.STATS_ITEM_NAME);
if (!!webrtcObj) {
this.webRtcStatsEnabled = true;
const webrtcStatsConfig: WebrtcStatsConfig = JSON.parse(webrtcObj);
// webrtc object found in local storage
logger.warn('WebRtc stats enabled for stream ' + this.stream.streamId + ' of connection ' + this.stream.connection.connectionId);
logger.warn('localStorage item: ' + JSON.stringify(webrtcStatsConfig));
this.POST_URL = webrtcStatsConfig.httpEndpoint;
this.statsInterval = webrtcStatsConfig.interval; // Interval in seconds
this.webRtcStatsIntervalId = setInterval(async () => {
await this.sendStatsToHttpEndpoint();
}, this.statsInterval * 1000);
} else {
logger.debug('WebRtc stats not enabled');
}
}
// {
// "localCandidate": {
// "id": "RTCIceCandidate_/r4P1y2Q",
// "timestamp": 1616080155617,
// "type": "local-candidate",
// "transportId": "RTCTransport_0_1",
// "isRemote": false,
// "networkType": "wifi",
// "ip": "123.45.67.89",
// "port": 63340,
// "protocol": "udp",
// "candidateType": "srflx",
// "priority": 1686052607,
// "deleted": false,
// "raw": [
// "candidate:3345412921 1 udp 1686052607 123.45.67.89 63340 typ srflx raddr 192.168.1.31 rport 63340 generation 0 ufrag 0ZtT network-id 1 network-cost 10",
// "candidate:58094482 1 udp 41885695 98.76.54.32 44431 typ relay raddr 123.45.67.89 rport 63340 generation 0 ufrag 0ZtT network-id 1 network-cost 10"
// ]
// },
// "remoteCandidate": {
// "id": "RTCIceCandidate_1YO18gph",
// "timestamp": 1616080155617,
// "type": "remote-candidate",
// "transportId": "RTCTransport_0_1",
// "isRemote": true,
// "ip": "12.34.56.78",
// "port": 64989,
// "protocol": "udp",
// "candidateType": "srflx",
// "priority": 1679819263,
// "deleted": false,
// "raw": [
// "candidate:16 1 UDP 1679819263 12.34.56.78 64989 typ srflx raddr 172.19.0.1 rport 64989",
// "candidate:16 1 UDP 1679819263 12.34.56.78 64989 typ srflx raddr 172.19.0.1 rport 64989"
// ]
// }
// }
// Have been tested in:
// - Linux Desktop:
// - Chrome 89.0.4389.90
// - Opera 74.0.3911.218
// - Firefox 86
// - Microsoft Edge 91.0.825.0
// - Electron 11.3.0 (Chromium 87.0.4280.141)
// - Windows Desktop:
// - Chrome 89.0.4389.90
// - Opera 74.0.3911.232
// - Firefox 86.0.1
// - Microsoft Edge 89.0.774.54
// - Electron 11.3.0 (Chromium 87.0.4280.141)
// - MacOS Desktop:
// - Chrome 89.0.4389.90
// - Firefox 87.0
// - Opera 75.0.3969.93
// - Microsoft Edge 89.0.774.57
// - Safari 14.0 (14610.1.28.1.9)
// - Electron 11.3.0 (Chromium 87.0.4280.141)
// - Android:
// - Chrome Mobile 89.0.4389.90
// - Opera 62.3.3146.57763
// - Firefox Mobile 86.6.1
// - Microsoft Edge Mobile 46.02.4.5147
// - Ionic 5
// - React Native 0.64
// - iOS:
// - Safari Mobile
// - ¿Ionic?
// - ¿React Native?
public getSelectedIceCandidateInfo(): Promise<any> {
return new Promise(async (resolve, reject) => {
const statsReport: any = await this.stream.getRTCPeerConnection().getStats();
let transportStat;
const candidatePairs: Map<string, any> = new Map();
const localCandidates: Map<string, any> = new Map();
const remoteCandidates: Map<string, any> = new Map();
statsReport.forEach((stat: any) => {
if (stat.type === 'transport' && (platform.isChromium() || platform.isSafariBrowser() || platform.isReactNative())) {
transportStat = stat;
}
switch (stat.type) {
case 'candidate-pair':
candidatePairs.set(stat.id, stat);
break;
case 'local-candidate':
localCandidates.set(stat.id, stat);
break;
case 'remote-candidate':
remoteCandidates.set(stat.id, stat);
break;
}
});
let selectedCandidatePair;
if (transportStat != null) {
const selectedCandidatePairId = transportStat.selectedCandidatePairId
selectedCandidatePair = candidatePairs.get(selectedCandidatePairId);
} else {
// This is basically Firefox
const length = candidatePairs.size;
const iterator = candidatePairs.values();
for (let i = 0; i < length; i++) {
const candidatePair = iterator.next().value;
if (candidatePair['selected']) {
selectedCandidatePair = candidatePair;
break;
}
}
}
const localCandidateId = selectedCandidatePair.localCandidateId;
const remoteCandidateId = selectedCandidatePair.remoteCandidateId;
let finalLocalCandidate = localCandidates.get(localCandidateId);
if (!!finalLocalCandidate) {
const candList = this.stream.getLocalIceCandidateList();
const cand = candList.filter((c: RTCIceCandidate) => {
return (!!c.candidate &&
(c.candidate.indexOf(finalLocalCandidate.ip) >= 0 || c.candidate.indexOf(finalLocalCandidate.address) >= 0) &&
c.candidate.indexOf(finalLocalCandidate.port) >= 0);
});
finalLocalCandidate.raw = [];
for (let c of cand) {
finalLocalCandidate.raw.push(c.candidate);
}
} else {
finalLocalCandidate = 'ERROR: No active local ICE candidate. Probably ICE-TCP is being used';
}
let finalRemoteCandidate = remoteCandidates.get(remoteCandidateId);
if (!!finalRemoteCandidate) {
const candList = this.stream.getRemoteIceCandidateList();
const cand = candList.filter((c: RTCIceCandidate) => {
return (!!c.candidate &&
(c.candidate.indexOf(finalRemoteCandidate.ip) >= 0 || c.candidate.indexOf(finalRemoteCandidate.address) >= 0) &&
c.candidate.indexOf(finalRemoteCandidate.port) >= 0);
});
finalRemoteCandidate.raw = [];
for (let c of cand) {
finalRemoteCandidate.raw.push(c.candidate);
}
} else {
finalRemoteCandidate = 'ERROR: No active remote ICE candidate. Probably ICE-TCP is being used';
}
return resolve({
localCandidate: finalLocalCandidate,
remoteCandidate: finalRemoteCandidate
});
});
}
public stopWebRtcStats() {
if (this.webRtcStatsEnabled) {
clearInterval(this.webRtcStatsIntervalId);
logger.warn('WebRtc stats stopped for disposed stream ' + this.stream.streamId + ' of connection ' + this.stream.connection.connectionId);
}
}
private async sendStats(url: string, response: JSONStatsResponse): Promise<void> {
try {
const configuration: RequestInit = {
headers: {
'Content-type': 'application/json'
},
body: JSON.stringify(response),
method: 'POST',
};
await fetch(url, configuration);
} catch (error) {
logger.error(`sendStats error: ${JSON.stringify(error)}`);
}
}
private async sendStatsToHttpEndpoint(): Promise<void> {
try {
const webrtcStats: IWebrtcStats = await this.getCommonStats();
const response = this.generateJSONStatsResponse(webrtcStats);
await this.sendStats(this.POST_URL, response);
} catch (error) {
logger.log(error);
}
}
// Have been tested in:
// - Linux Desktop:
// - Chrome 89.0.4389.90
// - Opera 74.0.3911.218
// - Firefox 86
// - Microsoft Edge 91.0.825.0
// - Electron 11.3.0 (Chromium 87.0.4280.141)
// - Windows Desktop:
// - Chrome 89.0.4389.90
// - Opera 74.0.3911.232
// - Firefox 86.0.1
// - Microsoft Edge 89.0.774.54
// - Electron 11.3.0 (Chromium 87.0.4280.141)
// - MacOS Desktop:
// - Chrome 89.0.4389.90
// - Opera 75.0.3969.93
// - Firefox 87.0
// - Microsoft Edge 89.0.774.57
// - Safari 14.0 (14610.1.28.1.9)
// - Electron 11.3.0 (Chromium 87.0.4280.141)
// - Android:
// - Chrome Mobile 89.0.4389.90
// - Opera 62.3.3146.57763
// - Firefox Mobile 86.6.1
// - Microsoft Edge Mobile 46.02.4.5147
// - Ionic 5
// - React Native 0.64
// - iOS:
// - Safari Mobile
// - ¿Ionic?
// - ¿React Native?
public async getCommonStats(): Promise<IWebrtcStats> {
return new Promise(async (resolve, reject) => {
try {
const statsReport: any = await this.stream.getRTCPeerConnection().getStats();
const response: IWebrtcStats = this.getWebRtcStatsResponseOutline();
const videoTrackStats = ['framesReceived', 'framesDropped', 'framesSent', 'frameHeight', 'frameWidth'];
const candidatePairStats = ['availableOutgoingBitrate', 'currentRoundTripTime'];
statsReport.forEach((stat: any) => {
let mediaType = stat.mediaType != null ? stat.mediaType : stat.kind;
const addStat = (direction: string, key: string): void => {
if (stat[key] != null && response[direction] != null) {
if (!mediaType && (videoTrackStats.indexOf(key) > -1)) {
mediaType = 'video';
}
if (direction != null && mediaType != null && key != null && response[direction][mediaType] != null) {
response[direction][mediaType][key] = Number(stat[key]);
} else if(direction != null && key != null && candidatePairStats.includes(key)) {
// candidate-pair-stats
response[direction][key] = Number(stat[key]);
}
}
}
switch (stat.type) {
case "outbound-rtp":
addStat('outbound', 'bytesSent');
addStat('outbound', 'packetsSent');
addStat('outbound', 'framesEncoded');
addStat('outbound', 'nackCount');
addStat('outbound', 'firCount');
addStat('outbound', 'pliCount');
addStat('outbound', 'qpSum');
break;
case "inbound-rtp":
addStat('inbound', 'bytesReceived');
addStat('inbound', 'packetsReceived');
addStat('inbound', 'packetsLost');
addStat('inbound', 'jitter');
addStat('inbound', 'framesDecoded');
addStat('inbound', 'nackCount');
addStat('inbound', 'firCount');
addStat('inbound', 'pliCount');
break;
case 'track':
addStat('inbound', 'jitterBufferDelay');
addStat('inbound', 'framesReceived');
addStat('outbound', 'framesDropped');
addStat('outbound', 'framesSent');
addStat(this.stream.isLocal() ? 'outbound' : 'inbound', 'frameHeight');
addStat(this.stream.isLocal() ? 'outbound' : 'inbound', 'frameWidth');
break;
case 'candidate-pair':
addStat('candidatepair', 'currentRoundTripTime');
addStat('candidatepair', 'availableOutgoingBitrate');
break;
}
});
// Delete candidatepair from response if null
if(!response?.candidatepair || Object.keys(<Object>response.candidatepair).length === 0){
delete response.candidatepair;
}
return resolve(response);
} catch (error) {
logger.error('Error getting common stats: ', error);
return reject(error);
}
});
}
private generateJSONStatsResponse(stats: IWebrtcStats): JSONStatsResponse {
return {
'@timestamp': new Date().toISOString(),
participant_id: this.stream.connection.data,
session_id: this.stream.session.sessionId,
platform: platform.getName(),
platform_description: platform.getDescription(),
stream: 'webRTC',
webrtc_stats: stats
};
}
private getWebRtcStatsResponseOutline(): IWebrtcStats {
if (this.stream.isLocal()) {
return {
outbound: {
audio: {},
video: {}
},
candidatepair: {}
};
} else {
return {
inbound: {
audio: {},
video: {}
}
};
}
}
}

View File

@ -1,48 +0,0 @@
import { JL } from 'jsnlog';
export { OpenVidu } from './OpenVidu/OpenVidu';
export { Session } from './OpenVidu/Session';
export { Publisher } from './OpenVidu/Publisher';
export { Subscriber } from './OpenVidu/Subscriber';
export { StreamManager } from './OpenVidu/StreamManager';
export { Stream } from './OpenVidu/Stream';
export { Connection } from './OpenVidu/Connection';
export { LocalRecorder } from './OpenVidu/LocalRecorder';
export { Filter } from './OpenVidu/Filter';
export { LocalRecorderState } from './OpenViduInternal/Enums/LocalRecorderState';
export { OpenViduError, OpenViduErrorName } from './OpenViduInternal/Enums/OpenViduError';
export { TypeOfVideo } from './OpenViduInternal/Enums/TypeOfVideo';
export { VideoInsertMode } from './OpenViduInternal/Enums/VideoInsertMode';
export { Event } from './OpenViduInternal/Events/Event';
export { ConnectionEvent } from './OpenViduInternal/Events/ConnectionEvent';
export { PublisherSpeakingEvent } from './OpenViduInternal/Events/PublisherSpeakingEvent';
export { RecordingEvent } from './OpenViduInternal/Events/RecordingEvent';
export { SessionDisconnectedEvent } from './OpenViduInternal/Events/SessionDisconnectedEvent';
export { SignalEvent } from './OpenViduInternal/Events/SignalEvent';
export { StreamEvent } from './OpenViduInternal/Events/StreamEvent';
export { StreamManagerEvent } from './OpenViduInternal/Events/StreamManagerEvent';
export { VideoElementEvent } from './OpenViduInternal/Events/VideoElementEvent';
export { StreamPropertyChangedEvent } from './OpenViduInternal/Events/StreamPropertyChangedEvent';
export { ConnectionPropertyChangedEvent } from './OpenViduInternal/Events/ConnectionPropertyChangedEvent';
export { FilterEvent } from './OpenViduInternal/Events/FilterEvent';
export { NetworkQualityLevelChangedEvent } from './OpenViduInternal/Events/NetworkQualityLevelChangedEvent';
export { ExceptionEvent, ExceptionEventName } from './OpenViduInternal/Events/ExceptionEvent';
export { Capabilities } from './OpenViduInternal/Interfaces/Public/Capabilities';
export { Device } from './OpenViduInternal/Interfaces/Public/Device';
export { EventDispatcher } from './OpenVidu/EventDispatcher';
export { OpenViduAdvancedConfiguration } from './OpenViduInternal/Interfaces/Public/OpenViduAdvancedConfiguration';
export { PublisherProperties } from './OpenViduInternal/Interfaces/Public/PublisherProperties';
export { SignalOptions } from './OpenViduInternal/Interfaces/Public/SignalOptions';
export { StreamManagerVideo } from './OpenViduInternal/Interfaces/Public/StreamManagerVideo';
export { SubscriberProperties } from './OpenViduInternal/Interfaces/Public/SubscriberProperties';
export { EventMap } from './OpenViduInternal/Events/EventMap/EventMap';
export { SessionEventMap } from './OpenViduInternal/Events/EventMap/SessionEventMap';
export { StreamManagerEventMap } from './OpenViduInternal/Events/EventMap/StreamManagerEventMap';
export { PublisherEventMap } from './OpenViduInternal/Events/EventMap/PublisherEventMap';
// Disable jsnlog when library is loaded
JL.setOptions({ enabled: false })

View File

@ -1,36 +0,0 @@
{
//"allowUnusedLabels": true,
"allowUnreachableCode": false,
"buildOnSave": false,
"compileOnSave": true,
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"emitBOM": false,
"forceConsistentCasingInFileNames": true,
"lib": [
"dom",
"es2015.promise",
"es5",
"scripthost"
],
"module": "commonjs",
"noFallthroughCasesInSwitch": true,
//"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
//"noUnusedLocals": true,
//"noUnusedParameters": true,
"outDir": "../../lib",
"preserveConstEnums": true,
"removeComments": true,
"rootDir": "./src",
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"suppressExcessPropertyErrors": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5"
}
}

View File

@ -1 +0,0 @@
/target/

View File

@ -1,13 +0,0 @@
[![License badge](https://img.shields.io/badge/license-Apache2-orange.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Documentation Status](https://readthedocs.org/projects/openvidu/badge/?version=stable)](https://docs.openvidu.io/en/stable/?badge=stable)
[![Docker badge](https://img.shields.io/docker/pulls/fiware/orion.svg)](https://hub.docker.com/r/openvidu/)
[![Support badge](https://img.shields.io/badge/support-sof-yellowgreen.svg)](https://openvidu.discourse.group/)
[![][OpenViduLogo]](https://openvidu.io)
openvidu-client
===
Internal Java client used by [openvidu-server](https://github.com/OpenVidu/openvidu/tree/master/openvidu-server). Can be used to implement an Android client.
[OpenViduLogo]: https://secure.gravatar.com/avatar/5daba1d43042f2e4e85849733c8e5702?s=120

View File

@ -1,106 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.openvidu</groupId>
<artifactId>openvidu-parent</artifactId>
<version>2.0.0</version>
</parent>
<artifactId>openvidu-client</artifactId>
<version>1.1.0</version>
<packaging>jar</packaging>
<name>OpenVidu Client</name>
<description>
OpenVidu client library for the client-side of OpenVidu Server
</description>
<url>https://github.com/OpenVidu/openvidu</url>
<licenses>
<license>
<name>Apache 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<organization>
<name>OpenVidu</name>
<url>https://github.com/OpenVidu/openvidu</url>
</organization>
<scm>
<url>${openvidu.scm.url}</url>
<connection>scm:git:${openvidu.scm.connection}</connection>
<developerConnection>scm:git:${openvidu.scm.connection}</developerConnection>
<tag>develop</tag>
</scm>
<developers>
<developer>
<id>openvidu.io</id>
<name>-openvidu.io Community</name>
<organization>OpenVidu</organization>
<organizationUrl>https://openvidu.io</organizationUrl>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.kurento</groupId>
<artifactId>kurento-jsonrpc-client</artifactId>
<version>${version.kurento}</version>
</dependency>
<dependency>
<groupId>org.kurento</groupId>
<artifactId>kurento-jsonrpc-client-jetty</artifactId>
<version>${version.kurento}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${version.junit}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${version.mockito.core}</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>default</id>
<activation>
<property>
<name>default</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -1,217 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client;
import static io.openvidu.client.internal.ProtocolElements.CUSTOMREQUEST_METHOD;
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_METHOD;
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_PEERID_PARAM;
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_PEERSTREAMID_PARAM;
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_PEERSTREAMS_PARAM;
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_ROOM_PARAM;
import static io.openvidu.client.internal.ProtocolElements.JOINROOM_USER_PARAM;
import static io.openvidu.client.internal.ProtocolElements.LEAVEROOM_METHOD;
import static io.openvidu.client.internal.ProtocolElements.ONICECANDIDATE_CANDIDATE_PARAM;
import static io.openvidu.client.internal.ProtocolElements.ONICECANDIDATE_EPNAME_PARAM;
import static io.openvidu.client.internal.ProtocolElements.ONICECANDIDATE_METHOD;
import static io.openvidu.client.internal.ProtocolElements.ONICECANDIDATE_SDPMIDPARAM;
import static io.openvidu.client.internal.ProtocolElements.ONICECANDIDATE_SDPMLINEINDEX_PARAM;
import static io.openvidu.client.internal.ProtocolElements.PUBLISHVIDEO_DOLOOPBACK_PARAM;
import static io.openvidu.client.internal.ProtocolElements.PUBLISHVIDEO_METHOD;
import static io.openvidu.client.internal.ProtocolElements.PUBLISHVIDEO_SDPANSWER_PARAM;
import static io.openvidu.client.internal.ProtocolElements.PUBLISHVIDEO_SDPOFFER_PARAM;
import static io.openvidu.client.internal.ProtocolElements.RECEIVEVIDEO_METHOD;
import static io.openvidu.client.internal.ProtocolElements.RECEIVEVIDEO_SDPANSWER_PARAM;
import static io.openvidu.client.internal.ProtocolElements.RECEIVEVIDEO_SDPOFFER_PARAM;
import static io.openvidu.client.internal.ProtocolElements.RECEIVEVIDEO_SENDER_PARAM;
import static io.openvidu.client.internal.ProtocolElements.SENDMESSAGE_MESSAGE_PARAM;
import static io.openvidu.client.internal.ProtocolElements.SENDMESSAGE_ROOM_METHOD;
import static io.openvidu.client.internal.ProtocolElements.UNPUBLISHVIDEO_METHOD;
import static io.openvidu.client.internal.ProtocolElements.UNSUBSCRIBEFROMVIDEO_METHOD;
import static io.openvidu.client.internal.ProtocolElements.UNSUBSCRIBEFROMVIDEO_SENDER_PARAM;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.kurento.jsonrpc.client.JsonRpcClient;
import org.kurento.jsonrpc.client.JsonRpcClientWebSocket;
import org.kurento.jsonrpc.client.JsonRpcWSConnectionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import io.openvidu.client.internal.JsonRoomUtils;
import io.openvidu.client.internal.Notification;
/**
* Java client for the room server.
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*/
public class OpenViduClient {
private static final Logger log = LoggerFactory.getLogger(OpenViduClient.class);
private JsonRpcClient client;
private ServerJsonRpcHandler handler;
public OpenViduClient(String wsUri) {
this(new JsonRpcClientWebSocket(wsUri, new JsonRpcWSConnectionListener() {
@Override
public void reconnected(boolean sameServer) {
}
@Override
public void disconnected() {
log.warn("JsonRpcWebsocket connection: Disconnected");
}
@Override
public void connectionFailed() {
log.warn("JsonRpcWebsocket connection: Connection failed");
}
@Override
public void connected() {
}
@Override
public void reconnecting() {
log.warn("JsonRpcWebsocket connection: is reconnecting");
}
}, new SslContextFactory(true)));
}
public OpenViduClient(JsonRpcClient client) {
this.client = client;
this.handler = new ServerJsonRpcHandler();
this.client.setServerRequestHandler(this.handler);
}
public OpenViduClient(JsonRpcClient client, ServerJsonRpcHandler handler) {
this.client = client;
this.handler = handler;
this.client.setServerRequestHandler(this.handler);
}
public void close() throws IOException {
this.client.close();
}
public Map<String, List<String>> joinRoom(String roomName, String userName)
throws IOException {
JsonObject params = new JsonObject();
params.addProperty(JOINROOM_ROOM_PARAM, roomName);
params.addProperty(JOINROOM_USER_PARAM, userName);
JsonElement result = client.sendRequest(JOINROOM_METHOD, params);
Map<String, List<String>> peers = new HashMap<String, List<String>>();
JsonArray jsonPeers = JsonRoomUtils.getResponseProperty(result, "value", JsonArray.class);
if (jsonPeers.size() > 0) {
Iterator<JsonElement> peerIt = jsonPeers.iterator();
while (peerIt.hasNext()) {
JsonElement peer = peerIt.next();
String peerId = JsonRoomUtils.getResponseProperty(peer, JOINROOM_PEERID_PARAM,
String.class);
List<String> streams = new ArrayList<String>();
JsonArray jsonStreams = JsonRoomUtils.getResponseProperty(peer, JOINROOM_PEERSTREAMS_PARAM,
JsonArray.class, true);
if (jsonStreams != null) {
Iterator<JsonElement> streamIt = jsonStreams.iterator();
while (streamIt.hasNext()) {
streams.add(JsonRoomUtils.getResponseProperty(streamIt.next(),
JOINROOM_PEERSTREAMID_PARAM, String.class));
}
}
peers.put(peerId, streams);
}
}
return peers;
}
public void leaveRoom() throws IOException {
client.sendRequest(LEAVEROOM_METHOD, new JsonObject());
}
public String publishVideo(String sdpOffer, boolean doLoopback) throws IOException {
JsonObject params = new JsonObject();
params.addProperty(PUBLISHVIDEO_SDPOFFER_PARAM, sdpOffer);
params.addProperty(PUBLISHVIDEO_DOLOOPBACK_PARAM, doLoopback);
JsonElement result = client.sendRequest(PUBLISHVIDEO_METHOD, params);
return JsonRoomUtils.getResponseProperty(result, PUBLISHVIDEO_SDPANSWER_PARAM, String.class);
}
public void unpublishVideo() throws IOException {
client.sendRequest(UNPUBLISHVIDEO_METHOD, new JsonObject());
}
// sender should look like 'username_streamId'
public String receiveVideoFrom(String sender, String sdpOffer) throws IOException {
JsonObject params = new JsonObject();
params.addProperty(RECEIVEVIDEO_SENDER_PARAM, sender);
params.addProperty(RECEIVEVIDEO_SDPOFFER_PARAM, sdpOffer);
JsonElement result = client.sendRequest(RECEIVEVIDEO_METHOD, params);
return JsonRoomUtils.getResponseProperty(result, RECEIVEVIDEO_SDPANSWER_PARAM, String.class);
}
// sender should look like 'username_streamId'
public void unsubscribeFromVideo(String sender) throws IOException {
JsonObject params = new JsonObject();
params.addProperty(UNSUBSCRIBEFROMVIDEO_SENDER_PARAM, sender);
client.sendRequest(UNSUBSCRIBEFROMVIDEO_METHOD, params);
}
public void onIceCandidate(String endpointName, String candidate, String sdpMid,
int sdpMLineIndex) throws IOException {
JsonObject params = new JsonObject();
params.addProperty(ONICECANDIDATE_EPNAME_PARAM, endpointName);
params.addProperty(ONICECANDIDATE_CANDIDATE_PARAM, candidate);
params.addProperty(ONICECANDIDATE_SDPMIDPARAM, sdpMid);
params.addProperty(ONICECANDIDATE_SDPMLINEINDEX_PARAM, sdpMLineIndex);
client.sendRequest(ONICECANDIDATE_METHOD, params);
}
public void sendMessage(String userName, String roomName, String message) throws IOException {
JsonObject params = new JsonObject();
params.addProperty(SENDMESSAGE_MESSAGE_PARAM, message);
client.sendRequest(SENDMESSAGE_ROOM_METHOD, params);
}
public JsonElement customRequest(JsonObject customReqParams) throws IOException {
return client.sendRequest(CUSTOMREQUEST_METHOD, customReqParams);
}
/**
* Polls the notifications list maintained by this client to obtain new events sent by server.
* This method blocks until there is a notification to return. This is a one-time operation for
* the returned element.
*
* @return a server notification object, null when interrupted while waiting
*/
public Notification getServerNotification() {
return this.handler.getNotification();
}
}

View File

@ -1,87 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package io.openvidu.client;
import org.kurento.jsonrpc.JsonRpcErrorException;
public class OpenViduException extends JsonRpcErrorException {
private static final long serialVersionUID = 1L;
public static enum Code {
GENERIC_ERROR_CODE(999), WRONG_PATH_CODE(998),
TRANSPORT_ERROR_CODE(803), TRANSPORT_RESPONSE_ERROR_CODE(802), TRANSPORT_REQUEST_ERROR_CODE(801),
MEDIA_TYPE_STREAM_INCOMPATIBLE_WITH_RECORDING_PROPERTIES_ERROR_CODE(309),
MEDIA_TYPE_RECORDING_PROPERTIES_ERROR_CODE(308), MEDIA_MUTE_ERROR_CODE(307),
MEDIA_NOT_A_WEB_ENDPOINT_ERROR_CODE(306), MEDIA_RTP_ENDPOINT_ERROR_CODE(305),
MEDIA_WEBRTC_ENDPOINT_ERROR_CODE(304), MEDIA_ENDPOINT_ERROR_CODE(303), MEDIA_SDP_ERROR_CODE(302),
MEDIA_GENERIC_ERROR_CODE(301),
ROOM_CANNOT_BE_CREATED_ERROR_CODE(204), ROOM_CLOSED_ERROR_CODE(203), ROOM_NOT_FOUND_ERROR_CODE(202),
ROOM_GENERIC_ERROR_CODE(201),
USER_ALREADY_STREAMING_ERROR_CODE(106), USER_NOT_STREAMING_ERROR_CODE(105),
EXISTING_USER_IN_ROOM_ERROR_CODE(104), USER_CLOSED_ERROR_CODE(103), USER_NOT_FOUND_ERROR_CODE(102),
USER_GENERIC_ERROR_CODE(10),
USER_UNAUTHORIZED_ERROR_CODE(401), ROLE_NOT_FOUND_ERROR_CODE(402), SESSIONID_CANNOT_BE_CREATED_ERROR_CODE(403),
TOKEN_CANNOT_BE_CREATED_ERROR_CODE(404), EXISTING_FILTER_ALREADY_APPLIED_ERROR_CODE(405),
FILTER_NOT_APPLIED_ERROR_CODE(406), FILTER_EVENT_LISTENER_NOT_FOUND_ERROR_CODE(407),
PUBLISHER_ENDPOINT_NOT_FOUND_ERROR_CODE(408),
USER_METADATA_FORMAT_INVALID_ERROR_CODE(500),
SIGNAL_FORMAT_INVALID_ERROR_CODE(600), SIGNAL_TO_INVALID_ERROR_CODE(601),
DOCKER_NOT_FOUND(709), RECORDING_PATH_NOT_VALID(708), RECORDING_FILE_EMPTY_ERROR(707),
RECORDING_DELETE_ERROR_CODE(706), RECORDING_LIST_ERROR_CODE(705), RECORDING_STOP_ERROR_CODE(704),
RECORDING_START_ERROR_CODE(703), RECORDING_REPORT_ERROR_CODE(702), RECORDING_COMPLETION_ERROR_CODE(701),
FORCED_CODEC_NOT_FOUND_IN_SDPOFFER(800),
MEDIA_NODE_NOT_FOUND(900), MEDIA_NODE_STATUS_WRONG(901);
private int value;
private Code(int value) {
this.value = value;
}
public int getValue() {
return this.value;
}
}
private Code code = Code.GENERIC_ERROR_CODE;
public OpenViduException(Code code, String message) {
super(code.getValue(), message);
this.code = code;
}
public int getCodeValue() {
return code.getValue();
}
@Override
public String toString() {
return super.toString();
}
}

View File

@ -1,222 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import org.kurento.jsonrpc.DefaultJsonRpcHandler;
import org.kurento.jsonrpc.Transaction;
import org.kurento.jsonrpc.message.Request;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import io.openvidu.client.internal.IceCandidate;
import io.openvidu.client.internal.IceCandidateInfo;
import io.openvidu.client.internal.JsonRoomUtils;
import io.openvidu.client.internal.MediaErrorInfo;
import io.openvidu.client.internal.Notification;
import io.openvidu.client.internal.ParticipantEvictedInfo;
import io.openvidu.client.internal.ParticipantJoinedInfo;
import io.openvidu.client.internal.ParticipantLeftInfo;
import io.openvidu.client.internal.ParticipantPublishedInfo;
import io.openvidu.client.internal.ParticipantUnpublishedInfo;
import io.openvidu.client.internal.ProtocolElements;
import io.openvidu.client.internal.RoomClosedInfo;
import io.openvidu.client.internal.SendMessageInfo;
/**
* Service that handles server JSON-RPC events.
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*/
public class ServerJsonRpcHandler extends DefaultJsonRpcHandler<JsonObject> {
private static final Logger log = LoggerFactory.getLogger(ServerJsonRpcHandler.class);
private BlockingQueue<Notification> notifications = new ArrayBlockingQueue<Notification>(100);
@Override
public void handleRequest(Transaction transaction, Request<JsonObject> request) throws Exception {
Notification notif = null;
try {
switch (request.getMethod()) {
case ProtocolElements.ICECANDIDATE_METHOD:
notif = iceCandidate(transaction, request);
break;
case ProtocolElements.MEDIAERROR_METHOD:
notif = mediaError(transaction, request);
break;
case ProtocolElements.PARTICIPANTJOINED_METHOD:
notif = participantJoined(transaction, request);
break;
case ProtocolElements.PARTICIPANTLEFT_METHOD:
notif = participantLeft(transaction, request);
break;
case ProtocolElements.PARTICIPANTEVICTED_METHOD:
notif = participantEvicted(transaction, request);
break;
case ProtocolElements.PARTICIPANTPUBLISHED_METHOD:
notif = participantPublished(transaction, request);
break;
case ProtocolElements.PARTICIPANTUNPUBLISHED_METHOD:
notif = participantUnpublished(transaction, request);
break;
case ProtocolElements.ROOMCLOSED_METHOD:
notif = roomClosed(transaction, request);
break;
case ProtocolElements.PARTICIPANTSENDMESSAGE_METHOD:
notif = participantSendMessage(transaction, request);
break;
default:
throw new Exception("Unrecognized request " + request.getMethod());
}
} catch (Exception e) {
log.error("Exception processing request {}", request, e);
transaction.sendError(e);
return;
}
if (notif != null) {
try {
notifications.put(notif);
log.debug("Enqueued notification {}", notif);
} catch (InterruptedException e) {
log.warn("Interrupted when enqueuing notification {}", notif, e);
}
}
}
private Notification participantSendMessage(Transaction transaction,
Request<JsonObject> request) {
String data = JsonRoomUtils.getRequestParam(request,
ProtocolElements.PARTICIPANTSENDMESSAGE_DATA_PARAM, String.class);
String from = JsonRoomUtils.getRequestParam(request,
ProtocolElements.PARTICIPANTSENDMESSAGE_FROM_PARAM, String.class);
String type = JsonRoomUtils.getRequestParam(request,
ProtocolElements.PARTICIPANTSENDMESSAGE_TYPE_PARAM, String.class);
SendMessageInfo eventInfo = new SendMessageInfo(data, from, type);
log.debug("Recvd send message event {}", eventInfo);
return eventInfo;
}
private Notification roomClosed(Transaction transaction, Request<JsonObject> request) {
String room = JsonRoomUtils.getRequestParam(request, ProtocolElements.ROOMCLOSED_ROOM_PARAM,
String.class);
RoomClosedInfo eventInfo = new RoomClosedInfo(room);
log.debug("Recvd room closed event {}", eventInfo);
return eventInfo;
}
private Notification participantUnpublished(Transaction transaction,
Request<JsonObject> request) {
String name = JsonRoomUtils.getRequestParam(request,
ProtocolElements.PARTICIPANTUNPUBLISHED_NAME_PARAM, String.class);
ParticipantUnpublishedInfo eventInfo = new ParticipantUnpublishedInfo(name);
log.debug("Recvd participant unpublished event {}", eventInfo);
return eventInfo;
}
private Notification participantPublished(Transaction transaction, Request<JsonObject> request) {
String id = JsonRoomUtils.getRequestParam(request,
ProtocolElements.PARTICIPANTPUBLISHED_USER_PARAM, String.class);
JsonArray jsonStreams = JsonRoomUtils.getRequestParam(request,
ProtocolElements.PARTICIPANTPUBLISHED_STREAMS_PARAM, JsonArray.class);
Iterator<JsonElement> streamIt = jsonStreams.iterator();
List<String> streams = new ArrayList<String>();
while (streamIt.hasNext()) {
streams.add(JsonRoomUtils.getResponseProperty(streamIt.next(),
ProtocolElements.PARTICIPANTPUBLISHED_STREAMID_PARAM, String.class));
}
ParticipantPublishedInfo eventInfo = new ParticipantPublishedInfo(id, streams);
log.debug("Recvd published event {}", eventInfo);
return eventInfo;
}
private Notification participantEvicted(Transaction transaction, Request<JsonObject> request) {
ParticipantEvictedInfo eventInfo = new ParticipantEvictedInfo();
log.debug("Recvd participant evicted event {}", eventInfo);
return eventInfo;
}
private Notification participantLeft(Transaction transaction, Request<JsonObject> request) {
String name = JsonRoomUtils.getRequestParam(request,
ProtocolElements.PARTICIPANTLEFT_NAME_PARAM, String.class);
ParticipantLeftInfo eventInfo = new ParticipantLeftInfo(name);
log.debug("Recvd participant left event {}", eventInfo);
return eventInfo;
}
private Notification participantJoined(Transaction transaction, Request<JsonObject> request) {
String id = JsonRoomUtils.getRequestParam(request,
ProtocolElements.PARTICIPANTJOINED_USER_PARAM, String.class);
ParticipantJoinedInfo eventInfo = new ParticipantJoinedInfo(id);
log.debug("Recvd participant joined event {}", eventInfo);
return eventInfo;
}
private Notification mediaError(Transaction transaction, Request<JsonObject> request) {
String description = JsonRoomUtils.getRequestParam(request,
ProtocolElements.MEDIAERROR_ERROR_PARAM, String.class);
MediaErrorInfo eventInfo = new MediaErrorInfo(description);
log.debug("Recvd media error event {}", eventInfo);
return eventInfo;
}
private Notification iceCandidate(Transaction transaction, Request<JsonObject> request) {
String candidate = JsonRoomUtils.getRequestParam(request,
ProtocolElements.ICECANDIDATE_CANDIDATE_PARAM, String.class);
String sdpMid = JsonRoomUtils.getRequestParam(request,
ProtocolElements.ICECANDIDATE_SDPMID_PARAM, String.class);
int sdpMLineIndex = JsonRoomUtils.getRequestParam(request,
ProtocolElements.ICECANDIDATE_SDPMLINEINDEX_PARAM, Integer.class);
IceCandidate iceCandidate = new IceCandidate(candidate, sdpMid, sdpMLineIndex);
String endpoint = JsonRoomUtils.getRequestParam(request,
ProtocolElements.ICECANDIDATE_EPNAME_PARAM, String.class);
IceCandidateInfo eventInfo = new IceCandidateInfo(iceCandidate, endpoint);
log.debug("Recvd ICE candidate event {}", eventInfo);
return eventInfo;
}
/**
* Blocks until an element is available and then returns it by removing it from the queue.
*
* @return a {@link Notification} from the queue, null when interrupted
* @see BlockingQueue#take()
*/
public Notification getNotification() {
try {
Notification notif = notifications.take();
log.debug("Dequeued notification {}", notif);
return notif;
} catch (InterruptedException e) {
log.info("Interrupted while polling notifications' queue");
return null;
}
}
}

View File

@ -1,33 +0,0 @@
package io.openvidu.client.internal;
public class IceCandidate {
private String candidate;
private String sdpMid;
private int sdpMLineIndex;
public IceCandidate(String candidate, String sdpMid, int sdpMLineIndex) {
super();
this.candidate = candidate;
this.sdpMid = sdpMid;
this.sdpMLineIndex = sdpMLineIndex;
}
public String getCandidate() {
return candidate;
}
public String getSdpMid() {
return sdpMid;
}
public int getSdpMLineIndex() {
return sdpMLineIndex;
}
@Override
public String toString() {
return "IceCandidate [candidate=" + candidate + ", sdpMid=" + sdpMid + ", sdpMLineIndex="
+ sdpMLineIndex + "]";
}
}

View File

@ -1,70 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client.internal;
/**
* @see Notification
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*/
public class IceCandidateInfo extends Notification {
private IceCandidate iceCandidate;
private String endpointName;
public IceCandidateInfo(IceCandidate iceCandidate, String endpointName) {
super(ProtocolElements.ICECANDIDATE_METHOD);
this.iceCandidate = iceCandidate;
this.endpointName = endpointName;
}
public IceCandidate getIceCandidate() {
return iceCandidate;
}
public void setIceCandidate(IceCandidate iceCandidate) {
this.iceCandidate = iceCandidate;
}
public String getEndpointName() {
return endpointName;
}
public void setEndpointName(String endpointName) {
this.endpointName = endpointName;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
if (getMethod() != null) {
builder.append("method=").append(getMethod()).append(", ");
}
if (endpointName != null) {
builder.append("endpointName=").append(endpointName).append(", ");
}
if (iceCandidate != null) {
builder.append("iceCandidate=[sdpMLineIndex= ").append(iceCandidate.getSdpMLineIndex())
.append(", sdpMid=").append(iceCandidate.getSdpMid()).append(", candidate=")
.append(iceCandidate.getCandidate()).append("]");
}
builder.append("]");
return builder.toString();
}
}

View File

@ -1,107 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client.internal;
import org.kurento.jsonrpc.message.Request;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import io.openvidu.client.OpenViduException;
import io.openvidu.client.OpenViduException.Code;
/**
* JSON tools for extracting info from request or response elements.
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*/
public class JsonRoomUtils {
public static <T> T getRequestParam(Request<JsonObject> request, String paramName, Class<T> type) {
return getRequestParam(request, paramName, type, false);
}
public static <T> T getRequestParam(Request<JsonObject> request, String paramName, Class<T> type,
boolean allowNull) {
JsonObject params = request.getParams();
if (params == null) {
if (!allowNull) {
throw new OpenViduException(Code.TRANSPORT_REQUEST_ERROR_CODE,
"Invalid request lacking parameter '" + paramName + "'");
} else {
return null;
}
}
return getConverted(params.get(paramName), paramName, type, allowNull);
}
public static <T> T getResponseProperty(JsonElement result, String property, Class<T> type) {
return getResponseProperty(result, property, type, false);
}
public static <T> T getResponseProperty(JsonElement result, String property, Class<T> type,
boolean allowNull) {
if (!(result instanceof JsonObject)) {
throw new OpenViduException(Code.TRANSPORT_RESPONSE_ERROR_CODE,
"Invalid response format. The response '" + result + "' should be a Json object");
}
return getConverted(result.getAsJsonObject().get(property), property, type, allowNull);
}
public static JsonArray getResponseArray(JsonElement result) {
if (!result.isJsonArray()) {
throw new OpenViduException(Code.TRANSPORT_RESPONSE_ERROR_CODE,
"Invalid response format. The response '" + result + "' should be a Json array");
}
return result.getAsJsonArray();
}
@SuppressWarnings("unchecked")
private static <T> T getConverted(JsonElement paramValue, String property, Class<T> type,
boolean allowNull) {
if (paramValue == null) {
if (allowNull) {
return null;
} else {
throw new OpenViduException(Code.TRANSPORT_ERROR_CODE, "Invalid method lacking parameter '"
+ property + "'");
}
}
if (type == String.class) {
if (paramValue.isJsonPrimitive()) {
return (T) paramValue.getAsString();
}
}
if (type == Integer.class) {
if (paramValue.isJsonPrimitive()) {
return (T) Integer.valueOf(paramValue.getAsInt());
}
}
if (type == JsonArray.class) {
if (paramValue.isJsonArray()) {
return (T) paramValue.getAsJsonArray();
}
}
throw new OpenViduException(Code.TRANSPORT_ERROR_CODE, "Param '" + property + "' with value '"
+ paramValue + "' is not a " + type.getName());
}
}

View File

@ -1,55 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client.internal;
/**
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*
* @see Notification
*/
public class MediaErrorInfo extends Notification {
private String description;
public MediaErrorInfo(String description) {
super(ProtocolElements.MEDIAERROR_METHOD);
this.description = description;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
if (getMethod() != null) {
builder.append("method=").append(getMethod()).append(", ");
}
if (description != null) {
builder.append("description=").append(description);
}
builder.append("]");
return builder.toString();
}
}

View File

@ -1,90 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client.internal;
/**
* Wrapper for server events.
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*/
public abstract class Notification {
public enum Method {
ICECANDIDATE_METHOD(ProtocolElements.ICECANDIDATE_METHOD), MEDIAERROR_METHOD(
ProtocolElements.MEDIAERROR_METHOD), PARTICIPANTJOINED_METHOD(
ProtocolElements.PARTICIPANTJOINED_METHOD), PARTICIPANTLEFT_METHOD(
ProtocolElements.PARTICIPANTLEFT_METHOD), PARTICIPANTEVICTED_METHOD(
ProtocolElements.PARTICIPANTEVICTED_METHOD), PARTICIPANTPUBLISHED_METHOD(
ProtocolElements.PARTICIPANTPUBLISHED_METHOD), PARTICIPANTUNPUBLISHED_METHOD(
ProtocolElements.PARTICIPANTUNPUBLISHED_METHOD), ROOMCLOSED_METHOD(
ProtocolElements.ROOMCLOSED_METHOD), PARTICIPANTSENDMESSAGE_METHOD(
ProtocolElements.PARTICIPANTSENDMESSAGE_METHOD);
private String methodValue;
private Method(String val) {
this.methodValue = val;
}
public String getMethodValue() {
return methodValue;
}
public static Method getFromValue(String val) {
for (Method m : Method.values()) {
if (m.methodValue.equals(val)) {
return m;
}
}
return null;
}
@Override
public String toString() {
return getMethodValue().toString();
}
}
private Method method;
public Notification(Method method) {
this.setMethod(method);
}
public Notification(String methodValue) {
this(Method.getFromValue(methodValue));
}
public Method getMethod() {
return method;
}
public void setMethod(Method method) {
this.method = method;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
if (method != null) {
builder.append("method=").append(method);
}
builder.append("]");
return builder.toString();
}
}

View File

@ -1,30 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client.internal;
/**
* @see Notification
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*/
public class ParticipantEvictedInfo extends Notification {
public ParticipantEvictedInfo() {
super(ProtocolElements.PARTICIPANTEVICTED_METHOD);
}
}

View File

@ -1,54 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client.internal;
/**
* @see Notification
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*/
public class ParticipantJoinedInfo extends Notification {
private String id;
public ParticipantJoinedInfo(String id) {
super(ProtocolElements.PARTICIPANTJOINED_METHOD);
this.id = id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
if (getMethod() != null) {
builder.append("method=").append(getMethod()).append(", ");
}
if (id != null) {
builder.append("id=").append(id);
}
builder.append("]");
return builder.toString();
}
}

View File

@ -1,54 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client.internal;
/**
* @see Notification
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*/
public class ParticipantLeftInfo extends Notification {
private String name;
public ParticipantLeftInfo(String name) {
super(ProtocolElements.PARTICIPANTLEFT_METHOD);
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
if (getMethod() != null) {
builder.append("method=").append(getMethod()).append(", ");
}
if (name != null) {
builder.append("name=").append(name);
}
builder.append("]");
return builder.toString();
}
}

View File

@ -1,69 +0,0 @@
/*
* (C) Copyright 2017-2022 OpenVidu (https://openvidu.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.openvidu.client.internal;
import java.util.List;
/**
* @see Notification
*
* @author <a href="mailto:rvlad@naevatec.com">Radu Tom Vlad</a>
*/
public class ParticipantPublishedInfo extends Notification {
private String id;
private List<String> streams;
public ParticipantPublishedInfo(String id, List<String> streams) {
super(ProtocolElements.PARTICIPANTPUBLISHED_METHOD);
this.id = id;
this.streams = streams;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public List<String> getStreams() {
return streams;
}
public void setStreams(List<String> streams) {
this.streams = streams;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("[");
if (getMethod() != null) {
builder.append("method=").append(getMethod()).append(", ");
}
if (id != null) {
builder.append("id=").append(id).append(", ");
}
if (streams != null) {
builder.append("streams=").append(streams);
}
builder.append("]");
return builder.toString();
}
}

Some files were not shown because too many files have changed in this diff Show More