Ejemplo n.º 1
0
        void Handle_ItemTapped(System.Object sender, Xamarin.Forms.ItemTappedEventArgs e)
        {
            string song_name = e.Item as string;
            var    replaced  = song_name.Replace("(", "");

            replaced = replaced.Replace(")", "");
            replaced = replaced.Replace(' ', '_');
            replaced = replaced.Replace(",", "");

            if (!CheckSongExist(replaced))
            {
                for (int i = 0; i < songs.Count; i++)
                {
                    if (songs[i] == e.Item as string)
                    {
                        string a = Convert_mp3(songs_link[i]);

                        JObject jObj = JObject.Parse(a);              // Parse the object graph
                        selected_song = jObj["url"].ToString();       // Retrive value by key
                    }
                }
            }
            else
            {
                selected_song = "http://instation.codes//youtube-mp3//" + replaced + ".mp3";
            }
            BindingContext = new AudioPlayerViewModel(DependencyService.Get <IAudioPlayerService>());
        }
Ejemplo n.º 2
0
        public MainPage()
        {
            InitializeComponent();
            //var youtube = new YoutubeSearch();
            //youtube.Run_cmd();

            BindingContext = new AudioPlayerViewModel(DependencyService.Get <IAudioPlayerService>());
        }