视频无法从youtube检索到Windows Phone仿真器中,需要用于运行视频的代码 [英] videos are not retrieving from youtube into windows phone emulator need a code for running the vedio

查看:66
本文介绍了视频无法从youtube检索到Windows Phone仿真器中,需要用于运行视频的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以从特定链接中检索视频吗?应该是从您的电子管中获取的,并将该特定链接中的所有视频显示在Windows Phone 7的一个屏幕中.我尝试过,但Flash Player在Windows Phone模拟器中不支持.你能给我一个那个的代码吗?
这是我的代码;

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();
        }
        
    }
}

推荐答案

", ); var jsonData = JsonConvert.DeserializeObject< rootobject>(响应); var src = jsonData.feed.entry.ElementAt( 1 ).mediadlrgroup.mediadlrplayer.url; MediaPlayerLauncher player = MediaPlayerLauncher(); player.Media = System.Uri(src,UriKind.Absolute); player.Controls = MediaPlaybackControls.All; player.Orientation = MediaPlayerOrientation.Landscape; player.Show(); } } }
", "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(); } } }


这篇关于视频无法从youtube检索到Windows Phone仿真器中,需要用于运行视频的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