Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: [RTCI420Frame nativeHandle] #234

Open
alexpell00 opened this issue Jul 9, 2017 · 0 comments
Open

iOS: [RTCI420Frame nativeHandle] #234

alexpell00 opened this issue Jul 9, 2017 · 0 comments

Comments

@alexpell00
Copy link

alexpell00 commented Jul 9, 2017

I am trying to create a local media stream in my iOS webRTC app. See code below

let localStream = pcFactory.mediaStream(withLabel: "ARDAMS")!

let audio = pcFactory.audioTrack(withID: "ARDAMSa0")
localStream.addAudioTrack(audio!)

var device: AVCaptureDevice?
for captureDevice in AVCaptureDevice.devices(withMediaType: AVMediaTypeVideo){
    if let captureDevice = captureDevice as? AVCaptureDevice{
        if captureDevice.position == AVCaptureDevicePosition.front{
            device = captureDevice
        }
    }
}

if let device = device{
    let capture = RTCVideoCapturer(deviceName: device.localizedName)
    let videoSource = pcFactory.videoSource(with: capture, constraints: nil)
    localVideoTrack = pcFactory.videoTrack(withID: "ARDAMSv0", source: videoSource)
    localStream.addVideoTrack(localVideoTrack)
}


self.peerConnection?.add(localStream)

localVideoTrack?.add(localVideoView)

Everything works, but when after I add the localVideoView to the localVideoTrack I get an error:

-[RTCI420Frame nativeHandle]: unrecognized selector sent to instance 0x170010620

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RTCI420Frame nativeHandle]: unrecognized selector sent to instance 0x170010620'

All of the code is running on the main thread and the app has the appropriate permissions and plist keys. When I walk through the code line by line using the debugger everything seems to be running correctly. This code was taken from the Obj-C AppRTC demo, it has just been converted to swift. I can't seem to find the difference between my swift project that crashes and the working AppRTC project. Any idea what I am doing wrong? I am testing on a 64 bit device. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant