Ejemplo n.º 1
0
        void InitializePlaybackList()
        {
            // Initialize the playlist data/view model.
            // In a production app your data would be sourced from a data store or service.

            // Add content to the ListView and to the MediaPlaybackList.
            MediaModel media = new MediaModel(rootPage.MultiTrackVideoMediaUri)
            {
                Title  = "Fitness",
                ArtUri = new Uri("ms-appx:///Assets/Media/multivideo.jpg")
            };

            playlistView.Items.Add(media);
            playbackList.Items.Add(media.MediaPlaybackItem);
            mpiLoggerList.Add(new MediaPlaybackItemLogger(LoggerControl, media.MediaPlaybackItem));

            media = new MediaModel(rootPage.CaptionedMediaUri)
            {
                Title  = "Elephant's Dream",
                ArtUri = new Uri("ms-appx:///Assets/Media/ElephantsDream.jpg")
            };
            playlistView.Items.Add(media);
            playbackList.Items.Add(media.MediaPlaybackItem);
            mpiLoggerList.Add(new MediaPlaybackItemLogger(LoggerControl, media.MediaPlaybackItem));

            media = new MediaModel(rootPage.SintelMediaUri)
            {
                Title  = "Sintel",
                ArtUri = new Uri("ms-appx:///Assets/Media/sintel.jpg")
            };
            playlistView.Items.Add(media);
            playbackList.Items.Add(media.MediaPlaybackItem);
            mpiLoggerList.Add(new MediaPlaybackItemLogger(LoggerControl, media.MediaPlaybackItem));

            // Subscribe for changes
            playbackList.CurrentItemChanged += PlaybackList_CurrentItemChanged;

            // Loop
            playbackList.AutoRepeatEnabled = true;
        }
        void InitializePlaybackList()
        {
            // Initialize the playlist data/view model.
            // In a production app your data would be sourced from a data store or service.

            // Add content to the ListView and to the MediaPlaybackList.
            MediaModel media = new MediaModel(rootPage.MultiTrackVideoMediaUri)
            {
                Title = "Fitness",
                ArtUri = new Uri("ms-appx:///Assets/Media/multivideo.jpg")
            };
            playlistView.Items.Add(media);
            playbackList.Items.Add(media.MediaPlaybackItem);

            media = new MediaModel(rootPage.CaptionedMediaUri)
            {
                Title = "Elephant's Dream",
                ArtUri = new Uri("ms-appx:///Assets/Media/ElephantsDream.jpg")
            };
            playlistView.Items.Add(media);
            playbackList.Items.Add(media.MediaPlaybackItem);

            media = new MediaModel(rootPage.SintelMediaUri)
            {
                Title = "Sintel",
                ArtUri = new Uri("ms-appx:///Assets/Media/sintel.jpg")
            };
            playlistView.Items.Add(media);
            playbackList.Items.Add(media.MediaPlaybackItem);

            // Subscribe for changes
            playbackList.CurrentItemChanged += PlaybackList_CurrentItemChanged;

            // Loop
            playbackList.AutoRepeatEnabled = true;
        }