photo_manager_video_player 0.1.0
photo_manager_video_player: ^0.1.0 copied to clipboard
Play photo_manager AssetEntity videos with zero copies of the original — MediaStore content URIs on Android, PhotoKit AVPlayerItems on Darwin.
0.1.0 #
AssetEntityVideoController,AssetEntityVideoValue,AssetEntityVideoView: play aphoto_managerAssetEntityvideo without an app-managed copy or export of the original.- Android: MediaStore
content://URI → ExoPlayer, drawn into a Flutter texture throughTextureRegistry.SurfaceProducer. viewType: AssetEntityVideoViewType.platformViewshows the video in a platform view instead — aSurfaceViewon Android, anAVPlayerLayeron iOS — so HDR video keeps the system's HDR handling. The default staystextureView.- iOS:
PHImageManager.requestPlayerItem→AVPlayer, drawn into a Flutter texture throughAVPlayerItemVideoOutput. - Pauses in the background and resumes on return; a
play()that would start in the background starts on return instead.dispose()completes once the platform player is released, even while it is being created. iOS raises an ambient audio session to.playbackon the first player. - Flutter 3.29 or later; Swift Package Manager builds need Flutter 3.44.
AssetEntityVideoController(startPosition:): Android prepares the player at that position, so the first rendered frame is the one there instead of frame- The
initializedevent now also reports the start position.
- The
AssetEntityVideoFrames.mediaStoreThumbnailPosition: Android 8.1+ returns the position of the frame the MediaStore system thumbnail shows, or null, so a grid can hand that thumbnail over to playback without a jump.AssetEntityVideoFrames.extract: JPEG stills at a list of times, read in place —AVAssetImageGeneratoron iOS,MediaMetadataRetrieveron Android.