ISBX / apprtc-ios

A native iOS video chat app based on WebRTC
BSD 3-Clause "New" or "Revised" License
1.35k stars 413 forks source link

Value of type 'RTCEAGLVideoView' has no member 'renderFrame' #93

Open MathiasBojda opened 7 years ago

MathiasBojda commented 7 years ago

Hi there.

So i have your Libs and code working and building in a Swift Project, much thanks. However the Swift equivalent of:

[self.localView renderFrame: nil]

dosen't seem to work.

self.localView.renderFrame(nil);

I get the following error in xcode:

Value of type 'RTCEAGLVideoView' has no member 'renderFrame'

This is basically the lines of code i have, involving self.localView:

@IBOutlet var localView: RTCEAGLVideoView!
override func viewDidLoad() {
  self.localView.delegate = self;
}
func appClient(_ client: ARDAppClient!, didReceiveLocalVideoTrack localVideoTrack: RTCVideoTrack!) {

        if (( self.localVideoTrack ) != nil) {
            self.localVideoTrack.remove(self.localView);
            self.localVideoTrack = nil;
            self.localView.renderFrame(nil);
        }

        self.localVideoTrack = localVideoTrack;
        self.localVideoTrack.add(self.localView);
    }
bicep commented 6 years ago

Hi! I'm facing the same issue right now. Did you find a solution in the end?

ReiKyou08 commented 6 years ago

Me too, is there any solution at this moment?

MathiasBojda commented 6 years ago

@ReiKyou08 @bicep I'm not sure how i fixed it, since it's a long time ago now - But i did fix it.

This is my code, copy pasted.

self.localVideoTrack?.remove(self.localView!) self.localView?.renderFrame(nil) self.localVideoTrack=remoteVideoTrack self.localVideoTrack?.add(self.localView!)

MathiasBojda commented 6 years ago

@ReiKyou08 Looking at it a bit further: My final solution is a lot different than this repository. All my ARD libraries and RTC libraries is not installed with pod, but included in the project and the different frameworks that they depend on included as well. And most of those libraries i actually use in the project is included in a bridging header.

So i think you might want to find some other way around it, than this repo. Find a Objective C repo that don't use pods and see how they do it. Then use bridging headers to get what you need into Swift.

Nightmare0829 commented 6 years ago

oh thanks , I use pod indeed, I will try not to use pod and figure out what's going on.

faiare commented 6 years ago

I solved this issue by adding "RTCI420Frame.h" to the bridging header.

#import <libjingle_peerconnection/RTCEAGLVideoView.h>
#import <libjingle_peerconnection/RTCI420Frame.h>