How to display pjsip incoming video in iOS?

若如初见. 提交于 2019-12-25 16:44:40

问题


I'm working on a PJSIP-Swift project on iOS. I just compiled PJSIP with video settings to allow to use video.

I succeeded to send video to another device by using Pjsip.

Now I need to display the incoming stream on my iOS application. I put a View in my ViewController in the storyboard in order to display the incoming video in.

But my problem is I have no idea how to bind my view with the incoming video from PJSIP.

How to do that ? Thanks.

Edit : I think I understand better the problem and now I think I have to use a pointer in my objective C code where I manipulate pjsip functions. This pointer would refer to an UIView in a swift file that is a ViewController. I posted a new topic to be more accurate in my question : How to create a pointer in Objective C to swift?

Edit2 : There is a sample ipjsuaAppDelegate.m here. In the bottom of the file there is a function displayWindow. I think in my case I have to get a reference for the object "parent". Here they made the reference to the view like that : UIView *parent = app.viewController.view; But in my case I don't know how to make a reference to a specific view in my swift code instead of that app.viewController...


回答1:


In swift 4.2, you can try this:

let view = Unmanaged<UIView>.fromOpaque(wi.hwnd.info.ios.window).takeUnretainedValue()


来源:https://stackoverflow.com/questions/44204985/how-to-display-pjsip-incoming-video-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!