Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can we retrieve the videos from a particular link.That should be from you tube and display all the videos from that particular link in one screen in windows phone 7.I tried it but flash player is not supporting in windows phone emulator.can you give me a code for that one?
Here is my code;
C#
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

        // Load data for the ViewModel Items
      private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            if (!App.ViewModel.IsDataLoaded)
            {
                App.ViewModel.LoadData();
            }
        }

        private void ListBox_Loaded(object sender, RoutedEventArgs e)
        {
            WebClient Andbeyon = new WebClient();

            Andbeyon.DownloadStringCompleted += new DownloadStringCompletedEventHandler(Andbeyon_DownloadStringCompleted);
            Andbeyon.DownloadStringAsync(new System.Uri("http://gdata.youtube.com/feeds/api/videos?author=gyanandbeyond&v=2&alt=json", UriKind.Absolute));

        }

        void Andbeyon_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            var response = e.Result.Replace("$", "dlr");
            var jsonData =  JsonConvert.DeserializeObject<rootobject>(response);
            var src = jsonData.feed.entry.ElementAt(1).mediadlrgroup.mediadlrplayer.url;
            MediaPlayerLauncher player = new MediaPlayerLauncher();
            player.Media = new System.Uri(src, UriKind.Absolute);
            player.Controls = MediaPlaybackControls.All;
            player.Orientation = MediaPlayerOrientation.Landscape;
            player.Show();
        }
        
    }
}
Posted
Updated 3-Oct-12 22:28pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900