我使用下面的代碼寫在Xamarin的Android應用程序:如何從Xamarin.Android的前置攝像頭錄製視頻?
var recorder = new MediaRecorder();
recorder.SetVideoSource (VideoSource.Camera);
recorder.SetAudioSource (AudioSource.Mic);
recorder.SetOutputFormat (OutputFormat.Default);
recorder.SetVideoEncoder (VideoEncoder.Default);
recorder.SetAudioEncoder (AudioEncoder.Default);
recorder.SetOutputFile (path);
recorder.SetPreviewDisplay (video.Holder.Surface);
recorder.Prepare();
recorder.Start();
它的工作原理,但我有一個問題。它使用背景攝像頭,方向是風景。如何使用前置攝像頭錄製視頻並將方向設置爲縱向?
建議的API CamcorderProfile.get(INT,INT)不xamarin – Kartik 2014-10-01 19:33:52
等效呈現是CamcorderProfile.get(INT,CamcorderQuality)。當映射本地API時,Xamarin會嘗試用它們可以引用的枚舉代替愚蠢的Android int常量 – 2014-10-01 20:03:58
我的意思是:CamcorderProfile.Get(1,CamcorderQuality)在Xamarin中引發錯誤 - '方法沒有超載'獲取'需要2個參數' – Kartik 2014-10-02 03:52:24