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

            rootPage = MainPage.Current;

            // Get the list of available Azure videos.
            AzureDataProvider    dataProvider = new AzureDataProvider();
            List <VideoMetaData> videos       = dataProvider.GetAll(MAX_RESULTS);
            Random indexRandomizer            = new Random();

            // Pick a random video
            video = videos[indexRandomizer.Next(0, videos.Count - 1)];

            //Subscribe to player events
            player.MediaOpened         += Player_MediaOpened;
            player.MediaFailed         += Player_MediaFailed;
            player.CurrentStateChanged += Player_CurrentStateChanged;

            //Set the look and feel of the TransportControls
            player.TransportControls.IsCompact = true;

            //Set the source on the player
            rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
            player.Source = video.VideoLink;

            this.dial_launch_args_textbox.Text = string.Format("v={0}&t=0&pairingCode=E4A8136D-BCD3-45F4-8E49-AE01E9A46B5F", video.Id);
        }
Exemplo n.º 2
0
        public Scenario2()
        {
            this.InitializeComponent();

            rootPage = MainPage.Current;

            // Get the list of available Azure videos.
            AzureDataProvider    dataProvider = new AzureDataProvider();
            List <VideoMetaData> videos       = dataProvider.GetAll(MAX_RESULTS);
            Random indexRandomizer            = new Random();

            // Pick a random video
            video = videos[indexRandomizer.Next(0, videos.Count - 1)];

            //Subscribe to player events
            player.MediaOpened         += Player_MediaOpened;
            player.MediaFailed         += Player_MediaFailed;
            player.CurrentStateChanged += Player_CurrentStateChanged;

            //Set the look and feel of the TransportControls
            player.TransportControls.IsCompact = true;

            //Set the source on the player
            rootPage.NotifyUser(string.Format("Opening '{0}'", video.Title), NotifyType.StatusMessage);
            player.Source = video.VideoLink;

            //Configure the DIAL launch arguments for the current video
            this.dial_launch_args_textbox.Text = string.Format("v={0}&t=0&pairingCode=E4A8136D-BCD3-45F4-8E49-AE01E9A46B5F", video.Id);

            //Subscribe for the clicked event on the custom cast button
            ((MediaTransportControlsWithCustomCastButton)this.player.TransportControls).CastButtonClicked += TransportControls_CastButtonClicked;

            // Instantiate the Device Picker
            picker = new DevicePicker();

            //Hook up device selected event
            picker.DeviceSelected += Picker_DeviceSelected;

            //Hook up device disconnected event
            picker.DisconnectButtonClicked += Picker_DisconnectButtonClicked;

            //Hook up device disconnected event
            picker.DevicePickerDismissed += Picker_DevicePickerDismissed;

            ////Set the Appearence of the picker
            //picker.Appearance.BackgroundColor = Colors.Black;
            //picker.Appearance.ForegroundColor = Colors.White;
            //picker.Appearance.SelectedAccentColor = Colors.LightGray;
            //picker.Appearance.SelectedForegroundColor = Colors.White;
            //picker.Appearance.AccentColor = Colors.White;
            //picker.Appearance.SelectedAccentColor = Colors.White;

            pvb.ProjectionStopping += Pvb_ProjectionStopping;
        }