当前位置: 首页>>代码示例>>C#>>正文


C# MediaPlayerLauncher类代码示例

本文整理汇总了C#中MediaPlayerLauncher的典型用法代码示例。如果您正苦于以下问题:C# MediaPlayerLauncher类的具体用法?C# MediaPlayerLauncher怎么用?C# MediaPlayerLauncher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MediaPlayerLauncher类属于命名空间,在下文中一共展示了MediaPlayerLauncher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: play

        private void play(string url)
        {
            this.mediaPlayer = new MediaPlayerLauncher();

            Uri uri = new Uri(url, UriKind.RelativeOrAbsolute);

            if (uri.IsAbsoluteUri)
            {
                this.mediaPlayer.Media = uri;
            }
            else
            {
                using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    if (isoFile.FileExists(url))
                    {
                        this.mediaPlayer.Location = MediaLocationType.Data;
                        this.mediaPlayer.Media = uri;
                    }
                    else
                    {
                        throw new ArgumentException("Media location doesn't exists.");
                    }
                }
            }

            this.mediaPlayer.Show();
        }
开发者ID:redsen171ehs,项目名称:phonegap-plugins,代码行数:28,代码来源:VideoPlayer.cs

示例2: Navigate

        public void Navigate()
        {
            bool noVideoFileUri = this.VideoFileUri == null || string.IsNullOrWhiteSpace(this.VideoFileUri.ToString());
            #if !WINDOWS_PHONE
            if (noVideoFileUri)
            {
                Windows.System.Launcher.LaunchUriAsync(this.VideoUri);
            }
            else
            {
                Windows.System.Launcher.LaunchUriAsync(this.VideoFileUri);
            }
            #else

            if (this.VideoFileUri != null && !string.IsNullOrEmpty(this.VideoFileUri.ToString()))
            {
                var launcher = new MediaPlayerLauncher
                {
                    Controls = MediaPlaybackControls.All,
                    Media = this.VideoFileUri
                };
                launcher.Show();

            }
            else
            {
                WebBrowserTask browser = new WebBrowserTask();
                browser.URL = this.VideoUri.ToString();
                browser.Show();
            }
            #endif
        }
开发者ID:ramhemasri,项目名称:Pusher,代码行数:32,代码来源:VideoItem.cs

示例3: ButtonPlay_Click

        private async void ButtonPlay_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                LiveOperationResult operationResult = await this.liveClient.GetAsync(this.id);
                dynamic properties = operationResult.Result;
                if (properties.source != null)
                {
                    var launcher = new MediaPlayerLauncher()
                    {
                        Media = new Uri(properties.source, UriKind.Absolute),
                        Controls = MediaPlaybackControls.All
                    };

                    launcher.Show();
                }
                else
                {
                    this.ShowError("Could not find the 'source' attribute.");
                }
            }
            catch (LiveConnectException exception)
            {
                this.ShowError(exception.Message);
            }
        }
开发者ID:harunpehlivan,项目名称:LiveSDK-for-Windows,代码行数:26,代码来源:PlayAudio.xaml.cs

示例4: LaunchVideoFromWeb_Click

 private void LaunchVideoFromWeb_Click(object sender, EventArgs e)
 {
     var task = new MediaPlayerLauncher();
      task.Location = MediaLocationType.None;
      task.Media = new Uri("http://www.windowsphoneinaction.com/sample.wmv");
      task.Show();
 }
开发者ID:timothybinkley,项目名称:Windows-Phone-8-In-Action,代码行数:7,代码来源:MainPage.xaml.cs

示例5: LaunchVideoFromInstall_Click

 // Sample code for building a localized ApplicationBar
 //private void BuildLocalizedApplicationBar()
 //{
 //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
 //    ApplicationBar = new ApplicationBar();
 //    // Create a new button and set the text value to the localized string from AppResources.
 //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
 //    appBarButton.Text = AppResources.AppBarButtonText;
 //    ApplicationBar.Buttons.Add(appBarButton);
 //    // Create a new menu item with the localized string from AppResources.
 //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
 //    ApplicationBar.MenuItems.Add(appBarMenuItem);
 //}
 private void LaunchVideoFromInstall_Click(object sender, EventArgs e)
 {
     var task = new MediaPlayerLauncher();
      task.Location = MediaLocationType.Install;
      task.Media = new Uri("Assets/sample.wmv", UriKind.Relative);
      task.Show();
 }
