Click here to Skip to main content
11,565,623 members (47,164 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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;
        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 3-Oct-12 20:13pm
Edited 3-Oct-12 22:28pm
(no name)182.1K
v3

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

  Print Answers RSS


Advertise | Privacy | Mobile
Web03 | 2.8.150624.2 | Last Updated 4 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100