equal
deleted
inserted
replaced
19 private bool isPlaying = false; |
19 private bool isPlaying = false; |
20 #endregion |
20 #endregion |
21 |
21 |
22 public event EventHandler PlayerOpened; |
22 public event EventHandler PlayerOpened; |
23 |
23 |
24 public UserControlPlayer() |
24 public UserControlPlayer() |
25 { |
25 { |
26 this.InitializeComponent(); |
26 this.InitializeComponent(); |
27 initPlayer(); |
27 initPlayer(); |
|
28 } |
|
29 |
|
30 public UserControlPlayer(string path) |
|
31 { |
|
32 this.InitializeComponent(); |
|
33 initPlayer(path); |
28 } |
34 } |
29 |
35 |
30 #region Properties |
36 #region Properties |
31 public double TotalMilliseconds |
37 public double TotalMilliseconds |
32 { |
38 { |
61 DirectoryInfo info = assemblyPath.Directory; |
67 DirectoryInfo info = assemblyPath.Directory; |
62 MediaElementVideo.Source = new Uri(@"" + info.FullName.ToString() + "\\Resources\\Lake.wmv", UriKind.Relative); |
68 MediaElementVideo.Source = new Uri(@"" + info.FullName.ToString() + "\\Resources\\Lake.wmv", UriKind.Relative); |
63 MediaElementVideo.LoadedBehavior = MediaState.Manual; |
69 MediaElementVideo.LoadedBehavior = MediaState.Manual; |
64 MediaElementVideo.UnloadedBehavior = MediaState.Manual; |
70 MediaElementVideo.UnloadedBehavior = MediaState.Manual; |
65 MediaElementVideo.ScrubbingEnabled= true; |
71 MediaElementVideo.ScrubbingEnabled= true; |
|
72 } |
|
73 |
|
74 public void initPlayer(string path) |
|
75 { |
|
76 //init player |
|
77 isPlaying = false; |
|
78 //Pour se diriger vers le Dossier ressources du projet et non le bin/ressources |
|
79 //DirectoryInfo info = Directory.GetParent(@"."); |
|
80 MediaElementVideo.Source = new Uri(path, UriKind.Relative); |
|
81 MediaElementVideo.LoadedBehavior = MediaState.Manual; |
|
82 MediaElementVideo.UnloadedBehavior = MediaState.Manual; |
|
83 MediaElementVideo.ScrubbingEnabled = true; |
66 } |
84 } |
67 |
85 |
68 public void playerPause() |
86 public void playerPause() |
69 { |
87 { |
70 MediaElementVideo.Pause(); |
88 MediaElementVideo.Pause(); |