diff --git a/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib b/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib index dcdfd155..74beea57 100644 --- a/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib +++ b/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib @@ -23,5 +23,11 @@ mergeInto(LibraryManager.library, { }); } else { } + }, + WebGLDownloadVideo: function(ptr,fileName) { + var url = UTF8ToString(ptr); + var name = UTF8ToString(fileName); + DownloadVideoFromUrl(url,name); + } }); diff --git a/Assets/WebGLDownLoadWord/Scripts/DownLoadWord/WebGLDownLoadFileScripts/WebGLDownLoadFile.cs b/Assets/WebGLDownLoadWord/Scripts/DownLoadWord/WebGLDownLoadFileScripts/WebGLDownLoadFile.cs index c93c13bf..0cdb510f 100644 --- a/Assets/WebGLDownLoadWord/Scripts/DownLoadWord/WebGLDownLoadFileScripts/WebGLDownLoadFile.cs +++ b/Assets/WebGLDownLoadWord/Scripts/DownLoadWord/WebGLDownLoadFileScripts/WebGLDownLoadFile.cs @@ -16,6 +16,11 @@ public class WebGLDownLoadFile : MonoSingleton [DllImport("__Internal")] private static extern void WebGLDownloadWord(byte[] array, int size, string reportjson); + [DllImport("__Internal")] + private static extern void WebGLDownloadVideo(string url, string fileName = "实验视频.mp4"); + + + /// /// 下载Word 方法 /// @@ -63,4 +68,9 @@ public class WebGLDownLoadFile : MonoSingleton WebGLDownloadWord(bytes, bytes.Length, reportjson); } + public void DownloadVideo(string url, string fileName = "实验视频.mp4") + { + WebGLDownloadVideo(url, fileName); + } + } diff --git a/Assets/WebGLTemplates/MyIndex/index.html b/Assets/WebGLTemplates/MyIndex/index.html index 0be98416..911b47fe 100644 --- a/Assets/WebGLTemplates/MyIndex/index.html +++ b/Assets/WebGLTemplates/MyIndex/index.html @@ -1,30 +1,30 @@ - + 虚拟实验 | {{{ PRODUCT_NAME }}} - - - - - - - + + + + + + +
- -
-
-
+ +
+
+
+
+
+
+ -
-
-
- +