Skip to content

ayrtonsoftware/MeTuber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Architecture Overview

MeTuber is an iOS video streaming application with a clean, modular architecture. Here's the breakdown:

  1. Core Components:

    • PlayerVC: Main video player view controller that handles video playback
    • VideosVC: Grid view controller for displaying video thumbnails
    • VideoCell: Custom cell for displaying individual video thumbnails
    • VideoPlayerOverlayView: Custom overlay view for video player controls
  2. Data Management:

    • IVideoManager: Protocol defining video management interface
    • JsonVideoManager: Implementation that loads videos from JSON (lazy loading is implemented)
    • Video: Data model for video content
    • IDownloadManager: Protocol for handling downloads
    • DownloadManager: Implementation with serial download queue
  3. Dependency Injection:

    • Uses a custom DIContainer for dependency management
    • Services are registered in AppDelegate

Key Design Patterns

  1. Protocol-Oriented Programming:

    • Heavy use of protocols (IVideoManager, IDownloadManager) for abstraction
    • Enables easy swapping of implementations
  2. MVVM-like Architecture:

    • View Controllers handle UI logic
    • Managers handle business logic
    • Clear separation of concerns
  3. Observer Pattern:

    • Extensive use of KVO for player state management
    • Handles player status, rate, and item status changes
  4. Factory Pattern:

    • WindowService for creating view controllers for the scene
    • DIContainer for service instantiation

UI/UX Design

  1. Video Grid:

    • 3-column grid layout
    • Custom VideoCell with thumbnail and description
    • Smooth scrolling with cell reuse
  2. Video Player:

    • Custom overlay with gradient background
    • Progress slider
    • Description display
    • Gesture-based navigation (swipe up/down)
  3. Performance Optimizations:

    • Video preloading (3 videos ahead)
    • Serial download queue for thumbnails
    • Cell reuse in collection view

Technical Features

  1. Video Playback:

    • Uses AVPlayerViewController for robust video playback
    • Custom buffering strategy (30-second pre-buffer)
    • State management for play/pause
  2. Resource Management:

    • Efficient thumbnail loading
    • Memory management with weak references
    • Proper cleanup of observers
  3. Navigation:

    • Custom navigation system
    • Scene-based window management
    • Smooth transitions between views

Current Issues

  1. Dependency Injection Module:
    • There's a linter error indicating missing DependencyInjection module
    • This needs to be resolved for proper dependency management

Recommendations

  1. Error Handling:

    • Add more robust error handling for network failures
    • Implement retry mechanisms for failed downloads
  2. Caching:

    • Implement thumbnail caching
    • Add video caching for offline playback
  3. Testing:

    • Add unit tests for managers
    • Implement UI tests for critical flows
  4. Accessibility:

    • Add accessibility labels
    • Implement VoiceOver support

About

A simple video player

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages