Hysen Labs
Open-source project
cornejobarraza/expo-libvlc-player avatar
cornejobarraza

expo-libvlc-player

LibVLC Player for Expo

38 stars9 forksKotlinMIT
DEEP OPEN-SOURCE ANALYSIS

A LibVLC video player for Expo apps

Expo-libvlc-player wraps VLC's engine for React Native Expo projects with a config plugin and TV support.

Supported platforms and versions

expo-libvlc-player is a LibVLC based video player for Expo applications. The package is installed from npm with a single command, and it brings VLC's playback engine into a React Native project that uses the Expo toolchain. The README sets out the supported versions clearly. The Expo SDK must be 57 or newer, and React Native must be 0.86 or newer. On the device side, Android and Android TV require version 7 or newer, while iOS and Apple TV require 16.4 or newer. For projects that are not already using Expo's modules, the README notes that a bare React Native project must first have the expo package installed and configured before this library will work. That step is a common gotcha, since the player depends on Expo's native module system rather than plain React Native links. On Android there is no extra configuration beyond the install. On iOS the extra step is to run pod install after adding the package, because the native code needs to be pulled into the Xcode project. For television targets the build changes: you set the EXPO_TV environment variable and then run a clean prebuild, and the README shows the exact commands for that path. These version floors matter when deciding whether an existing app can adopt the player without first upgrading its SDK and React Native lines.

Configuration and the config plugin

The library can be configured through its built in config plugin, which is the recommended route for Expo projects that use config plugins. The README shows an app.json example where expo-libvlc-player is added to the plugins array with a set of options. Two configurable properties are documented. The first is localNetworkPermission, a string that sets the iOS NSLocalNetworkUsageDescription message, and it defaults to a generic prompt asking to access the local network. The second is supportsPictureInPicture, a boolean that turns on picture in picture for Android and iOS. When true, the plugin adds the Android supportsPictureInPicture property and the iOS audio background mode key, and when false it removes them. When the value is left undefined, the configuration is not modified at all. This matters for apps that cast or play in the background, since the PiP flag changes both the Android manifest and the iOS Info.plist. The README also shows a separate example that uses expo-build-properties to raise the Android compile and target SDK versions to 36, which some setups need to satisfy the native build. For the local network prompt, the module exposes a method to trigger the iOS alert on demand, which is useful when you want to request the permission at a specific moment rather than at launch.

Using the player in code

The basic player is created with a single component and a source string. The README shows importing LibVlcPlayerView from the package and passing a video URL to its source prop, using a public demo file as the example. That is enough to render a working player in an Expo screen. Beyond the component, the native module exposes a couple of helper methods. One triggers the local network privacy alert on iOS, which the README demonstrates by importing the module directly and awaiting triggerNetworkAlert. The other checks whether picture in picture is supported on the current device through isPictureInPictureSupported. These calls let an app adapt its interface to what the platform allows, such as hiding a PiP button when the device does not support it. The README points to an example app in the repository for additional usage, so a developer who wants to see the plugin options and the component together can run that sample. Because the player is built on LibVLC, it inherits VLC's broad format support rather than relying only on the platform media stack, which is the main reason to choose it over the built in Expo video component. The MIT license keeps it free to use in commercial Expo apps as long as the attribution terms are respected, and the Kotlin based native code handles the Android side of that engine.

Editorial conclusion

The library is published under the MIT license and is written in Kotlin.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes