From 4ebfcf564db9cf79b56a05c37984178657fbaba2 Mon Sep 17 00:00:00 2001 From: Ruslan Khayrullin Date: Mon, 15 May 2023 18:01:56 +0500 Subject: [PATCH] feat(in-600): remove mp4 player --- .../components/FinishedMatch/helpers.tsx | 139 ----- .../components/FinishedMatch/hooks/index.tsx | 71 --- .../FinishedMatch/hooks/useChapters.tsx | 46 -- .../FinishedMatch/hooks/useEpisodes.tsx | 71 --- .../FinishedMatch/hooks/usePlayerLogger.tsx | 72 --- .../components/FinishedMatch/index.tsx | 74 --- .../components/FinishedMatch/styled.tsx | 26 - .../MatchPage/components/LiveMatch/index.tsx | 23 +- src/features/MatchPage/index.tsx | 11 +- .../MatchPage/store/hooks/useMatchData.tsx | 7 +- src/features/MatchPopup/store/hooks/index.tsx | 5 +- .../components/Matches/index.tsx | 4 +- .../__tests__/index.tsx | 47 -- .../helpers/calculateChapterStyles/index.tsx | 59 --- .../components/ProgressBar/hooks.tsx | 51 -- .../components/ProgressBar/index.tsx | 52 -- .../components/ProgressBar/stories.tsx | 126 ----- .../components/ProgressBar/styled.tsx | 20 - .../components/Settings/hooks.tsx | 27 - .../components/Settings/index.tsx | 47 -- .../components/Settings/styled.tsx | 78 --- src/features/MultiSourcePlayer/config.tsx | 5 - .../MultiSourcePlayer/helpers/index.tsx | 35 -- .../MultiSourcePlayer/hooks/index.tsx | 494 ------------------ .../hooks/usePlayingHandlers.tsx | 102 ---- .../hooks/useProgressChangeHandler.tsx | 51 -- .../hooks/useVideoQuality.tsx | 38 -- src/features/MultiSourcePlayer/index.tsx | 268 ---------- src/features/MultiSourcePlayer/styled.tsx | 48 -- src/features/MultiSourcePlayer/types.tsx | 20 - .../Components/ControlsMobile/index.tsx | 2 +- .../Controls/Components/ControlsWeb/index.tsx | 6 +- .../components/Controls/index.tsx | 53 +- .../components/Settings/index.tsx | 2 +- .../components/Settings/styled.tsx | 4 +- .../components/YoutubePlayer/index.tsx | 51 -- src/features/StreamPlayer/hooks/index.tsx | 2 +- src/features/StreamPlayer/styled.tsx | 11 +- src/hooks/index.tsx | 1 + .../hooks/useDuration.tsx | 2 +- 40 files changed, 43 insertions(+), 2208 deletions(-) delete mode 100644 src/features/MatchPage/components/FinishedMatch/helpers.tsx delete mode 100644 src/features/MatchPage/components/FinishedMatch/hooks/index.tsx delete mode 100644 src/features/MatchPage/components/FinishedMatch/hooks/useChapters.tsx delete mode 100644 src/features/MatchPage/components/FinishedMatch/hooks/useEpisodes.tsx delete mode 100644 src/features/MatchPage/components/FinishedMatch/hooks/usePlayerLogger.tsx delete mode 100644 src/features/MatchPage/components/FinishedMatch/index.tsx delete mode 100644 src/features/MatchPage/components/FinishedMatch/styled.tsx delete mode 100644 src/features/MultiSourcePlayer/components/ProgressBar/helpers/calculateChapterStyles/__tests__/index.tsx delete mode 100644 src/features/MultiSourcePlayer/components/ProgressBar/helpers/calculateChapterStyles/index.tsx delete mode 100644 src/features/MultiSourcePlayer/components/ProgressBar/hooks.tsx delete mode 100644 src/features/MultiSourcePlayer/components/ProgressBar/index.tsx delete mode 100644 src/features/MultiSourcePlayer/components/ProgressBar/stories.tsx delete mode 100644 src/features/MultiSourcePlayer/components/ProgressBar/styled.tsx delete mode 100644 src/features/MultiSourcePlayer/components/Settings/hooks.tsx delete mode 100644 src/features/MultiSourcePlayer/components/Settings/index.tsx delete mode 100644 src/features/MultiSourcePlayer/components/Settings/styled.tsx delete mode 100644 src/features/MultiSourcePlayer/config.tsx delete mode 100644 src/features/MultiSourcePlayer/helpers/index.tsx delete mode 100644 src/features/MultiSourcePlayer/hooks/index.tsx delete mode 100644 src/features/MultiSourcePlayer/hooks/usePlayingHandlers.tsx delete mode 100644 src/features/MultiSourcePlayer/hooks/useProgressChangeHandler.tsx delete mode 100644 src/features/MultiSourcePlayer/hooks/useVideoQuality.tsx delete mode 100644 src/features/MultiSourcePlayer/index.tsx delete mode 100644 src/features/MultiSourcePlayer/styled.tsx delete mode 100644 src/features/MultiSourcePlayer/types.tsx delete mode 100644 src/features/StreamPlayer/components/YoutubePlayer/index.tsx rename src/{features/MultiSourcePlayer => }/hooks/useDuration.tsx (75%) diff --git a/src/features/MatchPage/components/FinishedMatch/helpers.tsx b/src/features/MatchPage/components/FinishedMatch/helpers.tsx deleted file mode 100644 index f99f3fb0..00000000 --- a/src/features/MatchPage/components/FinishedMatch/helpers.tsx +++ /dev/null @@ -1,139 +0,0 @@ -import map from 'lodash/map' -import last from 'lodash/last' -import uniq from 'lodash/uniq' -import filter from 'lodash/filter' -import reduce from 'lodash/reduce' -import concat from 'lodash/concat' -import orderBy from 'lodash/orderBy' -import isEmpty from 'lodash/isEmpty' -import groupBy from 'lodash/groupBy' - -import type { - Videos, - Episodes, - Episode, -} from 'requests' - -import type { Chapters, Urls } from 'features/MultiSourcePlayer/types' - -import type { PlaylistOption } from '../../types' -import { FULL_GAME_KEY } from '../../helpers/buildPlaylists' - -const getUniquePeriods = (videos: Videos) => uniq(map(videos, ({ period }) => period)) - -type Video = { - duration: number, - period: number, - urls: Urls, -} - -const getVideoByPeriod = (videos: Videos, period: number) => { - const videosWithSamePeriod = filter(videos, { period }) - if (isEmpty(videosWithSamePeriod)) return null - - const urls = reduce( - videosWithSamePeriod, - (acc: Urls, video) => ({ - ...acc, - [video.quality]: video.url, - }), - {}, - ) - const [video] = videosWithSamePeriod - return { - duration: video.duration, - period: video.period, - urls, - } -} - -const getVideoByPeriods = (videos: Videos, periods: Array) => ( - reduce( - periods, - (acc: Array