@zezosoft/react-player 0.0.5 → 0.0.7
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/VideoPlayer.d.ts +4 -40
- package/dist/VideoPlayer/_components/SubtitleOverlay.d.ts +7 -0
- package/dist/VideoPlayer/hooks/index.d.ts +7 -0
- package/dist/VideoPlayer/hooks/useEpisodes.d.ts +3 -0
- package/dist/VideoPlayer/hooks/useIntroSkip.d.ts +5 -0
- package/dist/VideoPlayer/hooks/useSubtitleStyling.d.ts +10 -0
- package/dist/VideoPlayer/hooks/useSubtitles.d.ts +2 -0
- package/dist/VideoPlayer/hooks/useVideoEvents.d.ts +10 -0
- package/dist/VideoPlayer/hooks/useVideoSource.d.ts +1 -0
- package/dist/VideoPlayer/hooks/useVideoTracking.d.ts +2 -0
- package/dist/VideoPlayer/types/VideoPlayerTypes.d.ts +49 -0
- package/dist/VideoPlayer/utils/index.d.ts +6 -6
- package/dist/components/ui/Popover.d.ts +2 -0
- package/dist/components/ui/Settings.d.ts +6 -0
- package/dist/components/ui/tooltip.d.ts +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +660 -252
- package/dist/store/VideoState.d.ts +1 -73
- package/dist/store/index.d.ts +3 -0
- package/dist/store/slices/episodesSlice.d.ts +5 -0
- package/dist/store/slices/index.d.ts +9 -0
- package/dist/store/slices/introSlice.d.ts +5 -0
- package/dist/store/slices/resetSlice.d.ts +5 -0
- package/dist/store/slices/subtitlesSlice.d.ts +5 -0
- package/dist/store/slices/videoControlsSlice.d.ts +5 -0
- package/dist/store/slices/videoPlaybackSlice.d.ts +5 -0
- package/dist/store/slices/videoQualitySlice.d.ts +5 -0
- package/dist/store/slices/videoRefsSlice.d.ts +5 -0
- package/dist/store/slices/videoTimingSlice.d.ts +5 -0
- package/dist/store/types/StoreTypes.d.ts +78 -0
- package/package.json +10 -8
|
@@ -1,42 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
|
|
6
|
-
trackSrc: string;
|
|
7
|
-
trackTitle?: string;
|
|
8
|
-
trackPoster?: string;
|
|
9
|
-
isTrailer?: boolean;
|
|
10
|
-
className?: string;
|
|
11
|
-
type?: "hls" | "mp4" | "other" | "youtube" | undefined;
|
|
12
|
-
width?: string;
|
|
13
|
-
height?: string;
|
|
14
|
-
onClose?: () => void;
|
|
15
|
-
timeCodes?: TimeCode[];
|
|
16
|
-
getPreviewScreenUrl?: (hoverTimeValue: number) => string;
|
|
17
|
-
tracking?: {
|
|
18
|
-
onViewed?: () => void;
|
|
19
|
-
onWatchTimeUpdated?: (e: IOnWatchTimeUpdated) => void;
|
|
20
|
-
};
|
|
21
|
-
subtitles?: {
|
|
22
|
-
lang: string;
|
|
23
|
-
label: string;
|
|
24
|
-
url: string;
|
|
25
|
-
}[];
|
|
26
|
-
episodeList?: {
|
|
27
|
-
id: number;
|
|
28
|
-
title: string;
|
|
29
|
-
url: string;
|
|
30
|
-
}[];
|
|
31
|
-
currentEpisodeIndex?: number;
|
|
32
|
-
intro?: {
|
|
33
|
-
start: number;
|
|
34
|
-
end: number;
|
|
35
|
-
};
|
|
36
|
-
nextEpisodeConfig?: {
|
|
37
|
-
showAtTime?: number;
|
|
38
|
-
showAtEnd?: boolean;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
declare const VideoPlayer: React.FC<Props>;
|
|
2
|
+
import { VideoPlayerProps } from "./types/VideoPlayerTypes";
|
|
3
|
+
import "../index.css";
|
|
4
|
+
import "./styles/subtitles.css";
|
|
5
|
+
declare const VideoPlayer: React.FC<VideoPlayerProps>;
|
|
42
6
|
export default VideoPlayer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { SubtitleStyleConfig } from "../hooks/useSubtitleStyling";
|
|
3
|
+
interface SubtitleOverlayProps {
|
|
4
|
+
styleConfig?: SubtitleStyleConfig;
|
|
5
|
+
}
|
|
6
|
+
declare const SubtitleOverlay: React.FC<SubtitleOverlayProps>;
|
|
7
|
+
export default SubtitleOverlay;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { useVideoSource } from "./useVideoSource";
|
|
2
|
+
export { useSubtitles } from "./useSubtitles";
|
|
3
|
+
export { useSubtitleStyling } from "./useSubtitleStyling";
|
|
4
|
+
export { useVideoTracking } from "./useVideoTracking";
|
|
5
|
+
export { useIntroSkip } from "./useIntroSkip";
|
|
6
|
+
export { useEpisodes } from "./useEpisodes";
|
|
7
|
+
export { useVideoEvents } from "./useVideoEvents";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SubtitleStyleConfig {
|
|
2
|
+
fontSize?: string;
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
textColor?: string;
|
|
5
|
+
position?: "top" | "center" | "bottom";
|
|
6
|
+
borderRadius?: string;
|
|
7
|
+
padding?: string;
|
|
8
|
+
maxWidth?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const useSubtitleStyling: (config?: SubtitleStyleConfig) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const useVideoEvents: () => {
|
|
2
|
+
onRightClick: (e: React.MouseEvent<HTMLVideoElement>) => void;
|
|
3
|
+
onSeeked: (e: React.SyntheticEvent<HTMLVideoElement>) => void;
|
|
4
|
+
onTimeUpdate: (e: React.SyntheticEvent<HTMLVideoElement>) => void;
|
|
5
|
+
onLoadedMetadata: (e: React.SyntheticEvent<HTMLVideoElement>) => void;
|
|
6
|
+
onProgress: (e: React.SyntheticEvent<HTMLVideoElement>) => void;
|
|
7
|
+
onPlay: () => void;
|
|
8
|
+
onPause: () => void;
|
|
9
|
+
onEnded: () => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useVideoSource: (trackSrc: string, type?: "hls" | "mp4" | "other" | "youtube" | undefined) => void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TimeCode } from "../_components/TimeLine/TimeLine";
|
|
2
|
+
import { IOnWatchTimeUpdated } from "../../types";
|
|
3
|
+
import { SubtitleStyleConfig } from "../hooks/useSubtitleStyling";
|
|
4
|
+
export interface VideoPlayerProps {
|
|
5
|
+
trackSrc: string;
|
|
6
|
+
trackTitle?: string;
|
|
7
|
+
trackPoster?: string;
|
|
8
|
+
isTrailer?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
type?: "hls" | "mp4" | "other" | "youtube" | undefined;
|
|
11
|
+
width?: string;
|
|
12
|
+
height?: string;
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
timeCodes?: TimeCode[];
|
|
15
|
+
getPreviewScreenUrl?: (hoverTimeValue: number) => string;
|
|
16
|
+
tracking?: {
|
|
17
|
+
onViewed?: () => void;
|
|
18
|
+
onWatchTimeUpdated?: (e: IOnWatchTimeUpdated) => void;
|
|
19
|
+
};
|
|
20
|
+
subtitles?: {
|
|
21
|
+
lang: string;
|
|
22
|
+
label: string;
|
|
23
|
+
url: string;
|
|
24
|
+
}[];
|
|
25
|
+
episodeList?: {
|
|
26
|
+
id: number;
|
|
27
|
+
title: string;
|
|
28
|
+
url: string;
|
|
29
|
+
}[];
|
|
30
|
+
currentEpisodeIndex?: number;
|
|
31
|
+
intro?: {
|
|
32
|
+
start: number;
|
|
33
|
+
end: number;
|
|
34
|
+
};
|
|
35
|
+
nextEpisodeConfig?: {
|
|
36
|
+
showAtTime?: number;
|
|
37
|
+
showAtEnd?: boolean;
|
|
38
|
+
};
|
|
39
|
+
subtitleStyle?: SubtitleStyleConfig;
|
|
40
|
+
}
|
|
41
|
+
export type { SubtitleTrack, Episode } from "../../store/types/StoreTypes";
|
|
42
|
+
export interface IntroConfig {
|
|
43
|
+
start: number;
|
|
44
|
+
end: number;
|
|
45
|
+
}
|
|
46
|
+
export interface NextEpisodeConfig {
|
|
47
|
+
showAtTime?: number;
|
|
48
|
+
showAtEnd?: boolean;
|
|
49
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @description
|
|
2
|
+
* @description
|
|
3
3
|
* @param seconds
|
|
4
4
|
* @returns
|
|
5
5
|
*/
|
|
6
6
|
export declare const timeFormat: (seconds: number) => string;
|
|
7
7
|
/**
|
|
8
|
-
* @description
|
|
8
|
+
* @description
|
|
9
9
|
* @param seconds
|
|
10
10
|
*/
|
|
11
11
|
export declare const timeFormatForContent: (seconds: number) => string;
|
|
12
12
|
/**
|
|
13
|
-
* @description
|
|
13
|
+
* @description
|
|
14
14
|
* @param seconds
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
export declare const secondsToMilliseconds: (seconds: number) => number;
|
|
18
18
|
/**
|
|
19
|
-
* @description
|
|
19
|
+
* @description
|
|
20
20
|
* @param milliseconds
|
|
21
21
|
* @returns
|
|
22
22
|
*/
|
|
23
23
|
export declare const millisecondsToSeconds: (milliseconds: number) => number;
|
|
24
24
|
/**
|
|
25
|
-
* @description
|
|
25
|
+
* @description
|
|
26
26
|
* @param url
|
|
27
|
-
* @returns
|
|
27
|
+
* @returns
|
|
28
28
|
*/
|
|
29
29
|
export declare const getExtensionFromUrl: (url: string) => string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
2
|
export { default as VideoPlayer } from "./VideoPlayer/VideoPlayer";
|
|
3
3
|
export { useVideoStore } from "./store/VideoState";
|
|
4
|
+
export type { VideoPlayerProps, Episode, SubtitleTrack, IntroConfig, NextEpisodeConfig, } from "./VideoPlayer/types/VideoPlayerTypes";
|
|
5
|
+
export type { SubtitleStyleConfig } from "./VideoPlayer/hooks/useSubtitleStyling";
|
|
6
|
+
export type { VideoState, VideoRefsState, VideoPlaybackState, VideoTimingState, VideoControlsState, VideoQualityState, SubtitlesState, EpisodesState, IntroState, } from "./store/types/StoreTypes";
|