Skip to content

Migrate playback to native media-kit - #2017

Open
YeungKC wants to merge 10 commits into
mainfrom
feature/media-kit-playback
Open

Migrate playback to native media-kit#2017
YeungKC wants to merge 10 commits into
mainfrom
feature/media-kit-playback

Conversation

@YeungKC

@YeungKC YeungKC commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • replace video_player and OggOpusPlayer playback with native media-kit across video, audio, and voice-preview paths
  • keep OggOpusRecorder for recording and video_compress for send-side compression and thumbnails
  • add libmpv requirements for Linux CI/AppImage and document the native playback dependency
  • hide the video output until the first native frame to remove the startup black placeholder

Validation

  • flutter test
  • flutter analyze (only the existing info in lib/widgets/menu.dart)
  • flutter build macos --debug
  • launched the macOS debug app and verified hot reload

Notes

  • Windows/Linux file selection keeps its existing platform gate because video_compress supports Android, iOS, and macOS only.
  • Existing unrelated packaging and macOS project changes are not included in this PR.

@YeungKC
YeungKC force-pushed the feature/media-kit-playback branch from 1c73fa1 to 6365f09 Compare August 5, 2026 05:11
@cedricfung
cedricfung requested a balanced review from Copilot August 5, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates media playback to native media-kit while retaining existing recording and compression tooling.

Changes:

  • Replaces video, audio-message, and voice-preview playback implementations.
  • Adds native media-kit dependencies and plugin registration.
  • Bundles and documents Linux libmpv requirements.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
windows/flutter/generated_plugins.cmake Registers Windows media-kit plugins.
windows/flutter/generated_plugin_registrant.cc Initializes Windows plugins.
README.md Documents Linux playback dependencies.
pubspec.yaml Replaces video_player with media-kit.
pubspec.lock Locks new dependency graph.
macos/Flutter/GeneratedPluginRegistrant.swift Updates macOS plugin registration.
linux/flutter/generated_plugins.cmake Registers Linux media-kit plugins.
linux/flutter/generated_plugin_registrant.cc Initializes Linux plugins.
lib/widgets/message/item/video/video_preview_page.dart Migrates full-screen video playback.
lib/widgets/message/item/video/video_message.dart Uses the native preview on all platforms.
lib/widgets/message/item/video/progress_bar.dart Adapts progress rendering to media-kit state.
lib/widgets/message/item/video/media_kit_video_player.dart Adds the media-kit video adapter.
lib/utils/audio_message_player/ogg_opus_audio_player.dart Migrates audio-message playback.
lib/ui/home/chat/voice_recorder_state.dart Migrates recorded-voice previews.
lib/ui/home/chat/voice_recorder_bottom_bar.dart Imports media-kit for voice preview state.
lib/ui/home/chat/files_preview.dart Migrates outgoing video previews.
lib/main.dart Initializes media-kit at startup.
AppImageBuilder.yml Bundles x64 libmpv.
AppImageBuilder-arm64.yml Bundles arm64 libmpv.
.github/workflows/manual-build.yml Installs libmpv for manual builds.
.github/workflows/dart.yml Installs libmpv in CI.

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

player.stream.width.listen(_notify),
player.stream.height.listen(_notify),
]);
unawaited(_open(path, autoPlay: autoPlay, looping: looping, muted: muted));
Comment thread lib/utils/audio_message_player/ogg_opus_audio_player.dart Outdated
@crossle
crossle requested a review from boyan01 August 5, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants