Skip to content

Commit

Permalink
demo: Fix CI namespace error after dependency update
Browse files Browse the repository at this point in the history
  • Loading branch information
peaBerberian committed Dec 27, 2024
1 parent 5ef0397 commit 01da4ba
Show file tree
Hide file tree
Showing 39 changed files with 46 additions and 42 deletions.
2 changes: 1 addition & 1 deletion demo/scripts/components/BufferContentGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default function BufferContentGraph({
maximumPosition: number | null | undefined;
seek: (pos: number) => void;
type: "audio" | "video" | "text";
}>): JSX.Element {
}>): React.JSX.Element {
const randomColors = useMemo<string[]>(() => shuffleArray(COLORS), []);
const [tipVisible, setTipVisible] = useState(false);
const [tipPosition, setTipPosition] = useState(0);
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Button({
value: string;
disabled: boolean;
title?: string;
}): JSX.Element {
}): React.JSX.Element {
if (disabled) {
return (
<button
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/CheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Checkbox({
name: string;
checked: boolean;
children?: string;
}): JSX.Element {
}): React.JSX.Element {
const onInputChange = React.useCallback(
(evt: React.ChangeEvent<HTMLInputElement>) => {
onChange(getCheckBoxValue(evt.target));
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/FocusedInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function FocusedInput({
onChange: (newVal: string) => void;
value?: string;
placeholder?: string;
}): JSX.Element {
}): React.JSX.Element {
const inputEl = useRef<HTMLInputElement>(null);
useEffect(
() => {
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/GenerateLinkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function GenerateLinkButton({
}: {
enabled: boolean;
onClick: () => void;
}): JSX.Element {
}): React.JSX.Element {
return (
<button
aria-label="Generate link for the current custom button"
Expand Down
6 changes: 5 additions & 1 deletion demo/scripts/components/GenerateLinkURL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import * as React from "react";
* @param {Object} props
* @returns {Object}
*/
function GeneratedLinkURL({ url }: { url: string | undefined | null }): JSX.Element {
function GeneratedLinkURL({
url,
}: {
url: string | undefined | null;
}): React.JSX.Element {
if (url === undefined || url === null || url === "") {
return (
<span>
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/GitHubButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const GitHubButton = ({
dataText?: string;
title?: string;
children?: React.ReactNode;
}): JSX.Element => {
}): React.JSX.Element => {
const aRef = useRef<HTMLAnchorElement>(null);

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function Input({
onChange: (newVal: string) => void;
value?: string;
placeholder?: string;
}): JSX.Element {
}): React.JSX.Element {
const onInputChange = React.useCallback(
(evt: React.ChangeEvent<HTMLInputElement>) => {
onChange(evt.target.value);
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/Knob.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Knob({
options: string[];
selected: { index: number | undefined; value: string | undefined };
disabled: boolean;
}): JSX.Element {
}): React.JSX.Element {
return (
<div className={`knob ${className}`}>
<span className="knob-name">{name}</span>
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/LivePosition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as React from "react";
* @param {Object} props
* @returns {Object}
*/
function LivePosition({ className = "" }: { className?: string }): JSX.Element {
function LivePosition({ className = "" }: { className?: string }): React.JSX.Element {
return <div className={"position-infos live " + className}>Live</div>;
}

Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/Options/BufferOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function BufferOptions({
onMaxVideoBufferSizeChange: (newVal: number) => void;
onMaxBufferBehindChange: (newVal: number) => void;
onMaxBufferAheadChange: (newVal: number) => void;
}): JSX.Element {
}): React.JSX.Element {
/* Value of the `wantedBufferAhead` input */
const [wantedBufferAheadStr, setWantedBufferAheadStr] = useState(
String(wantedBufferAhead),
Expand Down
4 changes: 2 additions & 2 deletions demo/scripts/components/Options/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ function Option({
children,
}: {
title: string;
children: JSX.Element;
}): JSX.Element {
children: React.JSX.Element;
}): React.JSX.Element {
return (
<div className="optionWrapper">
<h4 className="optionTitle">{title}</h4>
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/Options/Playback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function PlaybackConfig({
onAutoPlayChange: (val: boolean) => void;
tryRelyOnWorker: boolean;
onTryRelyOnWorkerChange: (val: boolean) => void;
}): JSX.Element {
}): React.JSX.Element {
return (
<>
<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function PlayerOptionNumberInput({
defaultValueAsNumber: number;
isDisabled: boolean;
onResetClick: () => void;
}): JSX.Element {
}): React.JSX.Element {
const shouldBeDisabled = parseFloat(valueAsString) === defaultValueAsNumber;
const onInputChange = React.useCallback(
(evt: React.ChangeEvent<HTMLInputElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/Options/RequestConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function RequestConfig({
onCmcdChange: (val: string) => void;
segmentRequestTimeout: number;
segmentRetry: number;
}): JSX.Element {
}): React.JSX.Element {
/* Value of the `segmentRetry` input */
const [segmentRetryStr, setSegmentRetryStr] = useState(String(segmentRetry));
/* Value of the `segmentRequestTimeout` input */
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/Options/TrackSwitch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function TrackSwitchConfig({
onCodecSwitch: string;
onCodecSwitchChange: (val: string) => void;
onEnableFastSwitchingChange: (val: boolean) => void;
}): JSX.Element {
}): React.JSX.Element {
let defaultAudioTrackSwitchingModeDescMsg;
switch (defaultAudioTrackSwitchingMode) {
case "reload":
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/Options/VideoAdaptiveSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function VideoAdaptiveSettings({
throttleVideoBitrateWhenHidden: boolean;
onVideoResolutionLimitChange: (newVal: { index: number; value: string }) => void;
onThrottleVideoBitrateWhenHiddenChange: (newVal: boolean) => void;
}): JSX.Element {
}): React.JSX.Element {
let defaultVideoRepresentationsSwitchingModeDescMsg;
switch (defaultVideoRepresentationsSwitchingMode) {
case "reload":
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/PositionInfos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function PositionInfos({
className?: string | undefined;
position?: number | undefined;
duration?: number | undefined;
}): JSX.Element {
}): React.JSX.Element {
const convertTime = duration >= 60 * 60 ? toHours : toMinutes;
return (
<div className={"position-infos " + className}>
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function ProgressBar({
maximumPosition: number | null | undefined;
onMouseMove: (pos: number, evt: React.MouseEvent) => void;
onMouseOut: (evt: React.MouseEvent) => void;
}): JSX.Element {
}): React.JSX.Element {
const wrapperRef = React.useRef<HTMLDivElement>(null);
const usedMinimum = minimumPosition ?? 0;
const usedMaximum = maximumPosition ?? 300;
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Select({
selected: { index: number | undefined; value: string | undefined };
options?: string[] | Array<{ name: string; disabled: boolean }>;
disabled: boolean;
}): JSX.Element {
}): React.JSX.Element {
let selectedIndex = typeof selected.index === "number" ? selected.index : undefined;

const optionsEl = options.map((val, index) => {
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/StickToLiveEdgeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function StickToLiveEdgeButton({
}: {
isStickingToTheLiveEdge: boolean;
changeStickToLiveEdge: (newVal: boolean) => void;
}): JSX.Element {
}): React.JSX.Element {
const onClick = React.useCallback(() => {
changeStickToLiveEdge(!isStickingToTheLiveEdge);
}, [changeStickToLiveEdge, isStickingToTheLiveEdge]);
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/ToolTip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function ToolTip({
offset: number;
text: string;
xPosition: number;
}): JSX.Element {
}): React.JSX.Element {
const wrapperEl = useRef<HTMLDivElement>(null);
useEffect(() => {
if (isNaN(+xPosition) || !wrapperEl.current) {
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/components/VideoThumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function VideoThumbnail({
player: IPlayerModule;
xPosition: number | null;
time: number;
}): JSX.Element {
}): React.JSX.Element {
const videoThumbnailLoader = useModuleState(player, "videoThumbnailLoader");
const videoElement = useModuleState(player, "videoThumbnailsElement");

Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/ContentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function ContentList({
loadVideo: (opts: ILoadVideoOptions) => void;
showOptions: boolean;
onOptionToggle: () => void;
}): JSX.Element {
}): React.JSX.Element {
const initialContents = React.useMemo(() => {
return constructContentList();
}, []);
Expand Down
4 changes: 2 additions & 2 deletions demo/scripts/controllers/ErrorDisplayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react";
import useModuleState from "../lib/useModuleState";
import type { IPlayerModule } from "../modules/player/index";

function PlayerError({ error }: { error: Error }): JSX.Element {
function PlayerError({ error }: { error: Error }): React.JSX.Element {
const message: string =
typeof error.message === "string" ? error.message : String(error);

Expand All @@ -15,7 +15,7 @@ function PlayerError({ error }: { error: Error }): JSX.Element {
);
}

function ErrorDisplayer({ player }: { player: IPlayerModule }): JSX.Element {
function ErrorDisplayer({ player }: { player: IPlayerModule }): React.JSX.Element {
const error = useModuleState(player, "error");
return (
<div className="player-error">{error ? <PlayerError error={error} /> : null}</div>
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/FullScreenButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function FullscreenButton({
playerWrapperElementRef: { current: HTMLElement | null };
player: IPlayerModule;
className: string;
}): JSX.Element {
}): React.JSX.Element {
const hasCurrentContent = useModuleState(player, "hasCurrentContent");
const isInitiallyFullscreen = useMemo(() => isFullscreen(), []);
const [isCurrentlyFullScreen, setIsCurrentlyFullScreen] =
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from "react";
import GitHubButton from "../components/GitHubButton";
import Player from "./Player";

function MainComponent(): JSX.Element {
function MainComponent(): React.JSX.Element {
return (
<React.Fragment>
<header>
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/PlayPauseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function PlayPauseButton({
}: {
className?: string | undefined;
player: IPlayerModule;
}): JSX.Element {
}): React.JSX.Element {
const cannotLoadMetadata = useModuleState(player, "cannotLoadMetadata");
const isPaused = useModuleState(player, "isPaused");
const isContentLoaded = useModuleState(player, "isContentLoaded");
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const { useCallback, useEffect, useRef, useState } = React;
// time in ms while seeking/loading/buffering after which the spinner is shown
const SPINNER_TIMEOUT = 300;

function Player(): JSX.Element {
function Player(): React.JSX.Element {
const [
defaultAudioRepresentationsSwitchingMode,
setDefaultAudioRepresentationsSwitchingMode,
Expand Down
4 changes: 2 additions & 2 deletions demo/scripts/controllers/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function ProgressBar({
player: IPlayerModule;
enableVideoThumbnails: boolean;
onSeek: () => void;
}): JSX.Element {
}): React.JSX.Element {
const bufferGap = useModuleState(player, "bufferGap");
const currentTime = useModuleState(player, "currentTime");
const isContentLoaded = useModuleState(player, "isContentLoaded");
Expand Down Expand Up @@ -124,7 +124,7 @@ function ProgressBar({
);
}

let thumbnailElement: JSX.Element | null = null;
let thumbnailElement: React.JSX.Element | null = null;
if (thumbnailIsVisible) {
const xThumbnailPosition = tipPosition - toolTipOffset;
if (enableVideoThumbnails && imageTime !== null) {
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Settings({
tryRelyOnWorker: boolean;
updateTryRelyOnWorker: (tryRelyOnWorker: boolean) => void;
showOptions: boolean;
}): JSX.Element | null {
}): React.JSX.Element | null {
const {
videoResolutionLimit,
maxBufferAhead,
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/VolumeBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function VolumeBar({
player, // current volume percentage
}: {
player: IPlayerModule;
}): JSX.Element {
}): React.JSX.Element {
const { volume, muted } = useModuleState(player, "volumeInfo");
const elementRef = React.useRef<HTMLDivElement>(null);

Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/charts/BufferSize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const NUMBER_GRID_LINES_HEIGHT = 10;
* @param {Object} props
* @returns {Object}
*/
function BufferSizeChart({ module }: { module: IChartModule }): JSX.Element {
function BufferSizeChart({ module }: { module: IChartModule }): React.JSX.Element {
const data = useModuleState(module, "data");
const canvasEl = useRef<HTMLCanvasElement>(null);
const canvasCtx = useRef<CanvasRenderingContext2D | null>(null);
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/knobs/AudioRepresentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function AudioRepresentationKnob({
}: {
player: IPlayerModule;
className?: string;
}): JSX.Element {
}): React.JSX.Element {
const isAudioRepresentationLocked = useModuleState(
player,
"audioRepresentationsLocked",
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/knobs/AudioTrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function AudioTrackKnob({
}: {
player: IPlayerModule;
className?: string | undefined;
}): JSX.Element {
}): React.JSX.Element {
const currentAudioTrack = useModuleState(player, "audioTrack");
const availableAudioTracks = useModuleState(player, "availableAudioTracks");

Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/knobs/SpeedKnob.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function SpeedKnob({
}: {
player: IPlayerModule;
className?: string;
}): JSX.Element {
}): React.JSX.Element {
const playbackRate = useModuleState(player, "playbackRate");
let selectedIndex = AVAILABLE_RATES.findIndex((rate) => playbackRate === rate);

Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/knobs/Subtitles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function SubtitlesKnob({
}: {
player: IPlayerModule;
className?: string | undefined;
}): JSX.Element {
}): React.JSX.Element {
const currentSubtitle = useModuleState(player, "subtitle");
const availableSubtitles = useModuleState(player, "availableSubtitles");

Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/knobs/VideoRepresentation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function VideoRepresentationKnob({
}: {
player: IPlayerModule;
className?: string;
}): JSX.Element {
}): React.JSX.Element {
const isVideoRepresentationLocked = useModuleState(
player,
"videoRepresentationsLocked",
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/controllers/knobs/VideoTrack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function VideoTrackKnob({
}: {
player: IPlayerModule;
className?: string;
}): JSX.Element {
}): React.JSX.Element {
const currentVideoTrack = useModuleState(player, "videoTrack");
const availableVideoTracks = useModuleState(player, "availableVideoTracks");
const [options, selectedIndex]: [string[], number] = React.useMemo(() => {
Expand Down

0 comments on commit 01da4ba

Please sign in to comment.