Esempio n. 1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            btClient.Initialize();

            //フルスクリーンに
            Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TryEnterFullScreenMode();

            var mediaSet = sceneData.MediaActionSets[0];

            while (mediaActionPlayer != null && mediaActionPlayer.IsPlaying)
            {
                await Task.Delay(500);
            }

            try
            {
                if (mediaActionPlayer == null)
                {
                    mediaActionPlayer = new MediaActionPlayer(mediaPlayerElement, mediaSet.MediaActions, Dispatcher, MediaActionPlayer.MediaActionPlayerType.Client);//ほんとはViewModel実装してDispatcherをなくしたい。。。
                }
                else
                {
                    currentScene = mediaSet.MediaActions[0].MediaScene;
                    mediaActionPlayer.ResetMediaAction(mediaSet.MediaActions);
                }
                mediaPlayerElement.Source = mediaSet.MovieMediaSource;
                mediaActionPlayer.Play();
            }
            catch (Exception ex)
            {
                var dlg = new MessageDialog(ex.Message, ex.ToString());
                await dlg.ShowAsync();
            }
        }
Esempio n. 2
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     this.DataContext = viewModel;
     btClient.Initialize();
 }