I have fixed same problem, with your answer, but I think in this example is some code missing (for next person, with the same problem), so I post the code which worked for me.
for iOS:
AppDelegate.cs (iOS project)
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App(IntPtr.Zero));
View view = null;
UIView iView = new UIView(new RectangleF(0,0,640,480));
view = iView.ToView();
((App)App.Current).ViedoFrame().Content = view;
NativeViewWrapper wrapper = (NativeViewWrapper)((App)App.Current).ViedoFrame().Content;
UIView uiView = (UIView)wrapper.NativeView;
((App)App.Current).Core.NativePreviewWindowId = uiView.Handle;
((App)App.Current).Core.VideoDisplayEnabled = true;
((App)App.Current).Core.VideoPreviewEnabled = true;
return base.FinishedLaunching(app, options);
}
App.cs (shared project)
public partial class App : Application
{
...
public Page MainPageContent;
public App(IntPtr context)
{
InitializeComponent();
MainPageContent = new MainPage();
MainPage = new NavigationPage(MainPageContent);
}
public ContentView ViedoFrame()
{
return MainPageContent.FindByName<ContentView>("video_frame");
}
...
}
MainPage.xaml (shared project)
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Kiwi"
x:Class="Project.Linphone"
Title="KiwiDoorUni">
<ContentPage.ToolbarItems>
...
</ContentPage.ToolbarItems>
<StackLayout>
...
<ContentView x:Name="video_frame">
<!-- leave blank, UIView will be inserted here -->
</ContentView>
</StackLayout>
</ContentPage>
for android
i used the code from BelledonneCommunications in the Linphone Xamarin example project and it worked for me
example project can be found here:
https://github.com/BelledonneCommunications/linphone-xamarin
check the file: MainActivity.cs (android project)