From cd03f027fbb994a8c8b123f6009254e944dbdbf1 Mon Sep 17 00:00:00 2001 From: ahmad-bbbb Date: Mon, 15 Sep 2025 12:19:40 +0300 Subject: [PATCH 01/62] Update index.js lazy load vtt file --- src/components/webcams/index.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/components/webcams/index.js b/src/components/webcams/index.js index 1a101173..2186440b 100644 --- a/src/components/webcams/index.js +++ b/src/components/webcams/index.js @@ -3,9 +3,8 @@ import { defineMessages, useIntl, } from 'react-intl'; -import videojs from 'video.js/dist/video.es.js'; -import 'videojs-seek-buttons' -import { player as config, shortcuts } from 'config'; +import videojs from 'video.js/core.es.js'; +import { player as config } from 'config'; import { EVENTS, ID, @@ -80,12 +79,6 @@ const buildOptions = (sources, tracks) => { playbackRates: config.rates, sources: sources.current, tracks: tracks.current, - plugins: { - seekButtons: { - forward: shortcuts.seek.seconds, - back: shortcuts.seek.seconds, - } - } }; }; @@ -110,10 +103,8 @@ const Webcams = () => { player.webcams.on('play', () => { const frequency = getFrequency(); interval.current = setInterval(() => { - if (player.webcams) { - const currentTime = player.webcams.currentTime(); - dispatchTimeUpdate(currentTime); - } + const currentTime = player.webcams.currentTime(); + dispatchTimeUpdate(currentTime); }, 1000 / (frequency ? frequency : config.rps)); }); From 3a6d7f02c24038968b244e260dbbcaf3481f7f31 Mon Sep 17 00:00:00 2001 From: ahmad-bbbb Date: Tue, 23 Sep 2025 12:45:54 +0300 Subject: [PATCH 02/62] lazy load vtt file summary popup --- src/components/bars/top/buttons/search.js | 38 +- src/components/bars/top/buttons/summary.js | 470 ++++++++++++++++++++ src/components/bars/top/index.js | 66 +-- src/components/utils/icon/file-multiple.svg | 1 + src/components/utils/icon/index.scss | 22 + src/components/webcams/index.js | 342 +++++++++----- src/components/webcams/index.scss | 94 +++- src/locales/messages/en.json | 1 + src/utils/constants.js | 183 ++++---- 9 files changed, 957 insertions(+), 260 deletions(-) create mode 100644 src/components/bars/top/buttons/summary.js create mode 100644 src/components/utils/icon/file-multiple.svg diff --git a/src/components/bars/top/buttons/search.js b/src/components/bars/top/buttons/search.js index b14efddb..389a982f 100644 --- a/src/components/bars/top/buttons/search.js +++ b/src/components/bars/top/buttons/search.js @@ -1,8 +1,8 @@ import React from 'react'; import PropTypes from 'prop-types'; import { - defineMessages, - useIntl, + defineMessages, + useIntl, } from 'react-intl'; import Button from 'components/utils/button'; import { controls as config } from 'config'; @@ -10,10 +10,10 @@ import { ID } from 'utils/constants'; import layout from 'utils/layout'; const intlMessages = defineMessages({ - search: { - id: 'button.search.aria', - description: 'Aria label for the search button', - }, + search: { + id: 'button.search.aria', + description: 'Aria label for the search button', + }, }); const propTypes = { openSearch: PropTypes.func }; @@ -21,21 +21,21 @@ const propTypes = { openSearch: PropTypes.func }; const defaultProps = { openSearch: () => {} }; const Search = ({ openSearch }) => { - const intl = useIntl(); - - if (!layout.control || !config.search || layout.single) return null; - - return ( - + )} + + + +