Add initial project structure with Docker setup, SOLID principles, and video player implementation
- Created .gitignore to exclude logs and build artifacts. - Added Dockerfile and docker-compose.yml for containerized deployment. - Implemented a video player following SOLID principles with classes for video source, audio control, and volume meter. - Introduced interfaces for audio, video source, and volume meter to ensure adherence to Interface Segregation Principle. - Developed main entry point and HTML structure for the video player application. - Included TypeScript configuration and package.json for project dependencies.
This commit is contained in:
42
src/interfaces/IVideoPlayer.ts
Normal file
42
src/interfaces/IVideoPlayer.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { IVideoSource } from './IVideoSource';
|
||||
import type { IVideoSeekController } from './IVideoSeekController';
|
||||
import type { IAudioController } from './IAudioController';
|
||||
import type { IVolumeMeter } from './IVolumeMeter';
|
||||
|
||||
/**
|
||||
* Main interface for video player
|
||||
* Follows Dependency Inversion Principle (DIP) - depends on abstractions
|
||||
*/
|
||||
export interface IVideoPlayer {
|
||||
/**
|
||||
* Initializes the video player with a stream URL
|
||||
* @param url - The URL of the video stream
|
||||
*/
|
||||
initialize(url: string): void;
|
||||
|
||||
/**
|
||||
* Gets the video source controller
|
||||
*/
|
||||
getVideoSource(): IVideoSource;
|
||||
|
||||
/**
|
||||
* Gets the seek controller
|
||||
*/
|
||||
getSeekController(): IVideoSeekController;
|
||||
|
||||
/**
|
||||
* Gets the audio controller
|
||||
*/
|
||||
getAudioController(): IAudioController;
|
||||
|
||||
/**
|
||||
* Gets the volume meter
|
||||
*/
|
||||
getVolumeMeter(): IVolumeMeter;
|
||||
|
||||
/**
|
||||
* Gets the underlying video element
|
||||
*/
|
||||
getVideoElement(): HTMLVideoElement;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user