spectatr-player-sdk
Version:
A custom video player built with Stencil with Shaka Player integration
85 lines (84 loc) • 2.45 kB
TypeScript
import { EventEmitter } from '../../stencil-public-runtime';
import shaka from 'shaka-player';
import 'shaka-player/dist/controls.css';
import { Poll, Quiz, QuizQuestion, Statistics, TimelineEvent } from '../../types/videoPlayer';
export declare class VideoPlayer {
hostElement: HTMLElement;
videoId: string;
nextVideoId: string;
clientId: string;
userId: string;
baseUrl: string;
autoPlay: boolean;
captureReaction: boolean;
setVideoId: (id: string) => void;
tempVideoId: string;
src: string;
token: string;
isLive: boolean;
isDvrEnabled: boolean;
quizzes: Quiz;
polls: Poll[];
statistics: Statistics[];
scheduleTime: string;
showStartStream: boolean;
timelineEvents: TimelineEvent[];
videoTitle: string;
videoDescription: string;
createdAt: string;
isLiked: boolean;
isDisliked: boolean;
totalLikes: number;
totalViews: number;
poster: string;
isPlaying: boolean;
currentTime: number;
duration: number;
volume: number;
isMuted: boolean;
isFullscreen: boolean;
showControls: boolean;
showSettings: boolean;
showQuiz: boolean;
showPoll: boolean;
showStatistics: boolean;
showFullDescription: boolean;
currentQuiz: QuizQuestion | null;
currentPoll: Poll | null;
currentStatistics: Statistics | null;
qualities: any[];
currentQuality: number;
audioTracks: any[];
currentAudioTrack: number;
isLoading: boolean;
showMainSettings: boolean;
showQualityOptions: boolean;
showAudioOptions: boolean;
hasVideoStarted: boolean;
quizAnswered: {
quizQuestion: QuizQuestion;
answer: string[];
}[];
pollAnswered: {
poll: Poll;
answer: string[];
}[];
quizTriggered: EventEmitter<Quiz>;
pollTriggered: EventEmitter<Poll>;
playVideo: EventEmitter<void>;
pauseVideo: EventEmitter<void>;
videoCompleted: EventEmitter<void>;
videoError: EventEmitter<string>;
player: shaka.Player;
videoElement: HTMLVideoElement;
videoContainer: HTMLDivElement;
controlsTimeout: NodeJS.Timeout;
progressUpdateInterval: NodeJS.Timeout;
livePollingInterval: NodeJS.Timeout;
reactionPollingInterval: NodeJS.Timeout;
scheduleTimer: any;
componentDidLoad(): Promise<void>;
disconnectedCallback(): void;
handleVideoIdChange(newVideoId: string): void;
render(): any;
}