TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://docs.thewidlarzgroup.com/react-native-video/
MIT License
7.23k stars 2.9k forks source link

fix(ios): handle async player access in text track selection #4293

Closed tarikfp closed 2 days ago

tarikfp commented 6 days ago

Fix Potential Race Condition in Video Player Text Track Selection

Description

Potentially fixed a crash that happens when text tracks get selected while the player is being destroyed. Super hard to reproduce but shows up in crash logs. Basically the player exists when we start the async operation but might be gone by the time we try to use it.

Changes

Steps to Maybe Reproduce

Really hard to get this consistently, but here's what might trigger it:

  1. Switch videos really fast
  2. Change text tracks while video is loading
  3. Background the app during text track changes

Type of Change

Screenshots

ios-rctvideo-crash

Checklist