@zezosoft/react-player 0.0.10 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/VideoPlayer/components/controls/BottomControls.d.ts +4 -1
- package/dist/VideoPlayer/components/controls/MiddleControls.d.ts +7 -1
- package/dist/VideoPlayer/components/controls/VideoPlayerControls.d.ts +4 -1
- package/dist/VideoPlayer/components/time-line/TimeLine.d.ts +5 -0
- package/dist/VideoPlayer/components/time-line/components/HoverTimeWithPreview.d.ts +1 -0
- package/dist/VideoPlayer/components/time-line/components/TimeCodeItem.d.ts +3 -0
- package/dist/VideoPlayer/components/time-line/components/TimeCodes.d.ts +3 -0
- package/dist/VideoPlayer/hooks/index.d.ts +0 -1
- package/dist/VideoPlayer/hooks/useSubtitleStyling.d.ts +3 -0
- package/dist/VideoPlayer/hooks/useVideoSource.d.ts +1 -1
- package/dist/VideoPlayer/types/VideoPlayerTypes.d.ts +21 -1
- package/dist/VideoPlayer/utils/index.d.ts +0 -11
- package/dist/components/ui/LiveIndicator.d.ts +9 -0
- package/dist/components/ui/Settings.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +277 -229
- package/dist/store/types/StoreTypes.d.ts +2 -0
- package/package.json +6 -7
- package/dist/VideoPlayer/MediaControls/BottomControls.d.ts +0 -5
- package/dist/VideoPlayer/MediaControls/ControlsHeader.d.ts +0 -5
- package/dist/VideoPlayer/MediaControls/MiddleControls.d.ts +0 -3
- package/dist/VideoPlayer/MediaControls/VideoPlayerControls.d.ts +0 -4
- package/dist/VideoPlayer/_components/BottomControls.d.ts +0 -5
- package/dist/VideoPlayer/_components/ControlsHeader.d.ts +0 -5
- package/dist/VideoPlayer/_components/MiddleControls.d.ts +0 -3
- package/dist/VideoPlayer/_components/Overlay.d.ts +0 -4
- package/dist/VideoPlayer/_components/SubtitleOverlay.d.ts +0 -7
- package/dist/VideoPlayer/_components/TimeLine/TimeLine.d.ts +0 -20
- package/dist/VideoPlayer/_components/TimeLine/_components/hoverTimeWithPreview.d.ts +0 -16
- package/dist/VideoPlayer/_components/TimeLine/_components/thumb.d.ts +0 -9
- package/dist/VideoPlayer/_components/TimeLine/_components/timeCodeItem.d.ts +0 -21
- package/dist/VideoPlayer/_components/TimeLine/_components/timeCodes.d.ts +0 -15
- package/dist/VideoPlayer/_components/TimeLine/utils/getEndTimeByIndex.d.ts +0 -2
- package/dist/VideoPlayer/_components/TimeLine/utils/getHoverTimePosition.d.ts +0 -3
- package/dist/VideoPlayer/_components/TimeLine/utils/getPositionPercent.d.ts +0 -1
- package/dist/VideoPlayer/_components/TimeLine/utils/getTimeScale.d.ts +0 -1
- package/dist/VideoPlayer/_components/TimeLine/utils/isInRange.d.ts +0 -1
- package/dist/VideoPlayer/_components/TimeLine/utils/positionToMs.d.ts +0 -1
- package/dist/VideoPlayer/_components/TimeLine/utils/secondsToTime.d.ts +0 -6
- package/dist/VideoPlayer/_components/TimeLine/utils/timeToTimeString.d.ts +0 -1
- package/dist/VideoPlayer/_components/VideoPlayerControls.d.ts +0 -4
- package/dist/VideoPlayer/hooks/useNetworkSpeed.d.ts +0 -7
- /package/dist/components/ui/{tooltip.d.ts → Tooltip.d.ts} +0 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "../time-line/time-line.css";
|
|
3
3
|
import { IControlsBottomProps } from "../../../types";
|
|
4
|
-
|
|
4
|
+
interface BottomControlsProps extends IControlsBottomProps {
|
|
5
|
+
isLive?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const BottomControls: React.FC<BottomControlsProps>;
|
|
5
8
|
export default BottomControls;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import type { PlayPauseButtonConfig } from "../../types/VideoPlayerTypes";
|
|
3
|
+
interface MiddleControlsProps {
|
|
4
|
+
config?: {
|
|
5
|
+
playPauseButtonConfig?: PlayPauseButtonConfig;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
declare const MiddleControls: React.FC<MiddleControlsProps>;
|
|
3
9
|
export default MiddleControls;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { IPlayerConfig } from "../../../types";
|
|
3
|
-
|
|
3
|
+
interface VideoPlayerControlsProps extends IPlayerConfig {
|
|
4
|
+
isLive?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const VideoPlayerControls: React.FC<VideoPlayerControlsProps>;
|
|
4
7
|
export default VideoPlayerControls;
|
|
@@ -17,5 +17,10 @@ export interface TimeLineProps {
|
|
|
17
17
|
onChange: (time: number, offsetTime: number) => void;
|
|
18
18
|
getPreviewScreenUrl?: (hoverTimeValue: number) => string;
|
|
19
19
|
trackColor?: string;
|
|
20
|
+
bufferColor?: string;
|
|
21
|
+
hoverColor?: string;
|
|
22
|
+
thumbColor?: string;
|
|
23
|
+
trackBackgroundColor?: string;
|
|
24
|
+
isLive?: boolean;
|
|
20
25
|
}
|
|
21
26
|
export declare const VideoSeekSlider: React.FC<TimeLineProps>;
|
|
@@ -11,6 +11,7 @@ interface HoverTimeWithPreviewProps {
|
|
|
11
11
|
secondsPrefix?: string;
|
|
12
12
|
minutesPrefix?: string;
|
|
13
13
|
getPreviewScreenUrl?: (hoverTimeValue: number) => string;
|
|
14
|
+
isLive?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare const HoverTimeWithPreview: React.FC<HoverTimeWithPreviewProps>;
|
|
16
17
|
export {};
|
|
@@ -17,5 +17,8 @@ export interface TimeCodeItemProps {
|
|
|
17
17
|
onHover?: (label: string) => void;
|
|
18
18
|
withGap?: boolean;
|
|
19
19
|
trackColor?: string;
|
|
20
|
+
bufferColor?: string;
|
|
21
|
+
hoverColor?: string;
|
|
22
|
+
trackBackgroundColor?: string;
|
|
20
23
|
}
|
|
21
24
|
export declare const TimeCodeItem: React.FC<TimeCodeItemProps>;
|
|
@@ -11,5 +11,8 @@ export interface TimeCodesProps {
|
|
|
11
11
|
label: string;
|
|
12
12
|
setLabel: React.Dispatch<React.SetStateAction<string>>;
|
|
13
13
|
trackColor?: string;
|
|
14
|
+
bufferColor?: string;
|
|
15
|
+
hoverColor?: string;
|
|
16
|
+
trackBackgroundColor?: string;
|
|
14
17
|
}
|
|
15
18
|
export declare const TimeCodes: React.FC<TimeCodesProps>;
|
|
@@ -8,4 +8,3 @@ export { useVideoEvents } from "./useVideoEvents";
|
|
|
8
8
|
export { useAdManager } from "./useAdManager";
|
|
9
9
|
export { usePrimaryVideoLifecycle } from "./usePrimaryVideoLifecycle";
|
|
10
10
|
export { useVideoError } from "./useVideoError";
|
|
11
|
-
export { useNetworkSpeed } from "./useNetworkSpeed";
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
/** Returns true if value is a Tailwind background class (e.g. bg-red, bg-black, bg-transparent) ya CSS "transparent" */
|
|
2
|
+
export declare const isTailwindBackground: (value: unknown) => value is string;
|
|
1
3
|
export interface SubtitleStyleConfig {
|
|
2
4
|
fontSize?: string;
|
|
5
|
+
/** CSS value (rgba, hex, gradient) ya Tailwind class: bg-red, bg-black, bg-transparent, bg-amber-500/80, etc. */
|
|
3
6
|
backgroundColor?: string;
|
|
4
7
|
textColor?: string;
|
|
5
8
|
position?: "top" | "center" | "bottom";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useVideoSource: (trackSrc: string, type?: "hls" | "dash" | "mp4" | "other" | "youtube" | undefined) => void;
|
|
1
|
+
export declare const useVideoSource: (trackSrc: string, type?: "hls" | "dash" | "mp4" | "other" | "youtube" | undefined, isLive?: boolean) => void;
|
|
@@ -18,18 +18,38 @@ export interface VideoProps {
|
|
|
18
18
|
showControls?: boolean;
|
|
19
19
|
isMute?: boolean;
|
|
20
20
|
startFrom?: number;
|
|
21
|
+
isLive?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface VideoQualityConfig {
|
|
24
|
+
defaultQuality?: "auto" | string;
|
|
25
|
+
showInSettings?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface SeekBarConfig {
|
|
28
|
+
trackColor?: string;
|
|
29
|
+
bufferColor?: string;
|
|
30
|
+
hoverColor?: string;
|
|
31
|
+
thumbColor?: string;
|
|
32
|
+
trackBackgroundColor?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface PlayPauseButtonConfig {
|
|
35
|
+
backgroundColor?: string;
|
|
36
|
+
hoverBackgroundColor?: string;
|
|
37
|
+
borderRadius?: string;
|
|
38
|
+
padding?: string;
|
|
21
39
|
}
|
|
22
40
|
export interface StyleProps {
|
|
23
41
|
className?: string;
|
|
24
42
|
width?: string;
|
|
25
43
|
height?: string;
|
|
26
44
|
subtitleStyle?: SubtitleStyleConfig;
|
|
45
|
+
qualityConfig?: VideoQualityConfig;
|
|
46
|
+
seekBarConfig?: SeekBarConfig;
|
|
47
|
+
playPauseButtonConfig?: PlayPauseButtonConfig;
|
|
27
48
|
}
|
|
28
49
|
export interface EventProps {
|
|
29
50
|
onEnded?: (e: React.SyntheticEvent<HTMLVideoElement>) => void;
|
|
30
51
|
onError?: (e?: React.SyntheticEvent<HTMLVideoElement, Event>) => void;
|
|
31
52
|
onClose?: () => void;
|
|
32
|
-
/** Called when player closes with watch progress data for history tracking */
|
|
33
53
|
onWatchHistoryUpdate?: (data: WatchHistoryData) => void;
|
|
34
54
|
}
|
|
35
55
|
export interface FeatureProps {
|
|
@@ -4,23 +4,12 @@
|
|
|
4
4
|
* @returns
|
|
5
5
|
*/
|
|
6
6
|
export declare const timeFormat: (seconds: number) => string;
|
|
7
|
-
/**
|
|
8
|
-
* @description
|
|
9
|
-
* @param seconds
|
|
10
|
-
*/
|
|
11
|
-
export declare const timeFormatForContent: (seconds: number) => string;
|
|
12
7
|
/**
|
|
13
8
|
* @description
|
|
14
9
|
* @param seconds
|
|
15
10
|
* @returns
|
|
16
11
|
*/
|
|
17
12
|
export declare const secondsToMilliseconds: (seconds: number) => number;
|
|
18
|
-
/**
|
|
19
|
-
* @description
|
|
20
|
-
* @param milliseconds
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
export declare const millisecondsToSeconds: (milliseconds: number) => number;
|
|
24
13
|
/**
|
|
25
14
|
* @description
|
|
26
15
|
* @param url
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import type { VideoQualityConfig } from "../../VideoPlayer/types/VideoPlayerTypes";
|
|
2
3
|
interface SettingsProps {
|
|
3
4
|
iconClassName: string;
|
|
5
|
+
qualityConfig?: VideoQualityConfig;
|
|
4
6
|
}
|
|
5
7
|
declare const Settings: React.FC<SettingsProps>;
|
|
6
8
|
export default Settings;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export { default as VideoPlayer } from "./VideoPlayer/VideoPlayer";
|
|
|
3
3
|
export { useVideoStore } from "./store/VideoState";
|
|
4
4
|
export type { VideoPlayerProps, Episode, SubtitleTrack, IntroConfig, NextEpisodeConfig, WatchHistoryData, } from "./VideoPlayer/types/VideoPlayerTypes";
|
|
5
5
|
export type { SubtitleStyleConfig } from "./VideoPlayer/hooks/useSubtitleStyling";
|
|
6
|
+
export type { VideoQualityConfig, SeekBarConfig, PlayPauseButtonConfig, } from "./VideoPlayer/types/VideoPlayerTypes";
|
|
6
7
|
export type { VideoState, VideoRefsState, VideoPlaybackState, VideoTimingState, VideoControlsState, VideoQualityState, SubtitlesState, EpisodesState, IntroState, } from "./store/types/StoreTypes";
|