public void TestParseTimestamp()
 {
     Assert.Equal(0L, CatapultCsvImporter.ConvHmssToEpochUs("0:00.00"));
     Assert.Equal(TimeFormatter.TimeFromTimeSpan(TimeSpan.FromMilliseconds(2290)), CatapultCsvImporter.ConvHmssToEpochUs("0:02.29"));
     Assert.Equal(TimeFormatter.TimeFromTimeSpan(new TimeSpan(0, 0, 51, 50, 0)), CatapultCsvImporter.ConvHmssToEpochUs("51:50.00"));
     Assert.Equal(TimeFormatter.TimeFromTimeSpan(new TimeSpan(0, 1, 9, 11, 0)), CatapultCsvImporter.ConvHmssToEpochUs("1:09:11.00"));
 }
Ejemplo n.º 2
0
        private void CurrentStateChanged(MediaPlayer sender, object args)
        {
            var videoLength = TimeFormatter.TimeFromTimeSpan(sender.PlaybackSession.NaturalDuration);

            if (videoLength <= 0)
            {
                return;
            }
            sender.CurrentStateChanged -= CurrentStateChanged;

            _videoLength = videoLength;
            _videoLengthTask.SetResult(_videoLength.Value);

            sender.Dispose();
        }