开发者ID:timothybinkley,项目名称:Windows-Phone-8-In-Action,代码行数:20,代码来源:MainPage.xaml.cs

示例6: button1_Click

 private void button1_Click(object sender, RoutedEventArgs e)
 {
     String parameter = PageTitle.Text;
     if (parameter.Contains(".txt"))
     {
         NavigationService.Navigate(new Uri(string.Format("/text.xaml?parameter={0}", parameter), UriKind.Relative));
     }
     else
     {
         if (parameter.Contains(".wmv"))
         {
             //NavigationService.Navigate(new Uri(string.Format("/video_play.xaml?parameter={0}", parameter), UriKind.Relative));
             MediaPlayerLauncher mediaPlayerLauncher = new MediaPlayerLauncher();
             mediaPlayerLauncher.Media = new Uri("MyFolder\\" + parameter, UriKind.Relative);
             //replace "gags" with your file path.
             mediaPlayerLauncher.Location = MediaLocationType.Data;
             mediaPlayerLauncher.Controls = MediaPlaybackControls.All;
             mediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
             mediaPlayerLauncher.Show();
             
         }
         else
         {
             NavigationService.Navigate(new Uri(string.Format("/video_image.xaml?parameter={0}", parameter), UriKind.Relative));
         }
     }
 }
开发者ID:sauravmahajan,项目名称:CDN-WindowsApp,代码行数:27,代码来源:file_info.xaml.cs

示例7: StartAudioPlayback

 public void StartAudioPlayback(string AudioFilePath)
 {
     MediaPlayerLauncher objMediaPlayerLauncher = new MediaPlayerLauncher();
       objMediaPlayerLauncher.Media = new Uri(AudioFilePath, UriKind.Relative);
       objMediaPlayerLauncher.Location = MediaLocationType.Install;
       objMediaPlayerLauncher.Controls = MediaPlaybackControls.Pause | MediaPlaybackControls.Stop | MediaPlaybackControls.All;
       objMediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
       objMediaPlayerLauncher.Show();
 }
开发者ID:rsatter,项目名称:MonoCross,代码行数:9,代码来源:VideoPlayer.cs

示例8: play_Click

 private void play_Click(object sender, EventArgs e)
 {
     var task = new MediaPlayerLauncher
     {
         Location = MediaLocationType.Data,
         Media = new Uri("video-recording.mp4", UriKind.Relative),
     };
     task.Show();
 }
开发者ID:shreedharcva,项目名称:Windows-Phone-7-In-Action,代码行数:9,代码来源:MainPage.xaml.cs

示例9: Psalm_137

 private void Psalm_137(object sender, RoutedEventArgs e)
 {
     MediaPlayerLauncher objMediaPlayerLauncher = new MediaPlayerLauncher();
     objMediaPlayerLauncher.Media = new Uri("/AgpeyaHyms/Colimpine/-------------.mp3", UriKind.Relative);
     objMediaPlayerLauncher.Location = MediaLocationType.Install;
     objMediaPlayerLauncher.Controls = MediaPlaybackControls.Pause | MediaPlaybackControls.Stop | MediaPlaybackControls.All;
     objMediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
     objMediaPlayerLauncher.Show();
 }
开发者ID:btsmarco,项目名称:TheAgpeya,代码行数:9,代码来源:Compline.xaml.cs

