本文整理汇总了C#中MediaPlayerLauncher.Show方法的典型用法代码示例。如果您正苦于以下问题:C# MediaPlayerLauncher.Show方法的具体用法?C# MediaPlayerLauncher.Show怎么用?C# MediaPlayerLauncher.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaPlayerLauncher
的用法示例。
在下文中一共展示了MediaPlayerLauncher.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: 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();
}
示例3: 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
}
示例4: 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();
}
示例5: 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));
}
}
}
示例6: 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();
}
示例7: Psalm_136
private void Psalm_136(object sender, RoutedEventArgs e)
{
MediaPlayerLauncher objMediaPlayerLauncher = new MediaPlayerLauncher();
objMediaPlayerLauncher.Media = new Uri("/AgpeyaHyms/Colimpine/-----------", UriKind.Relative);
objMediaPlayerLauncher.Location = MediaLocationType.Install;
objMediaPlayerLauncher.Controls = MediaPlaybackControls.Pause | MediaPlaybackControls.Stop | MediaPlaybackControls.All;
objMediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
objMediaPlayerLauncher.Show();
}
示例8: 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();
}
示例9: 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();
}
示例10: Button_Click_1
private void Button_Click_1(object sender, RoutedEventArgs e)
{
MediaPlayerLauncher objMediaPlayerLauncher = new MediaPlayerLauncher();
objMediaPlayerLauncher.Media = new Uri("AgpeyaHyms/Prime/001-Psalm1.mp3", UriKind.Relative);
objMediaPlayerLauncher.Location = MediaLocationType.Install;
objMediaPlayerLauncher.Controls = MediaPlaybackControls.Pause | MediaPlaybackControls.Stop | MediaPlaybackControls.All;
objMediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
objMediaPlayerLauncher.Show();
}
示例11: 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;
}
示例12: 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); }
}
示例13: 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();
}
示例14: Play_Button_Click
private void Play_Button_Click (object sender, GestureEventArgs e)
{
if (null != _recordingListBox.SelectedItem)
{
try
{
var mediaPlayerLauncher = new MediaPlayerLauncher ();
mediaPlayerLauncher.Media = new Uri ((_recordingListBox.SelectedItem as Recording).Name + ".wav", UriKind.Relative);
_recordingListBox.SelectedIndex = -1;
mediaPlayerLauncher.Location = MediaLocationType.Data;
mediaPlayerLauncher.Controls = MediaPlaybackControls.All;
mediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
mediaPlayerLauncher.Show ();
}
catch
{
}
}
}
示例15: show
public void show(string options)
{
string[] args = JSON.JsonHelper.Deserialize<string[]>(options);
string url = args[0];
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
MediaPlayerLauncher mediaPlayerLauncher = new MediaPlayerLauncher();
mediaPlayerLauncher.Media = new Uri(url, UriKind.RelativeOrAbsolute);
mediaPlayerLauncher.Location = MediaLocationType.Data;
mediaPlayerLauncher.Controls = MediaPlaybackControls.Pause | MediaPlaybackControls.Stop;
mediaPlayerLauncher.Orientation = MediaPlayerOrientation.Landscape;
mediaPlayerLauncher.Show();
});
}