Beispiel #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(savedInstanceState);

            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

            if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.RecordAudio) != (int)Permission.Granted)
            {
                ActivityCompat.RequestPermissions(this, new string[] { Manifest.Permission.RecordAudio }, 0);
            }

            //Os.Setenv("G_MESSAGES_DEBUG", "all", true);
            //Os.Setenv("G_DEBUG", "fatal-warnings", true);
            //Os.Setenv("GST_DEBUG", "6", true);
            //Os.Setenv("GST_DEBUG_NO_COLOR", "1", true);

            JavaSystem.LoadLibrary("gstreamer_android");
            GStreamer.Init(ApplicationContext);

            JavaSystem.LoadLibrary("gstwebrtc");

            //_webRtc = new WebRTCNative(ApplicationContext);
            _webRtc = new WebRTCJava(ApplicationContext);

            //string content = "";
            //AssetManager assets = this.Assets;
            //using (StreamReader sr = new StreamReader(assets.Open("ssl/certs/ca-certificates.crt")))
            //{
            //    content = sr.ReadToEnd();
            //}

            LoadApplication(new App(_webRtc, ""));
        }
        public App(IWebRTC webRTC, string locale)
        {
            InitializeComponent();

            MainPage = new MainPage(webRTC, locale);
        }
 public MainPage(IWebRTC webRTC, string locale)
 {
     _locale = locale;
     _webRTC = webRTC;
     InitializeComponent();
 }