浏览代码

Merge remote-tracking branch 'origin/zyy' into zhangxueyang

tags/录制修改前
zhangxueyang 4 年前
父节点
当前提交
a6fb4f64be

+ 2
- 0
Common/system/FFMpeg.cs 查看文件

@@ -554,5 +554,7 @@ namespace Common.system
554 554
             }
555 555
             return devs;
556 556
         }
557
+
558
+
557 559
     }
558 560
 }

+ 4
- 0
Common/system/FileToolsCommon.cs 查看文件

@@ -922,5 +922,9 @@ namespace Common.system
922 922
         }
923 923
         #endregion
924 924
         #endregion
925
+
926
+        #region 获取媒体文件的播放时长
927
+
928
+        #endregion
925 929
     }
926 930
 }

+ 5
- 0
XHWK.WKTool/FileDirectoryWindow.xaml.cs 查看文件

@@ -120,7 +120,12 @@ namespace XHWK.WKTool
120 120
                     continue;
121 121
                 foreach(Model_Video videoinfo in Vdata.VideoList)
122 122
                 {
123
+                    if (string.IsNullOrWhiteSpace(videoinfo.VideoSize)|| videoinfo.VideoSize=="0 MB")
124
+                    {
125
+                        videoinfo.VideoSize = FileToolsCommon.GetFileSizeByMB(videoinfo.VideoPath).ToString() + " MB";
126
+                    }
123 127
                     model_VideoList.Add(videoinfo);
128
+
124 129
                 }
125 130
             }
126 131
         }

+ 1
- 21
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs 查看文件

@@ -178,26 +178,6 @@ namespace XHWK.WKTool
178 178
                     //FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
179 179
                     FileToolsCommon.CreateDirectory(RecordingPath);
180 180
                     VideoSavePathName = RecordingPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
181
-                    if (FileToolsCommon.IsExistFile(VideoSavePathName))
182
-                    {
183
-                        MessageBoxResult dr = System.Windows.MessageBox.Show("已存在录屏,是否覆盖?", "提示", MessageBoxButton.OKCancel);
184
-                        if (dr == MessageBoxResult.OK)
185
-                        {
186
-                            try
187
-                            {
188
-                                FileToolsCommon.DeleteFile(VideoSavePathName);
189
-                                APP.VideoList.RemoveAll(x => x.VideoPath == VideoSavePathName);
190
-                            }
191
-                            catch (Exception ex)
192
-                            {
193
-                                LogHelper.WriteErrLog("【录屏】(BtnRecordingScreen_Click)无法移除视频," + ex.Message, ex);
194
-                            }
195
-                        }
196
-                        else
197
-                        {
198
-                            return;
199
-                        }
200
-                    }
201 181
                     IsFirstRS = false;
202 182
                 }
203 183
                 IsSuspend = false;
@@ -289,7 +269,7 @@ namespace XHWK.WKTool
289 269
                             Thread.Sleep(100);
290 270
                         }
291 271
                         FileToolsCommon.DeleteFile(ThumbnailPathName);
292
-                        VideoInfo.VideoSize = FileToolsCommon.GetFileSizeByMB(VideoSavePathName).ToString() + " MB";
272
+                        //VideoInfo.VideoSize = FileToolsCommon.GetFileSizeByMB(VideoSavePathName).ToString() + " MB";
293 273
                         VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
294 274
                         VideoInfo.VideoPath = VideoSavePathName;
295 275
                         VideoInfo.ThumbnailPath = ThumbnailPathName;

+ 1
- 1
XHWK.WKTool/XHMicroLessonSystemWindow.xaml 查看文件

@@ -52,7 +52,7 @@
52 52
                         <StackPanel Orientation="Vertical">
53 53
                             <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
54 54
                             <Image x:Name="ImgScreenRecordingTwo" Source="./Images/microLessonSystem_3.png" Visibility="Collapsed"/>
55
-                            <TextBlock Text="录屏" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
55
+                            <TextBlock x:Name="TxbRecordScreenWord" Text="录屏" FontSize="14" Foreground="#FFFFFF" HorizontalAlignment="Center"/>
56 56
                         </StackPanel>
57 57
                     </Button>
58 58
                     <Button Cursor="Hand" x:Name="btnScreenshot" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,30,0" Click="BtnScreenshot_Click">

+ 24
- 3
XHWK.WKTool/XHMicroLessonSystemWindow.xaml.cs 查看文件

@@ -268,6 +268,27 @@ namespace XHWK.WKTool
268 268
                 Login();
269 269
                 return;
270 270
             }
271
+            string RecordScreenPathName = APP.WKData.WkPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
272
+            if (FileToolsCommon.IsExistFile(RecordScreenPathName))
273
+            {
274
+                MessageBoxResult dr = System.Windows.MessageBox.Show("已存在录屏,是否覆盖?", "提示", MessageBoxButton.OKCancel);
275
+                if (dr == MessageBoxResult.OK)
276
+                {
277
+                    try
278
+                    {
279
+                        FileToolsCommon.DeleteFile(RecordScreenPathName);
280
+                        APP.VideoList.RemoveAll(x => x.VideoPath == RecordScreenPathName);
281
+                    }
282
+                    catch (Exception ex)
283
+                    {
284
+                        LogHelper.WriteErrLog("【录屏】(BtnRecordingScreen_Click)无法移除视频," + ex.Message, ex);
285
+                    }
286
+                }
287
+                else
288
+                {
289
+                    return;
290
+                }
291
+            }
271 292
             if (APP.W_ScreenRecordingToolbarWindow == null)
272 293
             {
273 294
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
@@ -288,6 +309,7 @@ namespace XHWK.WKTool
288 309
             APP.W_ScreenRecordingToolbarWindow.Topmost = true;
289 310
             APP.W_ScreenRecordingToolbarWindow.Show();
290 311
             Hide();
312
+            TxbRecordScreenWord.Text = "已录屏";
291 313
         }
292 314
         /// <summary>
293 315
         /// 上传事件
@@ -1250,7 +1272,7 @@ namespace XHWK.WKTool
1250 1272
                 btnLoginType.IsEnabled = true;
1251 1273
                 IsSuspendR = true;
1252 1274
                 ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
1253
-                TxbRecordingWord.Text = "录制";
1275
+                TxbRecordingWord.Text = "录制";
1254 1276
                 try
1255 1277
                 {
1256 1278
                     APP.FFmpeg.StopFFmpeg(AudioPathName);
@@ -1288,10 +1310,9 @@ namespace XHWK.WKTool
1288 1310
                         }
1289 1311
                         FileToolsCommon.DeleteFile(ThumbnailPathName);
1290 1312
                         VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
1313
+                        //VideoInfo.VideoSize = FileToolsCommon.GetFileSizeByMB(VideoSavePathName).ToString() + " MB";
1291 1314
                         VideoInfo.VideoPath = VideoSavePathName;
1292 1315
                         VideoInfo.ThumbnailPath = ThumbnailPathName;
1293
-                        Thread.Sleep(500);
1294
-                        VideoInfo.VideoSize = FileToolsCommon.GetFileSizeByMB(VideoSavePathName).ToString() + " MB";
1295 1316
                         APP.FFmpeg.GenerateThumbnails(VideoSavePathName, ThumbnailPathName);
1296 1317
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
1297 1318
                         VideoInfo.IsUpload = false;

正在加载...
取消
保存