# HG changeset patch
# User Matthieu Totet
# Date 1259572835 -3600
# Node ID 3f70aee2432f9c3b30aee688d59b7fa22fe3278d
# Parent a48c44bc825bc03d7fcb17f9d5c54a0a8cfa7eed
Update VideoViewer
diff -r a48c44bc825b -r 3f70aee2432f client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml
--- a/client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml Wed Nov 25 12:06:26 2009 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml Mon Nov 30 10:20:35 2009 +0100
@@ -4,13 +4,13 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
-
+ xmlns:Converter="clr-namespace:Iri.Modernisation.Controls.Converter"
xmlns:Input="clr-namespace:SLExtensions.Input;assembly=SLExtensions"
xmlns:View="clr-namespace:Iri.Modernisation.Controls.View"
x:Class="Iri.Modernisation.Controls.View.VideoViewer" Width="240">
-
-
+
+
@@ -19,13 +19,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff -r a48c44bc825b -r 3f70aee2432f client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml.cs
--- a/client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml.cs Wed Nov 25 12:06:26 2009 +0100
+++ b/client/src/Iri.Modernisation.Controls/View/VideoViewer/VideoViewer.xaml.cs Mon Nov 30 10:20:35 2009 +0100
@@ -34,7 +34,7 @@
public static readonly DependencyProperty SourceProperty =
DependencyProperty.Register("MediaSource", typeof(String), typeof(VideoViewer), new PropertyMetadata(""));
-
+ private bool _isPlayed = false;
public VideoViewer()
{
// Required to initialize variables
@@ -52,6 +52,7 @@
void VideoPositionTimer_Tick(object sender, EventArgs e)
{
+ if(_isPlayed)
Commands.VideoViewer.SendPosition.Execute(VideoScreen.Position);
}
public void ChangePosition(TimeSpan TS)
@@ -62,6 +63,7 @@
void Pause_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
{
VideoScreen.Pause();
+ _isPlayed = false;
Commands.VideoPositionTimer.Stop();
if (Commands.VideoPositionTimer.IsEnabled)
{
@@ -73,7 +75,7 @@
{
if (e.Parameter == DataContext || e.Parameter == null)
{
-
+ _isPlayed = true;
VideoScreen.Play();
Commands.VideoPositionTimer.Start();
}
diff -r a48c44bc825b -r 3f70aee2432f client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs
--- a/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs Wed Nov 25 12:06:26 2009 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/ConsultationBookView/ConsultationBookViewVM.cs Mon Nov 30 10:20:35 2009 +0100
@@ -259,7 +259,7 @@
if (param.SelectedBook.Chapters[0].VideoSequences.Count != 0)
{ _actualVideoSource = param.SelectedBook.Chapters[0].VideoSequences[0].Path; }
SelectedIndex = param.SelectedBook.Chapters[0].Index[0];*/
- ActualVideoSourceVM = new VideoViewerVM();
+ ActualVideoSourceVM = new VideoViewerVM(true,false);
InitializeCommands();
@@ -274,7 +274,7 @@
//
if (param.SelectedBook.Chapters[0].VideoSequences.Count != 0)
{
- ActualVideoSourceVM = new VideoViewerVM() { Source = param.SelectedBook.MediaPath };
+ ActualVideoSourceVM = new VideoViewerVM(true,false) { Source = param.SelectedBook.MediaPath };
}
SelectedIndex = param.SelectedBook.Chapters[0].Index[0];
diff -r a48c44bc825b -r 3f70aee2432f client/src/Iri.Modernisation.Controls/ViewModel/VideoViewer/VideoViewerVM.cs
--- a/client/src/Iri.Modernisation.Controls/ViewModel/VideoViewer/VideoViewerVM.cs Wed Nov 25 12:06:26 2009 +0100
+++ b/client/src/Iri.Modernisation.Controls/ViewModel/VideoViewer/VideoViewerVM.cs Mon Nov 30 10:20:35 2009 +0100
@@ -44,6 +44,7 @@
}
}
+
public String Info
{
get
@@ -52,6 +53,7 @@
}
}
+
private TimeSpan position = new TimeSpan(0,0,0);
public TimeSpan Position
{
@@ -67,12 +69,46 @@
}
}
- public VideoViewerVM()
+
+ private bool _playControl;
+ public bool PlayControl
+ {
+ get
+ {
+ return _playControl;
+ }
+ set
+ {
+ _playControl = value;
+ OnPropertyChanged("PlayControl");
+ }
+ }
+
+ private bool _recordControl;
+ public bool RecordControl
+ {
+ get
+ {
+ return _recordControl;
+ }
+ set
+ {
+ _recordControl = value;
+ OnPropertyChanged("RecordControl");
+ }
+ }
+ public VideoViewerVM(bool playControl,bool recordControl )
+ {
+ _playControl = playControl;
+ _recordControl = recordControl;
+ InitializeCommands();
+ }
+ private void InitializeCommands()
{
Commands.VideoViewer.SendPosition.Executed += new EventHandler(SendPosition_Executed);
//Commands.GoToTime.Executed += new EventHandler(GoToTime_Executed);
+
}
-
void SendPosition_Executed(object sender, SLExtensions.Input.ExecutedEventArgs e)
{
//Position = (TimeSpan)(e.Parameter);