コード例 #1
0
ファイル: Player.cs プロジェクト: mrlucas84/XBMCRemoteRT
 public static async void PlayEpidose(Episode episode)
 {
     GlobalVariables.CurrentTracker.SendEvent(EventCategories.Programmatic, EventActions.Play, EventNames.PlayEpisode, 0);
     JObject episodeToOpen = new JObject(new JProperty("episodeid", episode.EpisodeId));
     await Player.Open(episodeToOpen);
 }
コード例 #2
0
        private async void FileItemWrapper_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var file = (File)((FrameworkElement)sender).DataContext;
            if (file.FileType == "directory")
            {
                LoadDirectory(file);
            }
            else
            {
                var fileDetails = await RPCWrappers.Files.GetFileDetails(file.Path, GlobalVariables.CurrentSource.Media);

                switch (fileDetails.Type)
                {
                    case "music":
                        var song = new Song { SongId = fileDetails.Id };
                        await Player.PlaySong(song);
                        break;
                    case "movie":
                        var movie = new Movie { MovieId = fileDetails.Id };
                        Player.PlayMovie(movie);
                        break;
                    case "episode":
                        var episode = new Episode { EpisodeId = fileDetails.Id };
                        Player.PlayEpidose(episode);
                        break;
                }
            }
        }