v-pip
Version:
Vue wrapper for native picture-in-picture (PiP)
99 lines (98 loc) • 2.74 kB
TypeScript
import { PropType } from 'vue';
import type { ButtonHTMLAttributes } from 'vue';
declare global {
interface HTMLVideoElement {
requestPictureInPicture(): Promise<PictureInPictureWindow>;
}
interface Document {
readonly pictureInPictureElement: Element | null;
exitPictureInPicture(): Promise<void>;
}
}
type VideoOptionsProps = {
wrapper: string;
src: string;
poster: string;
class: string;
height: string;
width: string;
};
type ButtonOptionsProps = {
wrapper: string;
type?: ButtonHTMLAttributes['type'];
class: string;
label: string;
};
type State = {
isPipSupported: boolean;
video: null | HTMLVideoElement;
};
declare const _default: import("vue").DefineComponent<{
videoOptions: {
type: PropType<VideoOptionsProps>;
required: false;
default: () => {
wrapper: string;
src: string;
poster: string;
class: string;
height: string;
width: string;
};
};
buttonOptions: {
type: PropType<ButtonOptionsProps>;
required: false;
default: () => {
wrapper: string;
type: string;
class: string;
label: string;
};
};
wrapper: {
type: PropType<string>;
default: string;
required: false;
};
}, {
state: State;
togglePip: () => void;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("video-in-pip" | "requesting-pip-failure" | "exiting-pip-failure")[], "video-in-pip" | "requesting-pip-failure" | "exiting-pip-failure", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
videoOptions: {
type: PropType<VideoOptionsProps>;
required: false;
default: () => {
wrapper: string;
src: string;
poster: string;
class: string;
height: string;
width: string;
};
};
buttonOptions: {
type: PropType<ButtonOptionsProps>;
required: false;
default: () => {
wrapper: string;
type: string;
class: string;
label: string;
};
};
wrapper: {
type: PropType<string>;
default: string;
required: false;
};
}>> & {
"onVideo-in-pip"?: ((...args: any[]) => any) | undefined;
"onRequesting-pip-failure"?: ((...args: any[]) => any) | undefined;
"onExiting-pip-failure"?: ((...args: any[]) => any) | undefined;
}, {
videoOptions: VideoOptionsProps;
buttonOptions: ButtonOptionsProps;
wrapper: string;
}, {}>;
export default _default;