@zezosoft/react-player 0.0.5 → 0.0.6

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.
@@ -1,42 +1,6 @@
1
1
  import React from "react";
2
- import { TimeCode } from "./_components/TimeLine/TimeLine";
3
- import { IOnWatchTimeUpdated } from "../types";
2
+ import { VideoPlayerProps } from "./types/VideoPlayerTypes";
4
3
  import "../../src/index.css";
5
- export interface Props {
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>;
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,3 @@
1
+ import { Episode } from "../../store/types/StoreTypes";
2
+ import { NextEpisodeConfig } from "../types/VideoPlayerTypes";
3
+ export declare const useEpisodes: (episodeList?: Episode[], currentEpisodeIndex?: number, nextEpisodeConfig?: NextEpisodeConfig) => void;
@@ -0,0 +1,5 @@
1
+ import { IntroConfig } from "../types/VideoPlayerTypes";
2
+ export declare const useIntroSkip: (intro?: IntroConfig) => {
3
+ showSkipIntro: boolean;
4
+ handleSkipIntro: () => void;
5
+ };
@@ -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,2 @@
1
+ import { SubtitleTrack } from "../../store/types/StoreTypes";
2
+ export declare const useSubtitles: (subtitles?: SubtitleTrack[]) => void;
@@ -0,0 +1,6 @@
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
+ };
@@ -0,0 +1 @@
1
+ export declare const useVideoSource: (trackSrc: string, type?: "hls" | "mp4" | "other" | "youtube" | undefined) => void;
@@ -0,0 +1,2 @@
1
+ import { VideoPlayerProps } from "../types/VideoPlayerTypes";
2
+ export declare const useVideoTracking: (tracking?: VideoPlayerProps["tracking"], episodeList?: VideoPlayerProps["episodeList"], currentEpisodeIndex?: number, onClose?: () => void) => 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 Converts seconds to hh:mm:ss
2
+ * @description
3
3
  * @param seconds
4
4
  * @returns
5
5
  */
6
6
  export declare const timeFormat: (seconds: number) => string;
7
7
  /**
8
- * @description Converts seconds to hh:mm
8
+ * @description
9
9
  * @param seconds
10
10
  */
11
11
  export declare const timeFormatForContent: (seconds: number) => string;
12
12
  /**
13
- * @description Converts seconds to milliseconds
13
+ * @description
14
14
  * @param seconds
15
15
  * @returns
16
16
  */
17
17
  export declare const secondsToMilliseconds: (seconds: number) => number;
18
18
  /**
19
- * @description Converts milliseconds to seconds
19
+ * @description
20
20
  * @param milliseconds
21
21
  * @returns
22
22
  */
23
23
  export declare const millisecondsToSeconds: (milliseconds: number) => number;
24
24
  /**
25
- * @description get extension from url
25
+ * @description
26
26
  * @param url
27
- * @returns string | undefined
27
+ * @returns
28
28
  */
29
29
  export declare const getExtensionFromUrl: (url: string) => string | undefined;
@@ -3,6 +3,8 @@ interface PopoverProps {
3
3
  button: React.ReactNode;
4
4
  children: React.ReactNode;
5
5
  closeOnButtonClick?: boolean;
6
+ className?: string;
7
+ align?: "left" | "center" | "right";
6
8
  }
7
9
  declare const Popover: React.FC<PopoverProps>;
8
10
  export default Popover;
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ interface SettingsProps {
3
+ iconClassName: string;
4
+ }
5
+ declare const Settings: React.FC<SettingsProps>;
6
+ export default Settings;
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";