Exemplo n.º 1
0
        public PagePlayerPhoto()
        {
            InitializeComponent();

            MediaRssProvider rssProvider = new MediaRssProvider();
            Uri url = new Uri("http://api.flickr.com/services/feeds/photos_public.gne?tags=ninja636&lang=en-us&format=rss_200");
            rssProvider.ContentSource = url;
            player.Controller.PlaylistSource = rssProvider;
        }
Exemplo n.º 2
0
        void player_Loaded(object sender, RoutedEventArgs e)
        {
            if (mediaController != null)
            {
                if (!string.IsNullOrEmpty(provider))
                {
                    switch (provider.ToLower())
                    {
                        case "mediarss":
                            {
                                MediaRssProvider rssProvider = new MediaRssProvider();
                                string url;
                                Uri uri;
                                if (initParams.TryGetValue("url", out url)
                                    && Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out uri))
                                {
                                    rssProvider.ContentSource = uri;
                                    mediaController.PlaylistSource = rssProvider;
                                }
                            }
                            break;
                        case "msnvideo":
                            {
                                MSNVideoProvider msnProvider = new MSNVideoProvider();
                                string url;
                                Uri uri;
                                if (initParams.TryGetValue("url", out url) && Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out uri))
                                {
                                    msnProvider.ContentSource = uri;
                                    mediaController.PlaylistSource = msnProvider;
                                }
                            }
                            break;
                        default:
                            break;
                    }
                }
                else
                {

                    foreach (var source in sources)
                    {
                        SLMedia.Core.MediaItem item = new SLMedia.Core.MediaItem();
                        item.Source = source;
                        mediaController.Playlist.Add(item);
                        mediaController.CurrentItem = item;
                    }

                    //if (mediaController is DeepZoomController)
                    //{

                    //}
                    //else
                    //{
                    //}
                }
            }
        }