feat: release v0.0.1
This commit is contained in:
7
dist/react/video-player/components/with-loader/index.d.ts
vendored
Normal file
7
dist/react/video-player/components/with-loader/index.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { IWithLazyVideoPlayerProps } from "../with-lazy";
|
||||
export interface IWithLoadingVideoPlayerProps extends IWithLazyVideoPlayerProps {
|
||||
withLoading?: boolean;
|
||||
}
|
||||
declare const WithLoading: ({ withLoading, onReady, children, ...props }: IWithLoadingVideoPlayerProps) => import("react/jsx-runtime").JSX.Element;
|
||||
export default WithLoading;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
dist/react/video-player/components/with-loader/index.d.ts.map
vendored
Normal file
1
dist/react/video-player/components/with-loader/index.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/video-player/components/with-loader/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAGzD,MAAM,WAAW,4BAChB,SAAQ,yBAAyB;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,GAAI,8CAKlB,4BAA4B,4CAsB9B,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
||||
23
dist/react/video-player/components/with-loader/index.js
vendored
Normal file
23
dist/react/video-player/components/with-loader/index.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import React, { useCallback, useState } from "react";
|
||||
import PlayerExtension from "../player-extension";
|
||||
import ContentSkeleton from "../../shared/ui/content-skeleton";
|
||||
import styles from "./with-loader.module.scss";
|
||||
const WithLoading = ({ withLoading = false, onReady, children, ...props }) => {
|
||||
const [loading, setIsLoading] = useState(withLoading);
|
||||
const handlePlayer = useCallback((player) => {
|
||||
player.on("loadedmetadata", () => {
|
||||
setIsLoading(false);
|
||||
});
|
||||
player.on("error", () => {
|
||||
setIsLoading(false);
|
||||
});
|
||||
player.on("dispose", () => {
|
||||
setIsLoading(true);
|
||||
});
|
||||
onReady && onReady(player);
|
||||
}, []);
|
||||
return (_jsxs(PlayerExtension, { className: props.className, children: [withLoading && loading && _jsx(ContentSkeleton, { className: styles.loading }), React.cloneElement(children, { ...props, onReady: handlePlayer })] }));
|
||||
};
|
||||
export default WithLoading;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
dist/react/video-player/components/with-loader/index.js.map
vendored
Normal file
1
dist/react/video-player/components/with-loader/index.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/react/video-player/components/with-loader/index.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAIrD,OAAO,eAAe,MAAM,qBAAqB,CAAC;AAClD,OAAO,eAAe,MAAM,kCAAkC,CAAC;AAG/D,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAO/C,MAAM,WAAW,GAAG,CAAC,EACpB,WAAW,GAAG,KAAK,EACnB,OAAO,EACP,QAAQ,EACR,GAAG,KAAK,EACsB,EAAE,EAAE;IAClC,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEtD,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,MAAqB,EAAE,EAAE;QAC1D,MAAM,CAAC,EAAE,CAAC,gBAAgB,EAAE,GAAG,EAAE;YAChC,YAAY,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACvB,YAAY,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;YACzB,YAAY,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACN,MAAC,eAAe,IAAC,SAAS,EAAE,KAAK,CAAC,SAAS,aACzC,WAAW,IAAI,OAAO,IAAI,KAAC,eAAe,IAAC,SAAS,EAAE,MAAM,CAAC,OAAO,GAAI,EACxE,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,IACjD,CAClB,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
||||
11
dist/react/video-player/components/with-loader/with-loader.module.scss
vendored
Normal file
11
dist/react/video-player/components/with-loader/with-loader.module.scss
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
.loading {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
object-position: center;
|
||||
z-index: 3;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
Reference in New Issue
Block a user