├── .gitattributes ├── .gitignore ├── Document └── 视频播放器.gif ├── Product └── Debug.rar ├── README.md ├── Solution ├── HeBianGu.Product.MediaPlayer │ └── HeBianGu.Product.MediaPlayer.sln └── MediaPlayer.sln ├── Source ├── Appliaction │ ├── HeBianGu.App.Demo.VLCPlayer │ │ ├── 20181118034742753_easyicon_net_32.ico │ │ ├── App.config │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── HeBianGu.App.Demo.VLCPlayer.csproj │ │ ├── MainWindow.xaml │ │ ├── MainWindow.xaml.cs │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ ├── Settings.Designer.cs │ │ │ └── Settings.settings │ │ └── packages.config │ ├── HeBianGu.App.MediaPlayer │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── AssemblyInfo.cs │ │ ├── HeBianGu.App.MediaPlayer.csproj │ │ ├── MainWindow.xaml │ │ ├── MainWindow.xaml.cs │ │ ├── Provider │ │ │ └── DataSourceLocator.cs │ │ ├── ViewModel │ │ │ └── ShellViewModel.cs │ │ └── logo.ico │ └── HeBianGu.Product.MediaPlayer.App.Demo │ │ ├── 20181118034742753_easyicon_net_32.ico │ │ ├── App.config │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── HeBianGu.Product.MediaPlayer.App.Demo.csproj │ │ ├── MainWindow.xaml │ │ ├── MainWindow.xaml.cs │ │ ├── Music.ico │ │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ │ └── packages.config ├── General │ ├── HeBianGu.General.VLCMediaPlayer │ │ ├── HeBianGu.General.VLCMediaPlayer.csproj │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ ├── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ ├── Settings.Designer.cs │ │ │ └── Settings.settings │ │ ├── VLCPlayer.xaml │ │ ├── VLCPlayer.xaml.cs │ │ └── packages.config │ └── HeBianGu.Product.General.MediaPlayer │ │ ├── HeBianGu.Product.General.MediaPlayer.csproj │ │ ├── HeBianGu.Product.General.MediaPlayer.nuspec │ │ ├── MediaPlayer.xaml │ │ ├── MediaPlayer.xaml.cs │ │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ │ ├── nuget-package.bat │ │ ├── nuget-push.bat │ │ └── packages.config └── Setup │ └── HeBianGu.Setup.MediaPlayer │ └── HeBianGu.Setup.MediaPlayer.vdproj └── settings.xamlstyler /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | *.i.cs 73 | *.g.cs 74 | *.cache 75 | *.txt 76 | *.g.resources 77 | *.exe 78 | 79 | # Chutzpah Test files 80 | _Chutzpah* 81 | 82 | # Visual C++ cache files 83 | ipch/ 84 | *.aps 85 | *.ncb 86 | *.opendb 87 | *.opensdf 88 | *.sdf 89 | *.cachefile 90 | 91 | # Visual Studio profiler 92 | *.psess 93 | *.vsp 94 | *.vspx 95 | *.sap 96 | 97 | # TFS 2012 Local Workspace 98 | $tf/ 99 | 100 | # Guidance Automation Toolkit 101 | *.gpState 102 | 103 | # ReSharper is a .NET coding add-in 104 | _ReSharper*/ 105 | *.[Rr]e[Ss]harper 106 | *.DotSettings.user 107 | 108 | # JustCode is a .NET coding add-in 109 | .JustCode 110 | 111 | # TeamCity is a build add-in 112 | _TeamCity* 113 | 114 | # DotCover is a Code Coverage Tool 115 | *.dotCover 116 | 117 | # NCrunch 118 | _NCrunch_* 119 | .*crunch*.local.xml 120 | nCrunchTemp_* 121 | 122 | # MightyMoose 123 | *.mm.* 124 | AutoTest.Net/ 125 | 126 | # Web workbench (sass) 127 | .sass-cache/ 128 | 129 | # Installshield output folder 130 | [Ee]xpress/ 131 | 132 | # DocProject is a documentation generator add-in 133 | DocProject/buildhelp/ 134 | DocProject/Help/*.HxT 135 | DocProject/Help/*.HxC 136 | DocProject/Help/*.hhc 137 | DocProject/Help/*.hhk 138 | DocProject/Help/*.hhp 139 | DocProject/Help/Html2 140 | DocProject/Help/html 141 | 142 | # Click-Once directory 143 | publish/ 144 | 145 | # Publish Web Output 146 | *.[Pp]ublish.xml 147 | *.azurePubxml 148 | # TODO: Comment the next line if you want to checkin your web deploy settings 149 | # but database connection strings (with potential passwords) will be unencrypted 150 | *.pubxml 151 | *.publishproj 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml -------------------------------------------------------------------------------- /Document/视频播放器.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeBianGu/WPF-MediaPlayer/949cf5067df2b3a26f170954858995b7101f020b/Document/视频播放器.gif -------------------------------------------------------------------------------- /Product/Debug.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeBianGu/WPF-MediaPlayer/949cf5067df2b3a26f170954858995b7101f020b/Product/Debug.rar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ​ 2 | ## 推荐学习官方文档 3 | https://learn.microsoft.com/zh-cn/dotnet/api/system.windows.controls?view=windowsdesktop-8.0?wt.mc_id=MVP_380318 4 | ## 推荐查看在线源码 5 | https://referencesource.microsoft.com/?wt.mc_id=MVP_380318 ​​ 6 | -------------------------------------------------------------------------------- /Solution/HeBianGu.Product.MediaPlayer/HeBianGu.Product.MediaPlayer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29609.76 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{E1272CD8-1D37-442B-B5E3-41A85FAE9EA9}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "General", "General", "{C06B0294-FA43-4764-A954-F45E89667309}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeBianGu.Product.MediaPlayer.App.Demo", "..\..\Source\Appliaction\HeBianGu.Product.MediaPlayer.App.Demo\HeBianGu.Product.MediaPlayer.App.Demo.csproj", "{BBA8446E-50F2-4E14-8D81-F4A99A60E66F}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeBianGu.Product.General.MediaPlayer", "..\..\Source\General\HeBianGu.Product.General.MediaPlayer\HeBianGu.Product.General.MediaPlayer.csproj", "{9AA2D32F-9F7D-439A-B591-79F1D30CE230}" 13 | EndProject 14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeBianGu.General.VLCMediaPlayer", "..\..\Source\General\HeBianGu.General.VLCMediaPlayer\HeBianGu.General.VLCMediaPlayer.csproj", "{7253F4A6-0E7C-4B11-BFF8-978215364968}" 15 | EndProject 16 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeBianGu.App.Demo.VLCPlayer", "..\..\Source\Appliaction\HeBianGu.App.Demo.VLCPlayer\HeBianGu.App.Demo.VLCPlayer.csproj", "{31E14E08-9A6C-4D0A-96C0-997875832BB5}" 17 | EndProject 18 | Global 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Debug|Any CPU = Debug|Any CPU 21 | Release|Any CPU = Release|Any CPU 22 | EndGlobalSection 23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 24 | {BBA8446E-50F2-4E14-8D81-F4A99A60E66F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 25 | {BBA8446E-50F2-4E14-8D81-F4A99A60E66F}.Debug|Any CPU.Build.0 = Debug|Any CPU 26 | {BBA8446E-50F2-4E14-8D81-F4A99A60E66F}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {BBA8446E-50F2-4E14-8D81-F4A99A60E66F}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {9AA2D32F-9F7D-439A-B591-79F1D30CE230}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 29 | {9AA2D32F-9F7D-439A-B591-79F1D30CE230}.Debug|Any CPU.Build.0 = Debug|Any CPU 30 | {9AA2D32F-9F7D-439A-B591-79F1D30CE230}.Release|Any CPU.ActiveCfg = Release|Any CPU 31 | {9AA2D32F-9F7D-439A-B591-79F1D30CE230}.Release|Any CPU.Build.0 = Release|Any CPU 32 | {7253F4A6-0E7C-4B11-BFF8-978215364968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {7253F4A6-0E7C-4B11-BFF8-978215364968}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | {7253F4A6-0E7C-4B11-BFF8-978215364968}.Release|Any CPU.ActiveCfg = Release|Any CPU 35 | {7253F4A6-0E7C-4B11-BFF8-978215364968}.Release|Any CPU.Build.0 = Release|Any CPU 36 | {31E14E08-9A6C-4D0A-96C0-997875832BB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 37 | {31E14E08-9A6C-4D0A-96C0-997875832BB5}.Debug|Any CPU.Build.0 = Debug|Any CPU 38 | {31E14E08-9A6C-4D0A-96C0-997875832BB5}.Release|Any CPU.ActiveCfg = Release|Any CPU 39 | {31E14E08-9A6C-4D0A-96C0-997875832BB5}.Release|Any CPU.Build.0 = Release|Any CPU 40 | EndGlobalSection 41 | GlobalSection(SolutionProperties) = preSolution 42 | HideSolutionNode = FALSE 43 | EndGlobalSection 44 | GlobalSection(NestedProjects) = preSolution 45 | {BBA8446E-50F2-4E14-8D81-F4A99A60E66F} = {E1272CD8-1D37-442B-B5E3-41A85FAE9EA9} 46 | {9AA2D32F-9F7D-439A-B591-79F1D30CE230} = {C06B0294-FA43-4764-A954-F45E89667309} 47 | {7253F4A6-0E7C-4B11-BFF8-978215364968} = {C06B0294-FA43-4764-A954-F45E89667309} 48 | {31E14E08-9A6C-4D0A-96C0-997875832BB5} = {E1272CD8-1D37-442B-B5E3-41A85FAE9EA9} 49 | EndGlobalSection 50 | GlobalSection(ExtensibilityGlobals) = postSolution 51 | SolutionGuid = {FDE9411F-FB4F-4CAB-A598-D72B57854E08} 52 | EndGlobalSection 53 | EndGlobal 54 | -------------------------------------------------------------------------------- /Solution/MediaPlayer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.4.33213.308 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{E1272CD8-1D37-442B-B5E3-41A85FAE9EA9}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeBianGu.App.MediaPlayer", "..\Source\Appliaction\HeBianGu.App.MediaPlayer\HeBianGu.App.MediaPlayer.csproj", "{760936EA-2283-4DA7-B421-A41861F4564D}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setup", "Setup", "{96168179-AAAD-47AB-81C3-CA148F2B2536}" 11 | EndProject 12 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "HeBianGu.Setup.MediaPlayer", "..\Source\Setup\HeBianGu.Setup.MediaPlayer\HeBianGu.Setup.MediaPlayer.vdproj", "{5AFBFB96-AB27-404B-8DC4-F89332438C69}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Release|Any CPU = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {760936EA-2283-4DA7-B421-A41861F4564D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {760936EA-2283-4DA7-B421-A41861F4564D}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {760936EA-2283-4DA7-B421-A41861F4564D}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {760936EA-2283-4DA7-B421-A41861F4564D}.Release|Any CPU.Build.0 = Release|Any CPU 24 | {5AFBFB96-AB27-404B-8DC4-F89332438C69}.Debug|Any CPU.ActiveCfg = Release 25 | {5AFBFB96-AB27-404B-8DC4-F89332438C69}.Release|Any CPU.ActiveCfg = Release 26 | EndGlobalSection 27 | GlobalSection(SolutionProperties) = preSolution 28 | HideSolutionNode = FALSE 29 | EndGlobalSection 30 | GlobalSection(NestedProjects) = preSolution 31 | {760936EA-2283-4DA7-B421-A41861F4564D} = {E1272CD8-1D37-442B-B5E3-41A85FAE9EA9} 32 | {5AFBFB96-AB27-404B-8DC4-F89332438C69} = {96168179-AAAD-47AB-81C3-CA148F2B2536} 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {FDE9411F-FB4F-4CAB-A598-D72B57854E08} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/20181118034742753_easyicon_net_32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeBianGu/WPF-MediaPlayer/949cf5067df2b3a26f170954858995b7101f020b/Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/20181118034742753_easyicon_net_32.ico -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using HeBianGu.Base.WpfBase; 2 | using HeBianGu.General.WpfControlLib; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Configuration; 6 | using System.Data; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | using System.Windows; 10 | using System.Windows.Media; 11 | 12 | namespace HeBianGu.App.Demo.VLCPlayer 13 | { 14 | /// 15 | /// App.xaml 的交互逻辑 16 | /// 17 | public partial class App : ApplicationBase 18 | { 19 | protected override void OnStartup(StartupEventArgs e) 20 | { 21 | MainWindow shellWindow = new MainWindow(); 22 | 23 | shellWindow.Show(); 24 | 25 | base.OnStartup(e); 26 | } 27 | 28 | 29 | protected override void ConfigureServices(IServiceCollection services) 30 | { 31 | //// Do :注册本地化配置读写服务 32 | //services.AddSingleton(); 33 | 34 | //// Do :注册日志服务 35 | //services.AddSingleton(); 36 | 37 | 38 | } 39 | 40 | protected override void Configure(IApplicationBuilder app) 41 | { 42 | // Do:设置默认主题 43 | app.UseLocalTheme(l => 44 | { 45 | l.AccentColor = Color.FromRgb(0x64, 0x76, 0x87); 46 | l.SmallFontSize = 15D; 47 | l.LargeFontSize = 18D; 48 | l.FontSize = FontSize.Small; 49 | 50 | l.ItemHeight = 35; 51 | //l.ItemWidth = 120; 52 | l.ItemCornerRadius = 5; 53 | 54 | l.AnimalSpeed = 5000; 55 | 56 | l.AccentColorSelectType = 0; 57 | 58 | l.IsUseAnimal = true; 59 | 60 | l.ThemeType = ThemeType.Light; 61 | 62 | l.Language = Language.Chinese; 63 | }); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/HeBianGu.App.Demo.VLCPlayer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {31E14E08-9A6C-4D0A-96C0-997875832BB5} 8 | WinExe 9 | HeBianGu.App.Demo.VLCPlayer 10 | HeBianGu.App.Demo.VLCPlayer 11 | v4.5 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | 17 | 18 | AnyCPU 19 | true 20 | full 21 | false 22 | ..\..\..\Product\Debug\ 23 | DEBUG;TRACE 24 | prompt 25 | 4 26 | 27 | 28 | AnyCPU 29 | pdbonly 30 | true 31 | bin\Release\ 32 | TRACE 33 | prompt 34 | 4 35 | 36 | 37 | 20181118034742753_easyicon_net_32.ico 38 | 39 | 40 | 41 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\HeBianGu.Base.WpfBase.2.1.4\lib\net45\HeBianGu.Base.WpfBase.dll 42 | 43 | 44 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\HeBianGu.General.WpfControlLib.2.1.4\lib\net45\HeBianGu.General.WpfControlLib.dll 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 4.0 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | MSBuild:Compile 65 | Designer 66 | 67 | 68 | MSBuild:Compile 69 | Designer 70 | 71 | 72 | App.xaml 73 | Code 74 | 75 | 76 | MainWindow.xaml 77 | Code 78 | 79 | 80 | 81 | 82 | Code 83 | 84 | 85 | True 86 | True 87 | Resources.resx 88 | 89 | 90 | True 91 | Settings.settings 92 | True 93 | 94 | 95 | ResXFileCodeGenerator 96 | Resources.Designer.cs 97 | 98 | 99 | 100 | SettingsSingleFileGenerator 101 | Settings.Designer.cs 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | {7253f4a6-0e7c-4b11-bff8-978215364968} 110 | HeBianGu.General.VLCMediaPlayer 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace HeBianGu.App.Demo.VLCPlayer 17 | { 18 | /// 19 | /// MainWindow.xaml 的交互逻辑 20 | /// 21 | public partial class MainWindow 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("HeBianGu.App.Demo.VLCPlayer")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("HeBianGu.App.Demo.VLCPlayer")] 15 | [assembly: AssemblyCopyright("Copyright © 2020")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 52 | //通过使用 "*",如下所示: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HeBianGu.App.Demo.VLCPlayer.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HeBianGu.App.Demo.VLCPlayer.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HeBianGu.App.Demo.VLCPlayer.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.Demo.VLCPlayer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.MediaPlayer/App.xaml: -------------------------------------------------------------------------------- 1 |  5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.MediaPlayer/App.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 By HeBianGu(QQ:908293466) https://github.com/HeBianGu/WPF-ControlBase 2 | 3 | using HeBianGu.Base.WpfBase; 4 | using HeBianGu.Control.Guide; 5 | using HeBianGu.Control.ThemeSet; 6 | using HeBianGu.General.WpfControlLib; 7 | using HeBianGu.Service.Mvp; 8 | using HeBianGu.Systems.About; 9 | using HeBianGu.Systems.Setting; 10 | using HeBianGu.Systems.Upgrade; 11 | using System; 12 | using System.Windows; 13 | using System.Windows.Media; 14 | 15 | namespace HeBianGu.App.MediaPlayer 16 | { 17 | /// 18 | /// App.xaml 的交互逻辑 19 | /// 20 | public partial class App : ApplicationBase 21 | { 22 | protected override MainWindowBase CreateMainWindow(StartupEventArgs e) 23 | { 24 | return new MainWindow(); 25 | } 26 | 27 | protected override void ConfigureServices(IServiceCollection services) 28 | { 29 | base.ConfigureServices(services); 30 | 31 | services.AddWindowDialog(); 32 | services.AddWindowAnimation(); 33 | services.AddMessageProxy(); 34 | services.AddXmlSerialize(); 35 | services.AddXmlMeta(); 36 | services.AddSetting(); 37 | services.AddXmlWebSerializerService(); 38 | services.AddSettingPath(); 39 | 40 | // Do :启用启动窗口 需要添加引用HeBianGu.Window.Start 41 | services.AddStart(l => 42 | { 43 | l.Title = "H影音"; 44 | l.ProductFontSize = 100; 45 | l.Copyright = "Copyright @ HeBianGu 2019-2023"; 46 | }); 47 | services.AddAutoUpgrade(l => 48 | { 49 | l.Uri = "https://gitee.com/hebiangu/wpf-auto-update/raw/master/Install/MediaPlayer/AutoUpdate.xml"; 50 | l.UseIEDownload = true; 51 | }); 52 | 53 | #region - More - 54 | services.AddUpgradeViewPresenter(); 55 | services.AddAboutViewPresenter(); 56 | services.AddMoreViewPresenter(x => 57 | { 58 | x.AddPersenter(UpgradeViewPresenter.Instance); 59 | x.AddPersenter(AboutViewPresenter.Instance); 60 | 61 | }); 62 | #endregion 63 | 64 | #region - WindowCaption - 65 | services.AddGuideViewPresenter(); 66 | services.AddSettingViewPrenter(); 67 | services.AddThemeRightViewPresenter(); 68 | services.AddWindowCaptionViewPresenter(x => 69 | { 70 | x.AddPersenter(MoreViewPresenter.Instance); 71 | x.AddPersenter(GuideViewPresenter.Instance); 72 | x.AddPersenter(SettingViewPresenter.Instance); 73 | x.AddPersenter(ThemeRightToolViewPresenter.Instance); 74 | }); 75 | #endregion 76 | } 77 | 78 | protected override void Configure(IApplicationBuilder app) 79 | { 80 | base.Configure(app); 81 | 82 | app.UseVlc(x => 83 | { 84 | 85 | }); 86 | 87 | // Do:设置默认主题 88 | app.UseLocalTheme(l => 89 | { 90 | l.AccentColor = (Color)ColorConverter.ConvertFromString("#FF0093FF"); 91 | //l.ForegroundColor = (Color)ColorConverter.ConvertFromString("#000000"); 92 | l.DefaultFontSize = 15D; 93 | l.FontSize = FontSize.Small; 94 | l.ItemHeight = 35; 95 | //l.ItemWidth = 120; 96 | l.ItemCornerRadius = 5; 97 | l.AnimalSpeed = 5000; 98 | l.AccentColorSelectType = 0; 99 | l.IsUseAnimal = true; 100 | l.ThemeType = ThemeType.Light; 101 | l.Language = Language.Chinese; 102 | l.AccentBrushType = AccentBrushType.LinearGradientBrush; 103 | }); 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.MediaPlayer/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright ? 2022 By HeBianGu(QQ:908293466) https://github.com/HeBianGu/WPF-ControlBase 2 | 3 | using System.Windows; 4 | 5 | [assembly: ThemeInfo( 6 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 7 | //(used if a resource is not found in the page, 8 | // or application resource dictionaries) 9 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 10 | //(used if a resource is not found in the page, 11 | // app, or any theme specific resource dictionaries) 12 | )] 13 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.MediaPlayer/HeBianGu.App.MediaPlayer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net7.0-windows 6 | 8.0 7 | true 8 | logo.ico 9 | 10 | 1.0.4 11 | H影音 12 | H影音 13 | 1.0.0 14 | 1.0.0 15 | Copyright © HeBianGu 2019-2023 16 | HeBianGu 17 | https://github.com/HeBianGu 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.MediaPlayer/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.MediaPlayer/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 By HeBianGu(QQ:908293466) https://github.com/HeBianGu/WPF-ControlBase 2 | 3 | namespace HeBianGu.App.MediaPlayer 4 | { 5 | /// 6 | /// Interaction logic for MainWindow.xaml 7 | /// 8 | public partial class MainWindow 9 | { 10 | public MainWindow() 11 | { 12 | InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.MediaPlayer/Provider/DataSourceLocator.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 By HeBianGu(QQ:908293466) https://github.com/HeBianGu/WPF-ControlBase 2 | 3 | using HeBianGu.Base.WpfBase; 4 | 5 | namespace HeBianGu.App.MediaPlayer 6 | { 7 | internal class DataSourceLocator 8 | { 9 | public DataSourceLocator() 10 | { 11 | ServiceRegistry.Instance.Register(); 12 | } 13 | 14 | public ShellViewModel ShellViewModel => ServiceRegistry.Instance.GetInstance(); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.MediaPlayer/ViewModel/ShellViewModel.cs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 By HeBianGu(QQ:908293466) https://github.com/HeBianGu/WPF-ControlBase 2 | 3 | using HeBianGu.Base.WpfBase; 4 | 5 | namespace HeBianGu.App.MediaPlayer 6 | { 7 | internal class ShellViewModel : NotifyPropertyChanged 8 | { 9 | protected override void Init() 10 | { 11 | 12 | } 13 | 14 | /// 命令通用方法 15 | protected override async void RelayMethod(object obj) 16 | 17 | { 18 | 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.App.MediaPlayer/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeBianGu/WPF-MediaPlayer/949cf5067df2b3a26f170954858995b7101f020b/Source/Appliaction/HeBianGu.App.MediaPlayer/logo.ico -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/20181118034742753_easyicon_net_32.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeBianGu/WPF-MediaPlayer/949cf5067df2b3a26f170954858995b7101f020b/Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/20181118034742753_easyicon_net_32.ico -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using HeBianGu.Base.WpfBase; 2 | using HeBianGu.General.WpfControlLib; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Configuration; 6 | using System.Data; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | using System.Windows; 10 | using System.Windows.Media; 11 | 12 | namespace HeBianGu.Product.MediaPlayer.App.Demo 13 | { 14 | /// 15 | /// App.xaml 的交互逻辑 16 | /// 17 | public partial class App : ApplicationBase 18 | { 19 | protected override void OnStartup(StartupEventArgs e) 20 | { 21 | MainWindow shellWindow = new MainWindow(); 22 | 23 | shellWindow.Show(); 24 | 25 | base.OnStartup(e); 26 | } 27 | 28 | 29 | protected override void ConfigureServices(IServiceCollection services) 30 | { 31 | //// Do :注册本地化配置读写服务 32 | //services.AddSingleton(); 33 | 34 | //// Do :注册日志服务 35 | //services.AddSingleton(); 36 | 37 | 38 | } 39 | 40 | protected override void Configure(IApplicationBuilder app) 41 | { 42 | // Do:设置默认主题 43 | app.UseLocalTheme(l => 44 | { 45 | l.AccentColor = Color.FromRgb(0x64, 0x76, 0x87); 46 | l.SmallFontSize = 15D; 47 | l.LargeFontSize = 18D; 48 | l.FontSize = FontSize.Small; 49 | 50 | l.ItemHeight = 35; 51 | //l.ItemWidth = 120; 52 | l.ItemCornerRadius =5; 53 | 54 | l.AnimalSpeed = 5000; 55 | 56 | l.AccentColorSelectType = 0; 57 | 58 | l.IsUseAnimal = true; 59 | 60 | l.ThemeType = ThemeType.Light; 61 | 62 | l.Language = Language.Chinese; 63 | }); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/HeBianGu.Product.MediaPlayer.App.Demo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {BBA8446E-50F2-4E14-8D81-F4A99A60E66F} 8 | WinExe 9 | HeBianGu.Product.MediaPlayer.App.Demo 10 | HeBianGu.Product.MediaPlayer.App.Demo 11 | v4.5 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | ..\..\..\Product\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 20181118034742753_easyicon_net_32.ico 37 | 38 | 39 | 40 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\HeBianGu.Base.WpfBase.2.1.4\lib\net45\HeBianGu.Base.WpfBase.dll 41 | 42 | 43 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\HeBianGu.General.WpfControlLib.2.1.4\lib\net45\HeBianGu.General.WpfControlLib.dll 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 4.0 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | MSBuild:Compile 64 | Designer 65 | 66 | 67 | MSBuild:Compile 68 | Designer 69 | 70 | 71 | App.xaml 72 | Code 73 | 74 | 75 | MainWindow.xaml 76 | Code 77 | 78 | 79 | 80 | 81 | Code 82 | 83 | 84 | True 85 | True 86 | Resources.resx 87 | 88 | 89 | True 90 | Settings.settings 91 | True 92 | 93 | 94 | ResXFileCodeGenerator 95 | Resources.Designer.cs 96 | 97 | 98 | 99 | SettingsSingleFileGenerator 100 | Settings.Designer.cs 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | {9aa2d32f-9f7d-439a-b591-79f1d30ce230} 109 | HeBianGu.Product.General.MediaPlayer 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace HeBianGu.Product.MediaPlayer.App.Demo 17 | { 18 | /// 19 | /// MainWindow.xaml 的交互逻辑 20 | /// 21 | public partial class MainWindow 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/Music.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HeBianGu/WPF-MediaPlayer/949cf5067df2b3a26f170954858995b7101f020b/Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/Music.ico -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("HeBianGu.Product.MediaPlayer.App.Demo")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("HeBianGu.Product.MediaPlayer.App.Demo")] 15 | [assembly: AssemblyCopyright("Copyright © 2018")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 52 | // 方法是按如下所示使用“*”: : 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HeBianGu.Product.MediaPlayer.App.Demo.Properties 12 | { 13 | 14 | 15 | /// 16 | /// 强类型资源类,用于查找本地化字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// 返回此类使用的缓存 ResourceManager 实例。 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HeBianGu.Product.MediaPlayer.App.Demo.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// 覆盖当前线程的 CurrentUICulture 属性 56 | /// 使用此强类型的资源类的资源查找。 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HeBianGu.Product.MediaPlayer.App.Demo.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Source/Appliaction/HeBianGu.Product.MediaPlayer.App.Demo/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.General.VLCMediaPlayer/HeBianGu.General.VLCMediaPlayer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {7253F4A6-0E7C-4B11-BFF8-978215364968} 8 | library 9 | HeBianGu.General.VLCMediaPlayer 10 | HeBianGu.General.VLCMediaPlayer 11 | v4.5 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | true 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\HeBianGu.Base.WpfBase.2.1.4\lib\net45\HeBianGu.Base.WpfBase.dll 37 | 38 | 39 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\HeBianGu.General.WpfControlLib.2.1.4\lib\net45\HeBianGu.General.WpfControlLib.dll 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 4.0 52 | 53 | 54 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\Vlc.DotNet.Core.3.1.0\lib\net45\Vlc.DotNet.Core.dll 55 | 56 | 57 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\Vlc.DotNet.Core.Interops.3.1.0\lib\net45\Vlc.DotNet.Core.Interops.dll 58 | 59 | 60 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\Vlc.DotNet.Wpf.3.1.0\lib\net45\Vlc.DotNet.Wpf.dll 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | Code 69 | 70 | 71 | True 72 | True 73 | Resources.resx 74 | 75 | 76 | True 77 | Settings.settings 78 | True 79 | 80 | 81 | VLCPlayer.xaml 82 | 83 | 84 | ResXFileCodeGenerator 85 | Resources.Designer.cs 86 | 87 | 88 | 89 | SettingsSingleFileGenerator 90 | Settings.Designer.cs 91 | 92 | 93 | 94 | 95 | Designer 96 | MSBuild:Compile 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.General.VLCMediaPlayer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("HeBianGu.General.VLCMediaPlayer")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("HeBianGu.General.VLCMediaPlayer")] 15 | [assembly: AssemblyCopyright("Copyright © 2020")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly:ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 52 | //通过使用 "*",如下所示: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.General.VLCMediaPlayer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HeBianGu.General.VLCMediaPlayer.Properties { 12 | 13 | 14 | /// 15 | /// 强类型资源类,用于查找本地化字符串等。 16 | /// 17 | // 此类是由 StronglyTypedResourceBuilder 18 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 19 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 20 | // (以 /str 作为命令选项),或重新生成 VS 项目。 21 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 22 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 23 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 24 | internal class Resources { 25 | 26 | private static global::System.Resources.ResourceManager resourceMan; 27 | 28 | private static global::System.Globalization.CultureInfo resourceCulture; 29 | 30 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 31 | internal Resources() { 32 | } 33 | 34 | /// 35 | /// 返回此类使用的缓存 ResourceManager 实例。 36 | /// 37 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 38 | internal static global::System.Resources.ResourceManager ResourceManager { 39 | get { 40 | if ((resourceMan == null)) { 41 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HeBianGu.General.VLCMediaPlayer.Properties.Resources", typeof(Resources).Assembly); 42 | resourceMan = temp; 43 | } 44 | return resourceMan; 45 | } 46 | } 47 | 48 | /// 49 | /// 覆盖当前线程的 CurrentUICulture 属性 50 | /// 使用此强类型的资源类的资源查找。 51 | /// 52 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 53 | internal static global::System.Globalization.CultureInfo Culture { 54 | get { 55 | return resourceCulture; 56 | } 57 | set { 58 | resourceCulture = value; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.General.VLCMediaPlayer/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.General.VLCMediaPlayer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HeBianGu.General.VLCMediaPlayer.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.General.VLCMediaPlayer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.General.VLCMediaPlayer/VLCPlayer.xaml: -------------------------------------------------------------------------------- 1 |  14 | 15 | 16 | 17 | 18 | 22 | 26 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 51 | 57 | 58 | 59 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 86 | 87 | 93 | 94 | 100 | 101 | 106 | 107 | 108 | 109 | 114 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 146 | 147 | 153 | 154 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 179 | 183 | 191 | 199 | 203 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.General.VLCMediaPlayer/VLCPlayer.xaml.cs: -------------------------------------------------------------------------------- 1 | using HeBianGu.Base.WpfBase; 2 | using Microsoft.Win32; 3 | using System; 4 | using System.Collections; 5 | using System.Collections.Generic; 6 | using System.Diagnostics; 7 | using System.Globalization; 8 | using System.IO; 9 | using System.Linq; 10 | using System.Reflection; 11 | using System.Text; 12 | using System.Threading.Tasks; 13 | using System.Windows; 14 | using System.Windows.Controls; 15 | using System.Windows.Data; 16 | using System.Windows.Documents; 17 | using System.Windows.Input; 18 | using System.Windows.Media; 19 | using System.Windows.Media.Imaging; 20 | using System.Windows.Navigation; 21 | using System.Windows.Shapes; 22 | using Vlc.DotNet.Core; 23 | using Vlc.DotNet.Core.Interops.Signatures; 24 | using Vlc.DotNet.Wpf; 25 | using Path = System.IO.Path; 26 | 27 | namespace HeBianGu.General.VLCMediaPlayer 28 | { 29 | /// 30 | /// VLCPlayer.xaml 的交互逻辑 31 | /// 32 | public partial class VLCPlayer : UserControl 33 | { 34 | public VLCPlayer() 35 | { 36 | InitializeComponent(); 37 | 38 | { 39 | CommandBinding binding = new CommandBinding(VLCPlayer.OpenFile, (l, k) => 40 | { 41 | OpenFileDialog dialog = new OpenFileDialog(); 42 | 43 | var r = dialog.ShowDialog(); 44 | 45 | if (r.HasValue && r.Value) 46 | { 47 | this.VedioSource = new Uri(dialog.FileName, UriKind.Absolute); 48 | } 49 | 50 | }); 51 | 52 | this.CommandBindings.Add(binding); 53 | } 54 | 55 | { 56 | CommandBinding binding = new CommandBinding(VLCPlayer.ShootCutCommand, async (l, k) => 57 | { 58 | string filePath = await this.BeginShootCut(); 59 | 60 | this.OnShootCut(filePath); 61 | 62 | }); 63 | 64 | //, (l, k) => 65 | // { 66 | // if (this.vlccontrol?.SourceProvider?.MediaPlayer == null) 67 | // { 68 | // k.CanExecute = false; 69 | // return; 70 | // } 71 | // k.CanExecute = this.vlccontrol.SourceProvider.MediaPlayer.State == MediaStates.Paused || this.vlccontrol.SourceProvider.MediaPlayer.State == MediaStates.Playing; 72 | // } 73 | 74 | this.CommandBindings.Add(binding); 75 | } 76 | 77 | 78 | } 79 | 80 | /// 当前播放的路径 81 | public Uri VedioSource 82 | { 83 | get { return (Uri)GetValue(VedioSourceProperty); } 84 | set { SetValue(VedioSourceProperty, value); } 85 | } 86 | 87 | // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... 88 | public static readonly DependencyProperty VedioSourceProperty = 89 | DependencyProperty.Register("VedioSource", typeof(Uri), typeof(VLCPlayer), new PropertyMetadata(default(Uri), (d, e) => 90 | { 91 | VLCPlayer control = d as VLCPlayer; 92 | 93 | if (control == null) return; 94 | 95 | Uri config = e.NewValue as Uri; 96 | 97 | control.InitVlc(); 98 | 99 | control.vlccontrol.SourceProvider.MediaPlayer.Play(config); 100 | 101 | control.toggle_play.IsChecked = false; 102 | 103 | })); 104 | 105 | 106 | VlcControl vlccontrol = null; 107 | 108 | /// 设置当前显示时间 109 | public TimeSpan Time 110 | { 111 | get { return (TimeSpan)GetValue(TimeProperty); } 112 | set { SetValue(TimeProperty, value); } 113 | } 114 | 115 | // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... 116 | public static readonly DependencyProperty TimeProperty = 117 | DependencyProperty.Register("Time", typeof(TimeSpan), typeof(VLCPlayer), new PropertyMetadata(default(TimeSpan), async (d, e) => 118 | { 119 | VLCPlayer control = d as VLCPlayer; 120 | 121 | if (control == null) return; 122 | 123 | TimeSpan config = (TimeSpan)e.NewValue; 124 | 125 | await Task.Run(() => control.vlccontrol.SourceProvider.MediaPlayer.Time = (long)config.TotalMilliseconds); 126 | 127 | })); 128 | 129 | 130 | void InitVlc() 131 | { 132 | 133 | if (this.vlccontrol?.SourceProvider?.MediaPlayer != null) 134 | { 135 | this.vlccontrol.SourceProvider.MediaPlayer.PositionChanged -= MediaPlayer_PositionChanged; 136 | 137 | this.vlccontrol.SourceProvider.MediaPlayer.LengthChanged -= MediaPlayer_LengthChanged; 138 | } 139 | 140 | this.vlccontrol = new VlcControl(); 141 | 142 | this.ControlContainer.Content = this.vlccontrol; 143 | 144 | var currentDirectory = AppDomain.CurrentDomain.BaseDirectory; 145 | 146 | var libDirectory = new DirectoryInfo(System.IO.Path.Combine(currentDirectory, "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64")); 147 | 148 | this.vlccontrol.SourceProvider.CreatePlayer(libDirectory/* pass your player parameters here */); 149 | 150 | //this.vlccontrol.SourceProvider.MediaPlayer.Video.IsMouseInputEnabled = false; 151 | //this.vlccontrol.SourceProvider.MediaPlayer.Video.IsKeyInputEnabled = false; 152 | 153 | this.vlccontrol.SourceProvider.MediaPlayer.PositionChanged += MediaPlayer_PositionChanged; 154 | 155 | this.vlccontrol.SourceProvider.MediaPlayer.LengthChanged += MediaPlayer_LengthChanged; 156 | } 157 | 158 | private void MediaPlayer_LengthChanged(object sender, VlcMediaPlayerLengthChangedEventArgs e) 159 | { 160 | this.InitSlider(); 161 | } 162 | 163 | private void MediaPlayer_PositionChanged(object sender, VlcMediaPlayerPositionChangedEventArgs e) 164 | { 165 | this.RefreshSlider(); 166 | } 167 | 168 | /// 初始化播放进度条 169 | void InitSlider() 170 | { 171 | if (this.vlccontrol?.SourceProvider?.MediaPlayer == null) return; 172 | 173 | this.Dispatcher.Invoke(() => 174 | { 175 | this.media_slider.Maximum = this.vlccontrol.SourceProvider.MediaPlayer.Length; 176 | }); 177 | 178 | } 179 | 180 | /// 刷新当前进度 181 | void RefreshSlider() 182 | { 183 | this.Dispatcher.Invoke(() => 184 | { 185 | this.media_slider.ValueChanged -= this.media_slider_ValueChanged; 186 | 187 | this.media_slider.Value = this.vlccontrol.SourceProvider.MediaPlayer == null ? 0 : this.vlccontrol.SourceProvider.MediaPlayer.Time; 188 | 189 | this.media_slider.ValueChanged += this.media_slider_ValueChanged; 190 | }); 191 | 192 | } 193 | 194 | 195 | private void Button_Click_2(object sender, RoutedEventArgs e) 196 | { 197 | 198 | this.Rate = (float)Math.Round(this.vlccontrol.SourceProvider.MediaPlayer.Rate / (float)1.2, 2); 199 | 200 | } 201 | 202 | 203 | private void Button_Click_3(object sender, RoutedEventArgs e) 204 | { 205 | this.Rate = (float)Math.Round(this.vlccontrol.SourceProvider.MediaPlayer.Rate * (float)1.2, 2); 206 | } 207 | 208 | public float Rate 209 | { 210 | get { return (float)GetValue(RateProperty); } 211 | set { SetValue(RateProperty, value); } 212 | } 213 | 214 | // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... 215 | public static readonly DependencyProperty RateProperty = 216 | DependencyProperty.Register("Rate", typeof(float), typeof(VLCPlayer), new PropertyMetadata(1.0f, (d, e) => 217 | { 218 | VLCPlayer control = d as VLCPlayer; 219 | 220 | if (control == null) return; 221 | 222 | control.vlccontrol.SourceProvider.MediaPlayer.Rate = (float)e.NewValue; 223 | 224 | })); 225 | 226 | 227 | 228 | 229 | 230 | private void Button_Click_4(object sender, RoutedEventArgs e) 231 | { 232 | this.Stop(); 233 | } 234 | 235 | private void ToggleButton_Click(object sender, RoutedEventArgs e) 236 | { 237 | if (this.toggle_play.IsChecked.Value) 238 | { 239 | this.Pause(); 240 | } 241 | else 242 | { 243 | 244 | this.Play(); 245 | } 246 | } 247 | 248 | void Play() 249 | { 250 | if (this.vlccontrol?.SourceProvider?.MediaPlayer == null) return; 251 | 252 | this.vlccontrol?.SourceProvider.MediaPlayer.Play(); 253 | } 254 | 255 | void Pause() 256 | { 257 | if (this.vlccontrol?.SourceProvider?.MediaPlayer == null) return; 258 | 259 | this.vlccontrol?.SourceProvider.MediaPlayer.Pause(); 260 | } 261 | 262 | public void Stop() 263 | { 264 | this.toggle_play.IsChecked = true; 265 | 266 | if (this.vlccontrol?.SourceProvider?.MediaPlayer == null) return; 267 | 268 | this.vlccontrol.SourceProvider.MediaPlayer.PositionChanged -= MediaPlayer_PositionChanged; 269 | 270 | this.vlccontrol.SourceProvider.MediaPlayer.LengthChanged -= MediaPlayer_LengthChanged; 271 | 272 | this.media_slider.Value = 0; 273 | 274 | Task.Run(()=> this.vlccontrol?.Dispose()); 275 | } 276 | 277 | private async void media_slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) 278 | { 279 | long value = (long)this.media_slider.Value; 280 | 281 | await Task.Run(() => this.vlccontrol.SourceProvider.MediaPlayer.Time = value); 282 | } 283 | 284 | private void slider_sound_ValueChanged(object sender, RoutedPropertyChangedEventArgs e) 285 | { 286 | this.RefreshAudio(); 287 | } 288 | 289 | void RefreshAudio() 290 | { 291 | if (this.vlccontrol?.SourceProvider?.MediaPlayer?.Audio == null) return; 292 | 293 | this.vlccontrol.SourceProvider.MediaPlayer.Audio.Volume = (int)this.slider_sound.Value; 294 | } 295 | 296 | 297 | private void FButton_Click_Full(object sender, RoutedEventArgs e) 298 | { 299 | this.vlccontrol.SourceProvider.MediaPlayer.Video.FullScreen = true; 300 | } 301 | 302 | 303 | public IEnumerable ItemSource 304 | { 305 | get { return (IEnumerable)GetValue(ItemSourceProperty); } 306 | set { SetValue(ItemSourceProperty, value); } 307 | } 308 | 309 | // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... 310 | public static readonly DependencyProperty ItemSourceProperty = 311 | DependencyProperty.Register("ItemSource", typeof(IEnumerable), typeof(VLCPlayer), new PropertyMetadata(default(IEnumerable), (d, e) => 312 | { 313 | VLCPlayer control = d as VLCPlayer; 314 | 315 | if (control == null) return; 316 | 317 | IEnumerable config = e.NewValue as IEnumerable; 318 | 319 | })); 320 | 321 | 322 | public object SelectedItem 323 | { 324 | get { return (object)GetValue(SelectedItemProperty); } 325 | set { SetValue(SelectedItemProperty, value); } 326 | } 327 | 328 | // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... 329 | public static readonly DependencyProperty SelectedItemProperty = 330 | DependencyProperty.Register("SelectedItem", typeof(object), typeof(VLCPlayer), new PropertyMetadata(default(object), (d, e) => 331 | { 332 | VLCPlayer control = d as VLCPlayer; 333 | 334 | if (control == null) return; 335 | 336 | object config = e.NewValue as object; 337 | 338 | })); 339 | 340 | 341 | 342 | 343 | public object ContentControl 344 | { 345 | get { return (object)GetValue(ContentControlProperty); } 346 | set { SetValue(ContentControlProperty, value); } 347 | } 348 | 349 | // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... 350 | public static readonly DependencyProperty ContentControlProperty = 351 | DependencyProperty.Register("ContentControl", typeof(object), typeof(VLCPlayer), new PropertyMetadata(default(object), (d, e) => 352 | { 353 | VLCPlayer control = d as VLCPlayer; 354 | 355 | if (control == null) return; 356 | 357 | object config = e.NewValue as object; 358 | 359 | })); 360 | 361 | public TimeSpan GetTime() 362 | { 363 | if (this.vlccontrol?.SourceProvider == null) return TimeSpan.Zero; 364 | 365 | return TimeSpan.FromMilliseconds(this.vlccontrol.SourceProvider.MediaPlayer.Time); 366 | } 367 | 368 | public ImageSource GetVlc() 369 | { 370 | return this.vlccontrol.SourceProvider.VideoSource; 371 | } 372 | 373 | string ShotCutPat { get; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "HeBianGu", Assembly.GetExecutingAssembly().GetName().Name, "ShootCut"); 374 | 375 | //声明和注册路由事件 376 | public static readonly RoutedEvent ShootCutRoutedEvent = 377 | EventManager.RegisterRoutedEvent("ShootCut", RoutingStrategy.Bubble, typeof(EventHandler>), typeof(VLCPlayer)); 378 | //CLR事件包装 379 | public event RoutedEventHandler ShootCut 380 | { 381 | add { this.AddHandler(ShootCutRoutedEvent, value); } 382 | remove { this.RemoveHandler(ShootCutRoutedEvent, value); } 383 | } 384 | 385 | //激发路由事件,借用Click事件的激发方法 386 | 387 | protected void OnShootCut(string uri) 388 | { 389 | ObjectRoutedEventArgs args = new ObjectRoutedEventArgs(ShootCutRoutedEvent, this); 390 | 391 | args.Entity = uri; 392 | 393 | this.RaiseEvent(args); 394 | } 395 | 396 | public async Task BeginShootCut() 397 | { 398 | string name = Path.GetFileNameWithoutExtension(this.VedioSource?.LocalPath); 399 | 400 | string timespan = TimeSpan.FromMilliseconds(this.vlccontrol.SourceProvider.MediaPlayer.Time).Ticks.ToString(); 401 | 402 | string filePath = Path.Combine(ShotCutPat, name, timespan + ".jpg"); 403 | 404 | if (!Directory.Exists(Path.GetDirectoryName(filePath))) 405 | { 406 | Directory.CreateDirectory(Path.GetDirectoryName(filePath)); 407 | } 408 | 409 | return await Task.Run(() => 410 | { 411 | this.vlccontrol.SourceProvider.MediaPlayer.TakeSnapshot(new FileInfo(filePath)); 412 | 413 | return filePath; 414 | }); 415 | } 416 | 417 | 418 | } 419 | 420 | public partial class VLCPlayer 421 | { 422 | public static RoutedUICommand OpenFile = new RoutedUICommand(); 423 | 424 | public static RoutedUICommand ShootCutCommand = new RoutedUICommand(); 425 | } 426 | 427 | public class TimeSpanConverter : IValueConverter 428 | { 429 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 430 | { 431 | if (value == null) return null; 432 | 433 | var d = long.Parse(value.ToString()); 434 | 435 | var sp = TimeSpan.FromMilliseconds(d); 436 | 437 | return sp.ToString().Split('.')[0]; 438 | } 439 | 440 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 441 | { 442 | throw new NotImplementedException(); 443 | } 444 | } 445 | 446 | } 447 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.General.VLCMediaPlayer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/HeBianGu.Product.General.MediaPlayer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {9AA2D32F-9F7D-439A-B591-79F1D30CE230} 8 | library 9 | HeBianGu.Product.General.MediaPlayer 10 | HeBianGu.Product.General.MediaPlayer 11 | v4.5 12 | 512 13 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 14 | 4 15 | 16 | 17 | true 18 | full 19 | false 20 | ..\..\..\Product\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\HeBianGu.Base.WpfBase.2.1.4\lib\net45\HeBianGu.Base.WpfBase.dll 36 | 37 | 38 | ..\..\..\Solution\HeBianGu.Product.MediaPlayer\packages\HeBianGu.General.WpfControlLib.2.1.4\lib\net45\HeBianGu.General.WpfControlLib.dll 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 4.0 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | MediaPlayer.xaml 59 | 60 | 61 | Code 62 | 63 | 64 | True 65 | True 66 | Resources.resx 67 | 68 | 69 | True 70 | Settings.settings 71 | True 72 | 73 | 74 | ResXFileCodeGenerator 75 | Resources.Designer.cs 76 | 77 | 78 | 79 | SettingsSingleFileGenerator 80 | Settings.Designer.cs 81 | 82 | 83 | 84 | 85 | MSBuild:Compile 86 | Designer 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/HeBianGu.Product.General.MediaPlayer.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $id$ 5 | $version$ 6 | $title$ 7 | $author$ 8 | $author$ 9 | http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE 10 | http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE 11 | http://ICON_URL_HERE_OR_DELETE_THIS_LINE 12 | false 13 | $description$ 14 | Summary of changes made in this release of the package. 15 | Copyright 2019 16 | Tag1 Tag2 17 | 18 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/MediaPlayer.xaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 20 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/MediaPlayer.xaml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Win32; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Diagnostics; 5 | using System.Globalization; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Timers; 10 | using System.Windows; 11 | using System.Windows.Controls; 12 | using System.Windows.Data; 13 | using System.Windows.Documents; 14 | using System.Windows.Input; 15 | using System.Windows.Media; 16 | using System.Windows.Media.Imaging; 17 | using System.Windows.Navigation; 18 | using System.Windows.Shapes; 19 | 20 | namespace HeBianGu.Product.General.MediaPlayer 21 | { 22 | /// 23 | /// MediaPlayer.xaml 的交互逻辑 24 | /// 25 | public partial class MediaPlayer : UserControl 26 | { 27 | public MediaPlayer() 28 | { 29 | InitializeComponent(); 30 | 31 | CommandBinding binding = new CommandBinding(MediaPlayer.OpenFile, (l, k) => 32 | { 33 | OpenFileDialog dialog = new OpenFileDialog(); 34 | 35 | var r = dialog.ShowDialog(); 36 | 37 | if (r.HasValue && r.Value) 38 | { 39 | this.VedioSource = new Uri(dialog.FileName, UriKind.Absolute); 40 | } 41 | 42 | }); 43 | 44 | this.CommandBindings.Add(binding); 45 | 46 | this.media_media.MediaEnded += Player_MediaEnded; 47 | this.media_media.MediaOpened += Player_MediaOpened; 48 | this.media_media.MediaFailed += Player_MediaFailed; 49 | this.media_media.Loaded += Player_Loaded; 50 | 51 | _timer.Elapsed += Timer_Elapsed; 52 | _timer.Interval = 1000; 53 | 54 | } 55 | 56 | 57 | private void Timer_Elapsed(object sender, ElapsedEventArgs e) 58 | { 59 | this.RefreshSlider(); 60 | } 61 | 62 | Timer _timer = new Timer(); 63 | 64 | private void Player_Loaded(object sender, RoutedEventArgs e) 65 | { 66 | Debug.WriteLine("Player_Loaded"); 67 | } 68 | 69 | void InitSlider() 70 | { 71 | if (this.media_media.Source == null) return; 72 | 73 | if (this.media_media.NaturalDuration.HasTimeSpan) 74 | { 75 | this.media_slider.Maximum = this.media_media.NaturalDuration.TimeSpan.Ticks; 76 | } 77 | } 78 | 79 | void RefreshSlider() 80 | { 81 | Application.Current.Dispatcher.Invoke(() => 82 | { 83 | this.media_slider.Value = this.media_media.Position.Ticks; 84 | }); 85 | 86 | } 87 | 88 | private void Player_MediaFailed(object sender, ExceptionRoutedEventArgs e) 89 | { 90 | MessageBox.Show(e.ErrorException.Message); 91 | Debug.WriteLine("Player_MediaFailed"); 92 | 93 | } 94 | 95 | private void Player_MediaOpened(object sender, RoutedEventArgs e) 96 | { 97 | Debug.WriteLine("Player_MediaOpened"); 98 | 99 | this.InitSlider(); 100 | 101 | this.InitSound(); 102 | 103 | this._timer.Start(); 104 | } 105 | 106 | private void Player_MediaEnded(object sender, RoutedEventArgs e) 107 | { 108 | Debug.WriteLine("Player_MediaEnded"); 109 | 110 | this.Stop(); 111 | } 112 | 113 | 114 | private void media_slider_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e) 115 | { 116 | if (this.media_media == null) return; 117 | 118 | this.media_media.Position = TimeSpan.FromTicks((long)this.media_slider.Value); 119 | 120 | this._timer.Start(); 121 | } 122 | 123 | void InitSound() 124 | { 125 | this.slider_sound.Value = this.media_media.Volume; 126 | } 127 | 128 | private void slider_sound_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e) 129 | { 130 | this.media_media.Volume = this.slider_sound.Value; 131 | } 132 | 133 | private void Button_Click_2(object sender, RoutedEventArgs e) 134 | { 135 | this.media_media.SpeedRatio = this.media_media.SpeedRatio / 2; 136 | } 137 | 138 | private void Button_Click_3(object sender, RoutedEventArgs e) 139 | { 140 | this.media_media.SpeedRatio = this.media_media.SpeedRatio * 2; 141 | } 142 | 143 | private void Button_Click_4(object sender, RoutedEventArgs e) 144 | { 145 | this.Stop(); 146 | } 147 | 148 | private void media_slider_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e) 149 | { 150 | this._timer.Stop(); 151 | } 152 | 153 | private void ToggleButton_Click(object sender, RoutedEventArgs e) 154 | { 155 | if (this.toggle_play.IsChecked.Value) 156 | { 157 | this.Pause(); 158 | } 159 | else 160 | { 161 | 162 | this.Play(); 163 | } 164 | } 165 | 166 | private void CommandBinding_Executed_Play(object sender, ExecutedRoutedEventArgs e) 167 | { 168 | 169 | Debug.WriteLine("CommandBinding_Executed_Play"); 170 | 171 | } 172 | 173 | private void CommandBinding_CanExecute_Play(object sender, CanExecuteRoutedEventArgs e) 174 | { 175 | e.CanExecute = true; 176 | } 177 | 178 | private void MediaBrower_PlayClick(object sender, RoutedEventArgs e) 179 | { 180 | this.media_media.Stop(); 181 | this.media_media.Play(); 182 | this.toggle_play.IsChecked = false; 183 | } 184 | 185 | void Play() 186 | { 187 | this.media_media.Play(); 188 | this._timer.Start(); 189 | } 190 | 191 | void Pause() 192 | { 193 | this.media_media.Pause(); 194 | this._timer.Stop(); 195 | } 196 | 197 | void Stop() 198 | { 199 | this.media_media.Position = TimeSpan.FromTicks(0); 200 | this.media_slider.Value = 0; 201 | this.media_media.Stop(); 202 | this._timer.Stop(); 203 | this.toggle_play.IsChecked = true; 204 | this.media_media.LoadedBehavior = MediaState.Manual; 205 | } 206 | 207 | public Uri VedioSource 208 | { 209 | get { return (Uri)GetValue(VedioSourceProperty); } 210 | set { SetValue(VedioSourceProperty, value); } 211 | } 212 | 213 | // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... 214 | public static readonly DependencyProperty VedioSourceProperty = 215 | DependencyProperty.Register("VedioSource", typeof(Uri), typeof(MediaPlayer), new PropertyMetadata(default(Uri), (d, e) => 216 | { 217 | MediaPlayer control = d as MediaPlayer; 218 | 219 | if (control == null) return; 220 | 221 | Uri config = e.NewValue as Uri; 222 | 223 | control.media_media.Source = config; 224 | 225 | control.Stop(); 226 | 227 | })); 228 | 229 | 230 | 231 | } 232 | 233 | public partial class MediaPlayer 234 | { 235 | public static RoutedUICommand OpenFile = new RoutedUICommand(); 236 | } 237 | 238 | public class TimeSpanConverter : IValueConverter 239 | { 240 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) 241 | { 242 | if (value == null) return null; 243 | 244 | //if (value.ToString() == "0") return "0"; 245 | //if (value.ToString() == "100") return "100"; 246 | 247 | var d = double.Parse(value.ToString()); 248 | 249 | var sp = TimeSpan.FromTicks((long)d); 250 | 251 | return sp.ToString().Split('.')[0]; 252 | } 253 | 254 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) 255 | { 256 | throw new NotImplementedException(); 257 | } 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("HeBianGu.Product.General.MediaPlayer")] 11 | [assembly: AssemblyDescription("视频播放控件")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("河边骨")] 14 | [assembly: AssemblyProduct("HeBianGu.Product.General.MediaPlayer")] 15 | [assembly: AssemblyCopyright("Copyright © 2019")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly:ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 52 | // 方法是按如下所示使用“*”: : 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本: 4.0.30319.42000 5 | // 6 | // 对此文件的更改可能导致不正确的行为,如果 7 | // 重新生成代码,则所做更改将丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HeBianGu.Product.General.MediaPlayer.Properties { 12 | 13 | 14 | /// 15 | /// 强类型资源类,用于查找本地化字符串等。 16 | /// 17 | // 此类是由 StronglyTypedResourceBuilder 18 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 19 | // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen 20 | // (以 /str 作为命令选项),或重新生成 VS 项目。 21 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 22 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 23 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 24 | internal class Resources { 25 | 26 | private static global::System.Resources.ResourceManager resourceMan; 27 | 28 | private static global::System.Globalization.CultureInfo resourceCulture; 29 | 30 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 31 | internal Resources() { 32 | } 33 | 34 | /// 35 | /// 返回此类使用的缓存 ResourceManager 实例。 36 | /// 37 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 38 | internal static global::System.Resources.ResourceManager ResourceManager { 39 | get { 40 | if ((resourceMan == null)) { 41 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HeBianGu.Product.General.MediaPlayer.Properties.Resources", typeof(Resources).Assembly); 42 | resourceMan = temp; 43 | } 44 | return resourceMan; 45 | } 46 | } 47 | 48 | /// 49 | /// 覆盖当前线程的 CurrentUICulture 属性 50 | /// 使用此强类型的资源类的资源查找。 51 | /// 52 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 53 | internal static global::System.Globalization.CultureInfo Culture { 54 | get { 55 | return resourceCulture; 56 | } 57 | set { 58 | resourceCulture = value; 59 | } 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace HeBianGu.Product.General.MediaPlayer.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/nuget-package.bat: -------------------------------------------------------------------------------- 1 | cd %~dp0 2 | 3 | nuget spec -force 4 | 5 | nuget pack -force 6 | 7 | pause -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/nuget-push.bat: -------------------------------------------------------------------------------- 1 | cd %~dp0 2 | 3 | nuget push HeBianGu.Product.General.MediaPlayer.1.0.0.nupkg oy2lfjc4ymnhdcxigvuqmuzrtgedc3aufgfool4is6aj5q -Source https://api.nuget.org/v3/index.json 4 | 5 | pause -------------------------------------------------------------------------------- /Source/General/HeBianGu.Product.General.MediaPlayer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /settings.xamlstyler: -------------------------------------------------------------------------------- 1 | { 2 | "AttributesTolerance": 1, 3 | "KeepFirstAttributeOnSameLine": true, 4 | "MaxAttributeCharactersPerLine": 0, 5 | "MaxAttributesPerLine": 1, 6 | "NewlineExemptionElements": "RadialGradientBrush, GradientStop, LinearGradientBrush, ScaleTransform, SkewTransform, RotateTransform, TranslateTransform, Trigger, Condition, Setter", 7 | "SeparateByGroups": false, 8 | "AttributeIndentation": 0, 9 | "AttributeIndentationStyle": 1, 10 | "RemoveDesignTimeReferences": false, 11 | "EnableAttributeReordering": true, 12 | "AttributeOrderingRuleGroups": [ 13 | "x:Class", 14 | "xmlns, xmlns:x", 15 | "xmlns:*", 16 | "x:Key, Key, x:Name, Name, x:Uid, Uid, Title", 17 | "Grid.Row, Grid.RowSpan, Grid.Column, Grid.ColumnSpan, Canvas.Left, Canvas.Top, Canvas.Right, Canvas.Bottom", 18 | "Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight", 19 | "Margin, Padding, HorizontalAlignment, VerticalAlignment, HorizontalContentAlignment, VerticalContentAlignment, Panel.ZIndex", 20 | "*:*, *", 21 | "PageSource, PageIndex, Offset, Color, TargetName, Property, Value, StartPoint, EndPoint", 22 | "mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText", 23 | "Storyboard.*, From, To, Duration" 24 | ], 25 | "FirstLineAttributes": "", 26 | "OrderAttributesByName": true, 27 | "PutEndingBracketOnNewLine": false, 28 | "RemoveEndingTagOfEmptyElement": true, 29 | "SpaceBeforeClosingSlash": true, 30 | "RootElementLineBreakRule": 0, 31 | "ReorderVSM": 1, 32 | "ReorderGridChildren": false, 33 | "ReorderCanvasChildren": false, 34 | "ReorderSetters": 0, 35 | "FormatMarkupExtension": true, 36 | "NoNewLineMarkupExtensions": "x:Bind, Binding", 37 | "ThicknessSeparator": 2, 38 | "ThicknessAttributes": "Margin, Padding, BorderThickness, ThumbnailClipMargin", 39 | "FormatOnSave": true, 40 | "CommentPadding": 2, 41 | "IndentSize": 4 42 | } --------------------------------------------------------------------------------