jwplayer / jwplayer-react-native

MIT License
32 stars 9 forks source link

[BUG] onAudioTracks not working #65

Open fdobre opened 4 months ago

fdobre commented 4 months ago

Describe the bug

"@jwplayer/jwplayer-react-native": "^1.0.1",
"react-native": "0.72.14"

Android: All tracks show in the player menu but onAudioTracks is not firing at all iOS: All tracks show in the player menu but: onAudioTracks is fired and when getting the tracks it throws: [Error: There are no audio tracks]

            onAudioTracks={()=>{
              console.log('tracks ready now');
              videoPlayerRef?.current?.getAudioTracks().then((data)=>{
                console.log('===audio tracks are=== ', JSON.stringify(data, null, 2));
              })
            }}
 LOG  on audio track ready {"target": 7387}
 ERROR  [Error: There are no audio tracks]
 LOG  ===audio tracks are=== null

To Reproduce

  1. Use a video with multiple audio tracks.
  2. Add a listener as above for onAudioTracks
  3. Observe the logs

Expected behavior