Browse Source

zhao:优化

tags/录制修改前
耀 4 years ago
parent
commit
dba5a59e9f

+ 2
- 0
Common/system/FFMpeg.cs View File

554
             }
554
             }
555
             return devs;
555
             return devs;
556
         }
556
         }
557
+
558
+
557
     }
559
     }
558
 }
560
 }

+ 4
- 0
Common/system/FileToolsCommon.cs View File

922
         }
922
         }
923
         #endregion
923
         #endregion
924
         #endregion
924
         #endregion
925
+
926
+        #region 获取媒体文件的播放时长
927
+
928
+        #endregion
925
     }
929
     }
926
 }
930
 }

+ 5
- 0
XHWK.WKTool/FileDirectoryWindow.xaml.cs View File

106
                     continue;
106
                     continue;
107
                 foreach(Model_Video videoinfo in Vdata.VideoList)
107
                 foreach(Model_Video videoinfo in Vdata.VideoList)
108
                 {
108
                 {
109
+                    if (string.IsNullOrWhiteSpace(videoinfo.VideoSize)|| videoinfo.VideoSize=="0 MB")
110
+                    {
111
+                        videoinfo.VideoSize = FileToolsCommon.GetFileSizeByMB(videoinfo.VideoPath).ToString() + " MB";
112
+                    }
109
                     model_VideoList.Add(videoinfo);
113
                     model_VideoList.Add(videoinfo);
114
+
110
                 }
115
                 }
111
             }
116
             }
112
         }
117
         }

+ 1
- 21
XHWK.WKTool/ScreenRecordingToolbarWindow.xaml.cs View File

178
                     //FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
178
                     //FileToolsCommon.DeleteDirectory(APP.WKData.WkPath + "temp/");
179
                     FileToolsCommon.CreateDirectory(RecordingPath);
179
                     FileToolsCommon.CreateDirectory(RecordingPath);
180
                     VideoSavePathName = RecordingPath + APP.WKData.WkName + "_录屏." + ((Enum_VideoType)int.Parse(FileToolsCommon.GetConfigValue("VideoType"))).ToString();
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
                     IsFirstRS = false;
181
                     IsFirstRS = false;
202
                 }
182
                 }
203
                 IsSuspend = false;
183
                 IsSuspend = false;
289
                             Thread.Sleep(100);
269
                             Thread.Sleep(100);
290
                         }
270
                         }
291
                         FileToolsCommon.DeleteFile(ThumbnailPathName);
271
                         FileToolsCommon.DeleteFile(ThumbnailPathName);
292
-                        VideoInfo.VideoSize = FileToolsCommon.GetFileSizeByMB(VideoSavePathName).ToString() + " MB";
272
+                        //VideoInfo.VideoSize = FileToolsCommon.GetFileSizeByMB(VideoSavePathName).ToString() + " MB";
293
                         VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
273
                         VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
294
                         VideoInfo.VideoPath = VideoSavePathName;
274
                         VideoInfo.VideoPath = VideoSavePathName;
295
                         VideoInfo.ThumbnailPath = ThumbnailPathName;
275
                         VideoInfo.ThumbnailPath = ThumbnailPathName;

+ 1
- 1
XHWK.WKTool/XHMicroLessonSystemWindow.xaml View File

52
                         <StackPanel Orientation="Vertical">
52
                         <StackPanel Orientation="Vertical">
53
                             <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
53
                             <Image x:Name="ImgScreenRecording" Source="./Images/microLessonSystem_2.png"/>
54
                             <Image x:Name="ImgScreenRecordingTwo" Source="./Images/microLessonSystem_3.png" Visibility="Collapsed"/>
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
                         </StackPanel>
56
                         </StackPanel>
57
                     </Button>
57
                     </Button>
58
                     <Button Cursor="Hand" x:Name="btnScreenshot" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Margin="30,0,30,0" Click="BtnScreenshot_Click">
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 View File

268
                 Login();
268
                 Login();
269
                 return;
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
             if (APP.W_ScreenRecordingToolbarWindow == null)
292
             if (APP.W_ScreenRecordingToolbarWindow == null)
272
             {
293
             {
273
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
294
                 APP.W_ScreenRecordingToolbarWindow = new ScreenRecordingToolbarWindow
288
             APP.W_ScreenRecordingToolbarWindow.Topmost = true;
309
             APP.W_ScreenRecordingToolbarWindow.Topmost = true;
289
             APP.W_ScreenRecordingToolbarWindow.Show();
310
             APP.W_ScreenRecordingToolbarWindow.Show();
290
             Hide();
311
             Hide();
312
+            TxbRecordScreenWord.Text = "已录屏";
291
         }
313
         }
292
         /// <summary>
314
         /// <summary>
293
         /// 上传事件
315
         /// 上传事件
1250
                 btnLoginType.IsEnabled = true;
1272
                 btnLoginType.IsEnabled = true;
1251
                 IsSuspendR = true;
1273
                 IsSuspendR = true;
1252
                 ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
1274
                 ImgRecord.Source = new BitmapImage(new Uri("pack://application:,,,/Images/microLessonSystem_14.png"));
1253
-                TxbRecordingWord.Text = "录制";
1275
+                TxbRecordingWord.Text = "录制";
1254
                 try
1276
                 try
1255
                 {
1277
                 {
1256
                     APP.FFmpeg.StopFFmpeg(AudioPathName);
1278
                     APP.FFmpeg.StopFFmpeg(AudioPathName);
1288
                         }
1310
                         }
1289
                         FileToolsCommon.DeleteFile(ThumbnailPathName);
1311
                         FileToolsCommon.DeleteFile(ThumbnailPathName);
1290
                         VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
1312
                         VideoInfo.RSTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
1313
+                        //VideoInfo.VideoSize = FileToolsCommon.GetFileSizeByMB(VideoSavePathName).ToString() + " MB";
1291
                         VideoInfo.VideoPath = VideoSavePathName;
1314
                         VideoInfo.VideoPath = VideoSavePathName;
1292
                         VideoInfo.ThumbnailPath = ThumbnailPathName;
1315
                         VideoInfo.ThumbnailPath = ThumbnailPathName;
1293
-                        Thread.Sleep(500);
1294
-                        VideoInfo.VideoSize = FileToolsCommon.GetFileSizeByMB(VideoSavePathName).ToString() + " MB";
1295
                         APP.FFmpeg.GenerateThumbnails(VideoSavePathName, ThumbnailPathName);
1316
                         APP.FFmpeg.GenerateThumbnails(VideoSavePathName, ThumbnailPathName);
1296
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
1317
                         VideoInfo.FileGuid = Guid.NewGuid().ToString();
1297
                         VideoInfo.IsUpload = false;
1318
                         VideoInfo.IsUpload = false;

Loading…
Cancel
Save