Hello Team,
I want to display and run video file in FlipView. For this i have created one User control which contains MediaElement as
And passing as
Code
IRandomAccessStream videoStream = await ir.ElementAt(i).OpenAsync(FileAccessMode.ReadWrite);
UCVideoPlayer uc = new UCVideoPlayer(videoStream, ir.ElementAt(i).ContentType);
fvPreviewer.Items.Add(uc);Here ir is my storagefile Array and fvPreviewer is FlipView control.
In Usercontrol- name is (UCVideoPlayer)
Design-
CSS
x:Name="VideoSource" AutomationProperties.Name="VideoSource" HorizontalAlignment="Center" VerticalAlignment="Center" Height="360" Width="640" AutoPlay="True" PosterSource="Assets/poster.png" IsLooping="True"/>Initializing as
Code
public UCVideoPlayer(IRandomAccessStream VideoStream, string ContentType)
{
this.InitializeComponent();
VideoSource.SetSource(VideoStream, ContentType);
VideoSource.Position = new TimeSpan(0, 0, 50000);
}Can you please guide me for this ? Why this video file is not getting displayed ?
Thanks in Advance
Answers
Know the answer? Post it. Somebody with the same question will find it here.