2016-08-05 16 views
1

15秒後にビデオ再生を停止しようとしていますが、動作していません。これを達成する方法を教えてください。15秒後にビデオを録画を停止する

CameraCaptureUI captureUI = new CameraCaptureUI(); 
captureUI.VideoSettings.Format = CameraCaptureUIVideoFormat.Mp4; 
StorageFile videoFile = await captureUI.CaptureFileAsync(CameraCaptureUIMode.Video); 
if (videoFile == null) 
{ 
    // User cancelled photo capture 
    return; 
} 

答えて

0

System.Timersを使用すると、それを達成できます。私はあなたが使用しているライブラリについてはあまりよく分かりませんが、Timerを使うとかなり簡単に行うことができます。 [リンク](http://stackoverflow.com/:?

using System.Timers; 
static void Main(string[] args) 
    { 
     Timer tmr = new Timer(); 

     int seconds = 15; // Not needed, only for demonstration purposes 

     tmr.Interval = 1000 * (seconds); // Interval - how long will it take for the timer to elapse. (In milliseconds) 
     tmr.Elapsed += Tmr_Elapsed; // Subscribe to the event 
     tmr.Start(); // Run the timer 
    } 

    private static void Tmr_Elapsed(object sender, ElapsedEventArgs e) 
    { 
     // Stop the video 
    } 
+0

System.Timers名前空間を使用すると、windows10では利用できませんがCybrus – Robert

+0

@Robert @おかげで、この記事を参照してくださいこれを達成するためにどのように私をphone.Suggest質問/ 22012056/timer-for-windows-phone-8) – Cybrus

関連する問題