0

I am trying to use react-native-video in my app but when video plays, audio is not playing. Only video without audio is playing. (In Android, both video, audio is playing well. Only in iOS, audio is not playing)

I found a solution on github and tried it, but got a new error. How to fix this new error? Here is the link.

enter image description here

enter image description here

This is new error.

SatelBill
  • 641
  • 2
  • 12
  • 28

1 Answers1

2

In order to solve that compilation error, you'll need to add this to the top of the file you added the AVAudioSession code to:

@import AVFoundation;

OR (this is the one they show in the example):

#import <AVFoundation/AVFoundation.h>

(The first one doesn't require that you add the framework -- see @import vs #import - iOS 7)

Also, just wanted to make sure you had also tried this fix listed on the answer page you linked to:

<Video
    ...
    ignoreSilentSwitch="ignore"
/>
jnpdx
  • 45,847
  • 6
  • 64
  • 94