private async void openButton_Click(object sender, RoutedEventArgs e) { XspfTrack trk = (sender as Button).DataContext as XspfTrack; if (trk != null) { await Launcher.LaunchUriAsync(trk.Location); } }
public async Task TestTrackListIndex() { XspfTrack trk = xspf.TrackList[1]; Assert.AreEqual(trk.Title, "单播:CCTV-⒈ 综合"); string streamUriStr = Uri.EscapeDataString(trk.Location.ToString()); await Launcher.LaunchUriAsync( new Uri(string.Format("vlc://openstream?from=url&url={0}", streamUriStr))); }
private async void vlcOpenButton_Click(object sender, RoutedEventArgs e) { XspfTrack trk = (sender as Button).DataContext as XspfTrack; if (trk != null) { string streamUriStr = Uri.EscapeDataString(trk.Location.ToString()); Uri vlcUri = new Uri(string.Format("vlc://openstream?from=url&url={0}", streamUriStr)); await Launcher.LaunchUriAsync(vlcUri); } }
private async void openWithButton_Click(object sender, RoutedEventArgs e) { XspfTrack trk = (sender as Button).DataContext as XspfTrack; if (trk != null) { LauncherOptions options = new LauncherOptions(); options.DisplayApplicationPicker = true; await Launcher.LaunchUriAsync(trk.Location, options); } }