Urgent.News

What's breaking now, across thousands of outlets.

Tech

Playing video on Flutter Linux desktop with media_kit

Video is the one media type in tonGues that cannot fail quietly. A photo that won't load falls back to an icon tile and most people never notice; a video that won't play looks like the whole app is broken. So when every video bubble on our Linux desktop build started showing "Video expired" — the label we reserve for a file the server no longer has — we knew something was off. Flutter Linux…

Video playback on the Flutter Linux desktop lacked a player component. When videos failed to play, the app incorrectly displayed "Video expired." The issue arose because the video_player plugin didn't have a Linux implementation, and media_kit wasn't integrated yet. The root cause was simple: VideoPlayerController.initialize() threw UnimplementedError on Linux as there was no backend to handle the video.

The streaming fallback also failed due to the same reason. The solution was to introduce VideoPlaybackController, an abstraction layer between the widget and the player. This controller, which extends ValueNotifier, offered a unified API for both the Linux and other platforms. By implementing MediaKitVideoController for Linux and PluginVideoController for others, the app could seamlessly switch between the two players.

The change required only a few adjustments – creating the appropriate controller based on the platform and rendering the view with buildView(). With this approach, media_kit was integrated without affecting other platforms, and the UI accurately represented the video playback status.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

A shared media gallery for chats and profiles

Open a friend's profile — or a group's info screen — and you can now browse every photo, video, document and link the two participants have exchanged.

  • Shared media gallery displays photos, videos, docs, links from chats
  • Scoped to specific conversation, either 1:1 or group chat
  • Read-only, excludes deleted messages and encrypted chats

I Built Interactive CLI Drills — Learners Quit at Prompt #3

I Built Interactive CLI Drills — Learners Quit at Prompt #3 I built what I wanted as a learner: interactive CLI drills in the browser. Type commands. Get feedback.

  • Learners abandoned interactive CLI drills at prompt #3
  • Reporter found difficulty curve too aggressive for prompt #3
  • Adjusted pacing by breaking concepts into smaller steps

Staying signed in on Linux when the keyring doesn't survive a reboot

We keep people signed in on desktop the same way we do on mobile: the session is an access/refresh token pair, and we would much rather store it in the operating system's secure store than in a…

  • Sessions on Linux stored as access/refresh token pairs in keyring.
  • Proof-gated fallback used instead of plaintext fallback for security.
  • Bug fixed by adding cross-boot proof with kernel boot identifier.

More from Tuesday 13 October →