示例10: btnPlayVideo_Click

 private void btnPlayVideo_Click(object sender, RoutedEventArgs e)
 {
     MediaPlayerLauncher mediaPlayerLauncher =
           new MediaPlayerLauncher();
     mediaPlayerLauncher.Location =
             MediaLocationType.Install; //means is a resource of the app, otherwise it will try to resolve it in Data (IsolatedStorage) for application
     mediaPlayerLauncher.Media = new Uri("Media/Bear.wmv", UriKind.Relative);
     mediaPlayerLauncher.Show();
 }
开发者ID:WindowsPhone-8-TrainingKit,项目名称:HOL-Launchers,代码行数:9,代码来源:VideoPlayerPage.xaml.cs

示例11: Button_Click_1

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {

            MediaPlayerLauncher objMediaPlayerLauncher = new MediaPlayerLauncher();
            objMediaPlayerLauncher.Media = new Uri("AgpeyaHyms/Sext/--------------", UriKind.Relative);
            objMediaPlayerLauncher.Location = MediaLocationType.Install;
            objMediaPlayerLauncher.Controls = MediaPlaybackControls.Pause | MediaPlaybackControls.Stop | MediaPlaybackControls.All;
            objMediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
            objMediaPlayerLauncher.Show();
        }
开发者ID:btsmarco,项目名称:TheAgpeya,代码行数:10,代码来源:Sext.xaml.cs

示例12: video_play

 public video_play()
 {
     InitializeComponent();
     mediaPlayerLauncher= new MediaPlayerLauncher();
     
     //replace "gags" with your file path.
     mediaPlayerLauncher.Location = MediaLocationType.Data;
     mediaPlayerLauncher.Controls = MediaPlaybackControls.All;
     mediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
     
     this.Loaded += new RoutedEventHandler(MainPage_Loaded);
 }
开发者ID:sauravmahajan,项目名称:CDN-WindowsApp,代码行数:12,代码来源:video_play.xaml.cs

示例13: OnNavigated

        private void OnNavigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
        {
            string url = e.Uri.OriginalString;
            if (PhoneHelper.IsMedia(url))
            {
                MediaPlayerLauncher launcher = new MediaPlayerLauncher();
                launcher.Media = new Uri(url, UriKind.RelativeOrAbsolute);
                launcher.Show();
            }

            this.loader.Stop();
            this.browser.Visibility = Visibility.Visible;
        }
开发者ID:anytao,项目名称:ModernReader,代码行数:13,代码来源:OkrBrowser.xaml.cs

示例14: m_DownloadStringCompleted

        private void m_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            try
            {
                MediaPlayerLauncher mediaPlayerLauncher = new MediaPlayerLauncher();
                mediaPlayerLauncher.Media = new Uri(e.Result.Split(new string[] { "<source src=\"" }, StringSplitOptions.None)[1].Replace('"', '?'), UriKind.Absolute);
                mediaPlayerLauncher.Controls = MediaPlaybackControls.All;
                mediaPlayerLauncher.Location = MediaLocationType.Data;
                mediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
                mediaPlayerLauncher.Show();
            }
            catch { MessageBox.Show("Сейчас это кино не доступно для просмотра.", "Извините!", MessageBoxButton.OK); }

        }
开发者ID:pakrom,项目名称:windows-phone,代码行数:14,代码来源:Video.xaml.cs

示例15: btnPlayVideo_Click

        private void btnPlayVideo_Click(object sender, RoutedEventArgs e)
        {
            MediaPlayerLauncher mpLauncher = new MediaPlayerLauncher();
            if (chkUseExternalMedia.IsChecked.Value)
            {
                MessageBox.Show("Connecting to external video:\n" + _videoUrl);
                mpLauncher.Media = new Uri(_videoUrl, UriKind.Absolute);
            }
            else
            {
                mpLauncher.Location = MediaLocationType.Install;
                mpLauncher.Media = new Uri("Assets/video1.wmv", UriKind.Relative);
            }

            mpLauncher.Show();
        }
开发者ID:JackieWang,项目名称:Exercise.WP7,代码行数:16,代码来源:VideoPlayerPage.xaml.cs


注:本文中的MediaPlayerLauncher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。