TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nimish Saxena
1.1k
597
83k
Black screen showing approx 3 seconds before play video.
Nov 26 2020 11:05 PM
<local:VideoPlayer x:Name="videoplayer_ctrl" Source="{Binding videosource}" AutoPlay="{Binding autoplay}" AreTransportControlsEnabled="{Binding controlsenabled}" />
C# Code-
protected override void OnElementChanged(ElementChangedEventArgs<VideoPlayer> args)
{
base.OnElementChanged(args);
if (args.NewElement != null)
{
if (Control == null)
{
// Save the VideoView for future reference
videoView = new VideoView(Context);
// Put the VideoView in a RelativeLayout
AWR relativeLayout = new AWR(Context);
relativeLayout.AddView(videoView);
// Center the VideoView in the RelativeLayout
var layoutParams = new AWR.LayoutParams(Convert.ToInt32(DeviceDisplay.MainDisplayInfo.Width), Convert.ToInt32(DeviceDisplay.MainDisplayInfo.Height));
layoutParams.AddRule(LayoutRules.AlignParentTop);
layoutParams.AddRule(LayoutRules.AlignParentBottom);
layoutParams.AddRule(LayoutRules.AlignParentLeft);
layoutParams.AddRule(LayoutRules.AlignParentRight);
videoView.LayoutParameters = layoutParams;
// Handle a VideoView event
videoView.Prepared += OnVideoViewPrepared;
SetNativeControl(relativeLayout);
}
SetAreTransportControlsEnabled();
PlayVideo();
args.NewElement.UpdateStatus += OnUpdateStatus;
args.NewElement.PlayRequested += OnPlayRequested;
args.NewElement.PauseRequested += OnPauseRequested;
args.NewElement.StopRequested += OnStopRequested;
}
if (args.OldElement != null)
{
args.OldElement.UpdateStatus -= OnUpdateStatus;
args.OldElement.PlayRequested -= OnPlayRequested;
args.OldElement.PauseRequested -= OnPauseRequested;
args.OldElement.StopRequested -= OnStopRequested;
}
}
Reply
Answers (
1
)
Face Verification using MLKIT Vision
Image captured from camera not showing on next activity Android Studio