expo / expo

An open-source framework for making universal native apps with React. Expo runs on Android, iOS, and the web.
https://docs.expo.dev
MIT License
34.21k stars 5.47k forks source link

[expo-av - iOS] HALPlugIn error for m3u8 stream - How can I troubleshoot? #25062

Closed chrisfong closed 9 months ago

chrisfong commented 1 year ago

Minimal reproducible example

https://snack.expo.dev/@cjfong425/aa3136

Summary

I'm using expo-av and am running into this error in my local environment when playing an m3u8 stream. If I play mp4 assets, it's fine.

[CoreAudio]             HALPlugIn.cpp:551    HALPlugIn::DeviceGetCurrentTime: got an error from the plug-in routine, Error:
1937010544 (stop)

The same code works on Snack, but not in my local environment. How can I troubleshoot this?

import { AVPlaybackStatusSuccess, ResizeMode, Video } from "expo-av";
import React from "react";
import { Button, StyleSheet, View } from "react-native";
import LOG from "../../../src/util/logger";

const logger = LOG.extend("/app/reels/test");

export default function ReelScreen() {
  const video = React.useRef(null);
  const [status, setStatus] = React.useState({ isPlaying: false });
  return (
    <View style={styles.container}>
      <Video
        ref={video}
        style={styles.video}
        source={{
          uri: 'https://content.jwplatform.com/manifests/yp34SRmf.m3u8',
        }}
        useNativeControls
        resizeMode={ResizeMode.CONTAIN}
        isLooping
        onPlaybackStatusUpdate={(status: AVPlaybackStatusSuccess) => setStatus(() => { return { isPlaying: status.isPlaying } })}
        onError={(err) => logger.error("Playback error", err)}

      />
      <View style={styles.buttons}>
        <Button
          title={status.isPlaying ? 'Pause' : 'Play'}
          onPress={() =>
            status.isPlaying
              ? video.current.pauseAsync()
              : video.current.playAsync()
          }
        />
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    backgroundColor: '#ecf0f1',
  },
  video: {
    alignSelf: 'center',
    width: 320,
    height: 200,
  },
  buttons: {
    flexDirection: 'row',
    justifyContent: 'center',
    alignItems: 'center',
  },
});

Environment

  expo-env-info 1.0.5 environment info:
    System:
      OS: macOS 13.5.1
      Shell: 5.9 - /bin/zsh
    Binaries:
      Node: 18.17.1 - /usr/local/bin/node
      Yarn: 1.22.19 - /usr/local/bin/yarn
      npm: 9.6.7 - /usr/local/bin/npm
    Managers:
      CocoaPods: 1.12.1 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    IDEs:
      Android Studio: 2022.3 AI-223.8836.35.2231.10406996
      Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild
    npmPackages:
      expo: ~49.0.7 => 49.0.11 
      react: 18.2.0 => 18.2.0 
      react-dom: 18.2.0 => 18.2.0 
      react-native: 0.72.4 => 0.72.4 
      react-native-web: ~0.19.6 => 0.19.9 
    npmGlobalPackages:
      expo-cli: 6.3.10
    Expo Workflow: bare
spagrhetti commented 1 year ago

I'm running into this exact error. Was this ever resolved?

chrisfong commented 1 year ago

I'm running into this exact error. Was this ever resolved?

I didn't figure this out. I switched away from HLS (m3u8) and am now using progressive download (mp4) assets to sidestep this issue for now.

spagrhetti commented 1 year ago

@chrisfong it seems like it was an xcode error for me, I updated to the most recent version (15.0.1) and now m3u8 videos are playing for me on iphone 15 emulator

github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 90 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] commented 9 months ago

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

watadarkstar commented 7 months ago

I'm getting the same error after upgrading to SDK 50