热卖商品
新闻详情
在wp8中调用captureSource.Start()时发生System.NotSupported-789找
来自 : www.789zhao.com/blog/JEU5KB6RJ
发布时间:2021-03-25
System.NotSupportedException: Specified method is not supportedI\'m getting this error sometimes while calling Start method of captureSource to record video on windows phone 8.
Below is my code :
if (captureSource.VideoCaptureDevice != null captureSource.State == CaptureState.Started) captureSource.Stop(); //UpdateUI(ButtonState.Recording, \"Initializing...\"); //Create Dir If Not Exist if (!IsolatedStorageFile.GetUserStoreForApplication().DirectoryExists(FileLocation)) IsolatedStorageFile.GetUserStoreForApplication().CreateDirectory(FileLocation); DateTime theDate = DateTime.Now; isoVideoFileName = theDate.ToString(\"yyyyMMdd\") + \"_\" + theDate.ToString(\"HHmmss\") + \"_\" + \"Video\" + \".\" + GlobalDTO.VideoFormat; // Connect the input and output of fileSink. captureSource = new CaptureSource(); captureSource.CaptureFailed += new EventHandler ExceptionRoutedEventArgs (OnCaptureFailed); captureSource.CaptureImageCompleted += captureSource_CaptureImageCompleted; fileSink.CaptureSource = captureSource; fileSink.IsolatedStorageFileName = FileLocation + isoVideoFileName; // Begin recording. if (captureSource.VideoCaptureDevice != null captureSource.State == CaptureState.Stopped) videoRecorderBrush.SetSource(captureSource); captureSource.Start(); captureSource.CaptureImageAsync(); // Set the button states and the message. UpdateUI(ButtonState.Recording, \"Recording...\");Talk1:You need to capture the exception details and put them in an edit. That doesn t mean taking a picture of them, btw.Talk2:I caught the exception but found that InnerException is null , Message is Specified method is not supported. and Source is System.Windows .Talk3:Call stack. You have to learn that the exception details contain everything you need to track down your problem.Solutions1
That feature may not be supported on all phones? That maybe why you are getting that exception. you should catch the exception and handle it in an appropriate way to inform the user the functionality is not supported.
Talk1:Thanks Timmy, but my code is working and I m getting this error sometimes instead everytime.本文链接: http://dtothewp.immuno-online.com/view-750012.html
发布于 : 2021-03-25
阅读(0)
最新动态
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25
2021-03-25