Browse Source

Add smart publisher sdk.

justin.xing 3 years ago
parent
commit
47bc26b79c

+ 9 - 1
fis/IPlatformService.cs

@@ -2,7 +2,15 @@ namespace fis
 {
     public interface IPlatformService
     {
-        
+        string GetPlatformName();
+
+        //string ShowOpenFileDialog(string filter, string fileName);
+
+        //string ShowSaveFileDialog(string filter, string filenName);
+
+        //void SaveToFile(string filePath, byte[] data);
+
+        //byte[] ReadFromFile(string filePath)
     }
 
 }

+ 4 - 1
fis/MacService.cs

@@ -2,7 +2,10 @@ namespace fis
 {
     public class MacService : IPlatformService
     {
-
+        public string GetPlatformName()
+        {
+            return "MacOS-X64";
+        }
     }
 
 }

+ 5 - 2
fis/MainWindow.axaml.cs

@@ -3,6 +3,7 @@ using System.IO;
 using Avalonia;
 using Avalonia.Controls;
 using Avalonia.Markup.Xaml;
+using Xilium.CefGlue;
 using Xilium.CefGlue.Avalonia;
 using Xilium.CefGlue.Common.Handlers;
 
@@ -32,19 +33,21 @@ namespace fis
             {
                 platformService = new WinService();
             }
-            else if (Environment.OSVersion.Platform == PlatformID.MacOSX)
+            else if (Environment.OSVersion.Platform == PlatformID.Unix)
             {
                 platformService = new MacService();
             }
             else
             {
-                throw new NotSupportedException($"Platform {Environment.OSVersion.Platform} is not suppoorted");
+                throw new NotSupportedException($"Platform {Environment.OSVersion.Platform} is not suppoorted.");
             }
             var platformHandler = new JsonRpcHandler<IPlatformService>(ShellConfig.Instance.LocalApiHost, platformService);
             var handler = new HostRequestHandler();
             handler.RegisterHostHandler(appHandler);
             handler.RegisterHostHandler(platformHandler);
             _browser = new AvaloniaCefBrowser();
+            //Make cross domain work.
+            _browser.Settings.WebSecurity = CefState.Disabled;
             _browser.Address = ShellConfig.Instance.AppHost;
             _browser.RequestHandler = handler;
             _browser.ContextMenuHandler = new TextContextMenuHandler(_browser);

+ 4 - 1
fis/WinService.cs

@@ -2,7 +2,10 @@ namespace fis
 {
     public class WinService : IPlatformService
     {
-
+        public string GetPlatformName()
+        {
+            return "Win-X86";
+        }
     }
 
 }

+ 6 - 0
fis/fis.Win.csproj

@@ -14,4 +14,10 @@
     <PackageReference Include="JsonRpcLite" Version="1.0.0" />
     <PackageReference Include="Vinno.CefGlue.Avalonia" Version="1.0.0" />
    </ItemGroup>
+  <Target Name="BuildAppWin" AfterTargets="AfterBuild">
+	  <Exec Command="xcopy $(ProjectDir)..\third_party\SmartPublisher\*.*  $(ProjectDir)bin\Release\net5.0\win-x86\*.* /Y" />
+  </Target>
+  <Target Name="PublishAppWin" AfterTargets="AfterPublish">
+    <Exec Command="xcopy $(ProjectDir)..\third_party\SmartPublisher\*.*  $(ProjectDir)bin\Release\net5.0\win-x86\publish /Y" />
+  </Target>
 </Project>

BIN
third_party/SmartPublisher/NTSmartPublisherWinRTSDK.dll


BIN
third_party/SmartPublisher/SmartLog.dll


BIN
third_party/SmartPublisher/SmartPublisherSDK.dll


BIN
third_party/SmartPublisher/avcodec-58.dll


BIN
third_party/SmartPublisher/avdevice-58.dll


BIN
third_party/SmartPublisher/avfilter-7.dll


BIN
third_party/SmartPublisher/avformat-58.dll


BIN
third_party/SmartPublisher/avutil-56.dll


BIN
third_party/SmartPublisher/postproc-55.dll


BIN
third_party/SmartPublisher/swresample-3.dll


BIN
third_party/SmartPublisher/swscale-5.dll