Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video doesn't stop on most of iPhone/iOS versions when AR scene is unmounted causing memory leaks #286

Open
Buthrakaur opened this issue Apr 4, 2024 · 1 comment

Comments

@Buthrakaur
Copy link

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: iOS 15, 16
  3. Version: ViroReact version 2.23.1 and React Native version 0.71.3
  4. Device(s): iPhone SE iOS 15.x, iPhone 8, iOS 16.5.1

Description

Video playback doesn't stop when AR scene is unmounted and the audio keeps playing after the scene is unmounted causing memory leak of AVPlayer instance. We tried to resolve this by pausing the playback when on AR scene unmount but it doesn't prevent memory leak of the AVPlayer instance. We tried this on multiple iPhones with mixed results:

  • iPhone SE, iOS 15.x - video NOT stopping
  • iPhone 12 pro - video stops correctly
  • iPhone 8, iOS 16.5.1 - video stops when markerless triggering used but not stopping with a marker-based placement

Reproducible Demo

Just use a simple AR scene with ViroVideo component opened from a screen in the app.

    <ViroARScene onCameraTransformUpdate={onCameraTransformUpdate} onTrackingUpdated={onInitialized}>
       <ViroVideo
            position={offsetPosition}
            loop={feature.loop}
            rotation={objectRotation}
            width={feature.size.width}
            height={feature.size.height}
            source={feature.source}
            onBufferEnd={onLoadEnded}
            onError={onLoadFailed}
          />
    </ViroARScene>

issue in the old repo: viromedia/viro#1005

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

No branches or pull requests

1 participant