Skip to content

Player API: PlayerTarget & Features #366

@mihar-22

Description

@mihar-22

Update core/dom features to use PlayerTarget pattern with availability states.

Ref #320

Scope

Component Description
PlayerTarget type { media: Media, container: MediaContainer | null }
FeatureAvailability 'available' | 'unavailable' | 'unsupported'
Update features All features use PlayerTarget instead of HTMLMediaElement
Volume availability Add volumeAvailability state with iOS Safari check
Feature bundles video and audio feature arrays
Pre-built selectors selectPlayback, selectVolume, selectTime, selectSource, selectBuffer

Key Types

interface PlayerTarget {
  media: Media;
  container: MediaContainer | null;
}

type FeatureAvailability = 'available' | 'unavailable' | 'unsupported';

Files

  • packages/core/src/dom/types.ts (new)
  • packages/core/src/dom/store/features/playback.ts
  • packages/core/src/dom/store/features/volume.ts
  • packages/core/src/dom/store/features/time.ts
  • packages/core/src/dom/store/features/source.ts
  • packages/core/src/dom/store/features/buffer.ts
  • packages/core/src/dom/store/features/bundles.ts (new)
  • packages/core/src/dom/store/selectors.ts (new)
  • Tests for all above

Acceptance Criteria

  • PlayerTarget and FeatureAvailability types exported from @videojs/core/dom
  • All features updated to use target.media instead of target
  • Volume feature exposes volumeAvailability state
  • features.video and features.audio bundles exported
  • Pre-built selectors exported: selectPlayback, selectVolume, etc.
  • All tests pass

SP: 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions