Aargh. I have a category written in Objective-C that adds an equalizer to AVPlayer. I downloaded it from https://github.com/akhilcb/ACBAVPlayerExtension and dragged the relevant source files into my project. I'm sure the target memberships of them are correct.
The .H file for the ObjC category starts off like this:
My bridging header .H file definitely has the #import statements to include the category, and I know it's being used because if I put a syntax error in there as a test, I get an error.
I cannot get past this error in my code:
with these lines:
I tried using meteringEnabled and isMeteringEnabled with no success.
As an experiment, I added fooTest() to the category just to see if I can call it. I try to call it like this from Swift:
I keep getting an error "Value of type AVPlayer has no member fooTest which is nonsense. fooTest shows up in autocomplete.
Also, if I right-click on fooTest in the line that says self.player.foohTest(), and select Jump to Definition, I am taken to the .H file and the line where I added
- (void)fooTest;
The .H file for the ObjC category starts off like this:
Code Block @interface AVPlayer(ACBHelper) - (void)fooTest; @property (nonatomic, getter=isMeteringEnabled) BOOL meteringEnabled; /* turns level metering on or off. default is off. */
My bridging header .H file definitely has the #import statements to include the category, and I know it's being used because if I put a syntax error in there as a test, I get an error.
I cannot get past this error in my code:
Code Block "Value of type 'AVPlayer' has no member 'isMeteringEnabled"
with these lines:
Code Block self.player = AVPlayer(playerItem: playerItem) self.player.meteringEnabled = true
I tried using meteringEnabled and isMeteringEnabled with no success.
As an experiment, I added fooTest() to the category just to see if I can call it. I try to call it like this from Swift:
Code Block self.player.fooTest()
I keep getting an error "Value of type AVPlayer has no member fooTest which is nonsense. fooTest shows up in autocomplete.
Also, if I right-click on fooTest in the line that says self.player.foohTest(), and select Jump to Definition, I am taken to the .H file and the line where I added
- (void)fooTest;