private void StopButtun_Click(object sender, RoutedEventArgs e)
 {
     MediaElement1.Stop();
     SeekSlider.Value       = 0;
     PauseButton.Visibility = Visibility.Hidden;
     PlayButton.Visibility  = Visibility.Visible;
 }
Exemplo n.º 2
0
        private void LoadMovies()
        {
            if (MediaElement1 != null)
            {
                MediaElement1.UnloadedBehavior = MediaState.Manual;
                MediaElement1.MediaOpened     -= MediaOpened;
                MediaElement1.Stop();
            }
            if (MediaElement2 != null)
            {
                MediaElement2.UnloadedBehavior = MediaState.Manual;
                MediaElement2.MediaOpened     -= MediaOpened;
                MediaElement2.Stop();
            }

            var movieController = MediaElementController.CreateController(_movieManager, 2);

            MediaElement1              = movieController.MediaElements[0];
            MediaElement2              = movieController.MediaElements[1];
            MediaElement1.MediaOpened += MediaOpened;
            if (MediaElement2 != null)
            {
                MediaElement2.MediaOpened += MediaOpened;
            }
            movieController.Start();
        }
Exemplo n.º 3
0
 /// <summary>
 /// 再生停止ボタン押下イベント
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void OnStopButtonClick(object sender, RoutedEventArgs args)
 {
     try
     {
         // メディア再生停止
         MediaElement1.Stop();
     }
     catch
     {
         Debug.Assert(false, MethodBase.GetCurrentMethod().Name + "で例外が発生しました");
     }
 }
 private void Play_Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         MediaElement1.Stop();
     }
     catch (Exception er)
     {
         //しょりしない
         logwin.AddLog(DateTime.Now, "Error: " + er.ToString());
     }
     MediaElement1.Play();
 }
Exemplo n.º 5
0
        private async Task ClearTempData(string except = null)
        {
            try
            {
                MediaElement1?.Stop();
                IReadOnlyList <StorageFolder> storageFolder = await knownFolder.GetFoldersAsync();

                foreach (var item in storageFolder)
                {
                    if (item.Name != except)
                    {
                        await item.DeleteAsync(StorageDeleteOption.PermanentDelete);
                    }
                }
            }
            catch (Exception) { }
        }
Exemplo n.º 6
0
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     MediaElement1.Stop();
 }
Exemplo n.º 7
0
 private void Stop_Click(object sender, RoutedEventArgs e)
 {
     MediaElement1.Stop();
 }
Exemplo n.º 8
0
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     MediaElement1.Stop();
     Label1.Content = "Stopped.....";
 }
Exemplo n.º 9
0
 //Stop button
 private void Button_Click_3(object sender, RoutedEventArgs e)
 {
     dt.Stop();
     progress.Value = 0;
     MediaElement1.Stop();
 }
Exemplo n.º 10
0
 void MediaControl_PausePressed(object sender, object e)
 {
     MediaElement1.Stop();
     playing = false;
 }