-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFacadeVideoPlayer.cs
36 lines (31 loc) · 1.02 KB
/
FacadeVideoPlayer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CourseraProject
{
class FacadeVideoPlayer
{
public static void AddPlayerAndPlay(Form form,string fullpath)
{
AxWMPLib.AxWindowsMediaPlayer mp = new AxWMPLib.AxWindowsMediaPlayer();
((System.ComponentModel.ISupportInitialize)(mp)).BeginInit();
mp.Name = "wmPlayer";
mp.Enabled = true;
mp.Dock = System.Windows.Forms.DockStyle.None;
form.Controls.Add(mp);
((System.ComponentModel.ISupportInitialize)(mp)).EndInit();
// After initialization you can customize the Media Player
//mp.uiMode = "none";
mp.Location = new Point(12, 32);
mp.Margin = new Padding(12);
//776, 426
mp.Size = new Size(700, 400);
mp.URL = fullpath;
mp.Ctlcontrols.play();
}
}
}