@lazycatcloud/vue-media-preview 0.1.4 → 0.1.5
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/components/video/VideoControls.vue.d.ts +3 -0
- package/dist/components/video/VideoQualityMenu.vue.d.ts +17 -0
- package/dist/core/video/captureVideoFrame.d.ts +3 -1
- package/dist/core/video/frameTransition.d.ts +8 -0
- package/dist/core/video/source/types.d.ts +19 -1
- package/dist/index.d.ts +1 -0
- package/dist/vue-media-preview.cjs +2 -2
- package/dist/vue-media-preview.css +1 -1
- package/dist/vue-media-preview.js +1227 -1056
- package/docs/vue-media-preview.md +11 -1
- package/package.json +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { VideoQualityState } from "../../core/video/source/types";
|
|
1
2
|
import type { useVideoPlayback } from "../../core/video/useVideoPlayback";
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
playback: ReturnType<typeof useVideoPlayback>;
|
|
4
5
|
fullscreen: boolean;
|
|
5
6
|
canFullscreen: boolean;
|
|
7
|
+
quality: VideoQualityState;
|
|
8
|
+
visible: boolean;
|
|
6
9
|
};
|
|
7
10
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
11
|
fullscreen: () => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { VideoQualityState } from "../../core/video/source/types";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
quality: Exclude<VideoQualityState, {
|
|
4
|
+
kind: "unavailable";
|
|
5
|
+
}>;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}, {}>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_TypePropsToOption<T> = {
|
|
11
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
12
|
+
type: import('vue').PropType<Required<T>[K]>;
|
|
13
|
+
} : {
|
|
14
|
+
type: import('vue').PropType<T[K]>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { PreviewSize } from "../types";
|
|
2
|
-
/**
|
|
2
|
+
/** Copy object-fit:contain pixels without changing playback. */
|
|
3
|
+
export declare function drawVideoFrame(video: HTMLVideoElement, canvas: HTMLCanvasElement, size: PreviewSize): void;
|
|
4
|
+
/** Snapshot before pausing for the preview's closing transition. */
|
|
3
5
|
export declare function captureVideoFrame(video: HTMLVideoElement, size: PreviewSize): HTMLCanvasElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PreviewSize } from "../types";
|
|
2
|
+
/** Keep the last visible frame across source replacement, without pausing playback. */
|
|
3
|
+
export declare function createVideoFrameTransition(video: () => HTMLVideoElement, canvas: () => HTMLCanvasElement, size: () => PreviewSize): {
|
|
4
|
+
active: import("vue").Ref<boolean>;
|
|
5
|
+
run: (change: () => void) => void;
|
|
6
|
+
clear: () => void;
|
|
7
|
+
snapshot: () => HTMLCanvasElement;
|
|
8
|
+
};
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import type { PreviewMedia } from "../../types";
|
|
2
|
+
export interface VideoQualityOption {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
/** Empty activeId means that the selected quality option has not taken effect yet. */
|
|
7
|
+
export type VideoQualityState = {
|
|
8
|
+
kind: "unavailable";
|
|
9
|
+
} | {
|
|
10
|
+
kind: "fixed";
|
|
11
|
+
label: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "available";
|
|
14
|
+
options: readonly VideoQualityOption[];
|
|
15
|
+
selectedId: string;
|
|
16
|
+
activeId: string;
|
|
17
|
+
select: (id: string) => void;
|
|
18
|
+
};
|
|
2
19
|
/** Hosts own transport; the component owns playback and the effective timeline. */
|
|
3
|
-
export type VideoSourceLoader = (video: HTMLVideoElement, media: PreviewMedia, reportError: (error: Error) => void, reportDuration: (seconds: number) => void) => () => void;
|
|
20
|
+
export type VideoSourceLoader = (video: HTMLVideoElement, media: PreviewMedia, reportError: (error: Error) => void, reportDuration: (seconds: number) => void, reportQuality: (quality: VideoQualityState) => void) => () => void;
|
|
4
21
|
export interface VideoSourceObserver {
|
|
5
22
|
error: (error: Error) => void;
|
|
6
23
|
duration: (seconds: number) => void;
|
|
24
|
+
quality: (quality: VideoQualityState) => void;
|
|
7
25
|
reset: () => void;
|
|
8
26
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,3 +17,4 @@ export type { ImageResource } from "./core/resources/imageResource";
|
|
|
17
17
|
export type { TimelineGroup, VirtualTimelineHandle } from "./core/timeline/layout";
|
|
18
18
|
export { nativeVideoSource } from "./core/video/useVideoSource";
|
|
19
19
|
export type { VideoSourceLoader } from "./core/video/useVideoSource";
|
|
20
|
+
export type { VideoQualityOption, VideoQualityState } from "./core/video/source/types";
|