import type { HybridObject } from 'react-native-nitro-modules'; import type { MediaItemConfig, MediaType, DrmType } from './types.nitro'; /** * MediaItem is a stateless descriptor of media content. * It wraps native state (AVAsset on iOS, Media3 MediaItem on Android) * but is immutable after creation. * * HybridObject so it can be passed by reference between * PlaybackEngine and other consumers without serialization. */ export interface MediaItem extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> { readonly uri: string; /** * Media type classification. Determines adapter behavior * (audio-only rendering, video surface, live buffering strategy). * Undefined when not explicitly set — adapters infer from content. */ readonly mediaType: MediaType | undefined; readonly mimeType: string | undefined; readonly title: string | undefined; readonly artist: string | undefined; readonly album: string | undefined; readonly artworkUri: string | undefined; readonly durationMs: number; readonly hasDrm: boolean; readonly drmType: DrmType | undefined; } /** * Factory for creating MediaItem instances. * Autolinked — default-constructible. */ export interface MediaItemFactory extends HybridObject<{ ios: 'swift'; android: 'kotlin' }> { create(config: MediaItemConfig): MediaItem; fromUri(uri: string): MediaItem; }