Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Playing smooth video issue

$
0
0

Dear all,

I have a simple video that I play in a loop as follow :

<MediaElement x:Name="_ripple" Width="1920" Height="1080"  DataContext="{Binding}"
                              LoadedBehavior="Manual" Stretch="Fill"  
                              HorizontalAlignment="Stretch" 
                              VerticalAlignment="Stretch" 
                              Source="Resources/video/Wildlife.wmv" Style="{StaticResource animatedRipple}" 
                              Visibility="{Binding ShowRipple,UpdateSourceTrigger=PropertyChanged,Converter={StaticResource VisibilityConverter}}">

And in code behind I attached a MediaTimeLine in order to better control it as follow :

MediaTimeLine timeline=new MediaTimeLine(); 
timeline.RepeatBehavior = RepeatBehavior.Forever;
timeline.Source = _ripple.Source;
MediaClock clock = timeline.CreateClock();
_ripple.Clock = clock;
                                  _ripple.Clock.Controller.Begin();

All this allows me to play the video in a loop.

Doing so I have notice that when the video is playing, it is not smooth and seems time to time it miss frame.

Any idea of such issue ?

regards


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>