コード例 #1
0
        async void BtnVideo_Clicked(object sender, EventArgs args)
        {
            Button btn = (Button)sender;

            btn.IsEnabled = false;

            var video = await ServicioMultimedia.SeleccionarVideo();

            if (video != null)
            {
                string videoPath = video.Path;
                if (!string.IsNullOrWhiteSpace(videoPath))
                {
                    if (videoPlayer.IsVisible == false)
                    {
                        videoPlayer.IsVisible = true;
                    }
                    videoPlayer.Source = new FileVideoSource
                    {
                        File = videoPath
                    };
                    Video.Videoclip = videoPath;
                    Video.Stream    = video.GetStream();
                }
                btn.IsEnabled = true;
            }
            else
            {
            }
        }
コード例 #2
0
        private async void BtnImagen_Clicked(object sender, EventArgs e)
        {
            var imagen = await ServicioMultimedia.SeleccionarImagen();

            if (imagen != null)
            {
                Ruta.ImagenPrincipal = imagen.Path;
                Ruta.Stream          = imagen.GetStream();
                imgRuta.Source       = ImageSource.FromFile(imagen.Path);
            }
            else
            {
            }
        }