Problem with cameraview after calling cameraView.Shutter();
rick ruhl
61
Reputation points
Something weird here happening and it worked before.
cs code
void OnRecord(object sender, EventArgs e)
{
//mediaView.Stop();
Send.Text = "Test Send";
if (mediaView.CurrentState == MediaElementState.Stopped ||
mediaView.CurrentState == MediaElementState.Paused || mediaView.CurrentState == MediaElementState.Closed)
{
mediaView.Play();
cameraView.CaptureMode = (Xamarin.CommunityToolkit.UI.Views.CameraCaptureMode)CameraCaptureMode.Video;
cameraView.Shutter();
Record.Text = "Recording";
}
// else if (mediaView.CurrentState == MediaElementState.Playing)
// {
// Record.Text = "Stop";
// cameraView.Shutter();
// mediaView.Stop();
// }
// _timer = new Timer(TimeSpan.FromSeconds(1), CountDown);
// TotalSeconds = _totalSeconds;
// StartTimerCommand();
}
XAML code
<Grid>
<xct:CameraView
Grid.Column="1"
x:Name="cameraView"
CaptureMode="Video"
FlashMode="Off"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" />
<Label
Grid.Column="2"
Text=""
HorizontalTextAlignment="Center"
HorizontalOptions="FillAndExpand"
VerticalOptions="End" />
</Grid>
</Grid>
<Grid>
<Button x:Name="Send" Text="Send" HeightRequest="70" FontAttributes="Bold" WidthRequest="400" HorizontalOptions="Center" CornerRadius="6" BackgroundColor="#083F5D" BorderColor=" #083F5D" TextColor="White"></Button>
</Grid>
When we press the start button, and it calls cameraView.Shutter();, the cameraview goes black.
Before we press the button we can see video on the cameraview
any thoughts?
using VS 2022
Xamarin Community toolkit 1.3.2
Forms 5.0.0.2291
Rick
Developer technologies .NET Xamarin
5,380 questions
Sign in to answer