Skip to content

Expo video doesnt play when react-native-track-player is installed #2513

Description

@StenerNordnes

Describe the Bug
Expo video won't start playback when react-native-track-player@5.0.0-alpha0 is installed on Android. No JS errors shown, video stays paused.

Steps To Reproduce
Use the expo video example component and install react-native-track-player version 5.0.0-alpha0

  1. Create new Expo app
  2. npm install expo-video react-native-track-player@5.0.0-alpha0
  3. npx expo run:android
  4. Open the example screen using expo-video and press Play

Expected behavior
Video should start playing.

Actual behavior
Play button does nothing; video does not start. Removing react-native-track-player makes video play normally.

Code To Reproduce
Expo video example app

import { useEvent } from "expo";
import { useVideoPlayer, VideoView } from "expo-video";
import { StyleSheet, View, Button } from "react-native";

const videoSource =
  "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";

export default function VideoScreen() {
  const player = useVideoPlayer(videoSource, (player) => {
    player.loop = true;
    player.play();
  });

  const { isPlaying } = useEvent(player, "playingChange", {
    isPlaying: player.playing,
  });

  return (
    <View style={styles.contentContainer}>
      <VideoView style={styles.video} player={player} />
      <View style={styles.controlsContainer}>
        <Button
          title={isPlaying ? "Pause" : "Play"}
          onPress={() => {
            if (isPlaying) {
              player.pause();
            } else {
              player.play();
            }
          }}
        />
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  contentContainer: {
    flex: 1,
    padding: 10,
    alignItems: "center",
    justifyContent: "center",
    paddingHorizontal: 50,
  },
  video: {
    width: 350,
    height: 275,
  },
  controlsContainer: {
    padding: 10,
  },
});

Replicable on Example App?
Had trouble setting up the example app, but a default expo project with the expo video example component will replicate the issue on an Android Simulator.

When removing react-native-track-player, the video plays normally

Environment Info:

  • OS: Windows 11
  • Node: 23.4.0
  • npm: 11.4.2
  • Expo SDK: 53.0.22
  • react-native: 0.79.6
  • react-native-track-player: 5.0.0-alpha0
  • expo-video: 2.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions