native_cache_video_player 0.1.12
native_cache_video_player: ^0.1.12 copied to clipboard
High-performance Flutter video player with native caching for Android and iOS.
0.1.12 #
- Fix: Thread-safe event dispatch — all
eventSinkcalls now dispatch to main thread with try-catch on both Android and iOS, preventing crashes from background thread callbacks. - Fix: Eliminated
LegacyMessageQueue"dead thread" warnings on Android by reordering dispose sequence (remove listeners → pause → clear surface → stop → release). - Fix: Prevented audio focus interruptions — disabled
handleAudioFocuson Android and setmixWithOtherson iOS so playback is never paused by other apps. - Fix: Broke
CADisplayLinkretain cycle on iOS using weakDisplayLinkProxypattern. - Fix: Cache TTL support — added
maxCacheAgeconfig to expire old cached videos. - Fix: In-flight download deduplication to prevent double-fetching the same URL.
- Fix: Metadata (
.meta) files now cleaned up alongside cached video files on iOS. - Fix: Used ephemeral
URLSessionon iOS to avoid system HTTP cache conflicts. - Perf: Prioritized visible video initialization over adjacent preloads in example TikTok page.
- Chore: Removed CocoaPods integration from example app — now fully Swift Package Manager.
0.1.11 #
- Chore: Migrated Android to Built-in Kotlin support and restructured iOS Swift implementation.
0.1.9 #
- Fix: Reduced aggressiveness of native memory purge (now keeps up to 2 inactive players alive instead of killing all paused players).
- Fix: Plugin methods (like
play) now return{"wasDisposed": true}instead of silently succeeding when called on a player that was already evicted by the memory manager. This allows the Dart side (isDisposed()) to correctly detect when a player was killed by memory pressure.
0.1.8 #
- Fix: Resolve video appearing as black on slower devices where ExoPlayer's
STATE_READY(Android) orreadyToPlay(iOS) fires before the video decoder reports the actual frame dimensions. Theinitializedevent now re-sends with correct width/height when the native size callback arrives after a 0×0 initialization.
0.1.7 #
- Fix: Resolve
MissingPluginExceptionwhen disposing video players by correctly unregistering theEventChannelstream handler with the texture ID on both Android and iOS.
0.1.6 #
- Chore: Bumped
video_playerdependency to^2.11.1.
0.1.5 #
- Fix: Resolved issue where
setMixWithOtherswas not propagated to existing player instances on Android and iOS. This ensures that audio focus settings are applied immediately to all active players.
0.1.4 #
- Fix: Resolved
java.lang.OutOfMemoryErroron Android by properly unregistering theEventChannelstream handler whenFLTVideoPlayeris disposed, allowing nativeExoPlayerinstances to be garbage collected.
0.1.2 #
- New Feature: Added
isDisposed()method toNativeCacheVideoPlayerto allow checking if the underlying native player has been evicted due to memory pressure or LRU cache limits. - Fix: Suppress
positionwarnings when a player is already natively disposed.
0.1.1 #
0.1.0 #
- Initial release of
native_cache_video_player. - Core Features:
- Simultaneous video download and caching.
- LRU (Least Recently Used) cache management.
- Background thread processing for cache operations.
- Android: Implementation using Media3/ExoPlayer with
CacheDataSource. - iOS: Implementation using AVFoundation with
AVAssetResourceLoaderDelegate.