parevo-interactive-video
Version:
Framework-agnostic interactive video library with quiz overlays for React, Vue, and vanilla JS
33 lines (32 loc) • 805 B
TypeScript
export interface QuizOption {
id: string;
text: string;
isCorrect: boolean;
}
export interface QuizQuestion {
id: string;
triggerTime: number;
question: string;
options: QuizOption[];
rewindTime: number;
}
export interface InteractiveVideoConfig {
questions: QuizQuestion[];
}
export interface InteractiveVideoProps {
src: string;
config: InteractiveVideoConfig;
className?: string;
width?: number;
height?: number;
autoplay?: boolean;
muted?: boolean;
controls?: boolean;
onQuestionAnswered?: (questionId: string, selectedOptionId: string, isCorrect: boolean) => void;
onVideoEnd?: () => void;
}
export interface QuizOverlayProps {
question: QuizQuestion;
onAnswer: (optionId: string) => void;
isVisible: boolean;
}