示例#1
0
        private async Task DisplayVideoDecoding()
        {
            var videoDecodings = new List <string>();

            videoDecodings.Add("Software decoding");
            videoDecodings.Add("Hardware decoding");

            var userSelection = await DisplayActionSheet("Video decodings", "Cancel", null,
                                                         videoDecodings.ToArray());

            if (!string.IsNullOrWhiteSpace(userSelection) &&
                videoDecodings.Any(x => x.Equals(userSelection)))
            {
                _firstTimePlaying = true;
                videoView.MediaPlayer.Stop();
                var media = new Media(videoView.LibVLC, _fd);
                if (userSelection.Equals(videoDecodings[0]))
                {
                    videoView.MediaPlayer.Play(media);
                }
                else
                {
                    var configuration = new MediaConfiguration();
                    configuration.EnableHardwareDecoding();
                    media.AddOption(configuration);

                    videoView.MediaPlayer.Play(media);
                }
            }
        }
示例#2
0
        protected override void OnResume()
        {
            base.OnResume();

            _videoView = new VideoView(this);
            AddContentView(_videoView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent));
            var media         = new Media(_videoView.LibVLC, "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4", Media.FromType.FromLocation);
            var configuration = new MediaConfiguration();

            configuration.EnableHardwareDecoding();
            media.AddOption(configuration);
            _videoView.MediaPlayer.Play(media);
        }
        public MediaPlayer GetMediaPlayer(string filePath)
        {
            var media = new Media(LibVLC, filePath);

            if (Settings.UseHardwareAcceleration)
            {
                var configuration = new MediaConfiguration();
                configuration.EnableHardwareDecoding();
                media.AddOption(configuration);
            }
            var mediaPlayer = new MediaPlayer(media);

            return(mediaPlayer);
        }
        protected override void OnResume()
        {
            base.OnResume();
            _mVideoView = new VideoView(this);
            var lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                   ViewGroup.LayoutParams.WrapContent);

            _mVideoWrapper.AddView(_mVideoView, lp);
            var media = new Media(_mVideoView.LibVLC, "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov",
                                  Media.FromType.FromLocation);
            var configuration = new MediaConfiguration();

            configuration.EnableHardwareDecoding();
            media.AddOption(configuration);
            _mVideoView.MediaPlayer.Play(media);
        }
示例#5
0
            protected override void OnCreate(Bundle savedInstanceState)
            {
                base.OnCreate(savedInstanceState);
                SetContentView(Resource.Layout.vlc_view);
                string link = Intent.GetStringExtra("link");

                source_link = Intent.GetStringExtra("source_link");
                _videoView  = new VideoView(this);
                AddContentView(_videoView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent));
                var media         = new Media(_videoView.LibVLC, link, Media.FromType.FromLocation);
                var configuration = new MediaConfiguration();

                configuration.EnableHardwareDecoding();
                media.AddOption(configuration);
                _videoView.MediaPlayer.Play(media);
            }
示例#6
0
        protected override void OnResume()
        {
            base.OnResume();

            Core.Initialize();

            _libVLC      = new LibVLC();
            _mediaPlayer = new MediaPlayer(_libVLC);

            _videoView = new VideoView(this)
            {
                MediaPlayer = _mediaPlayer
            };
            AddContentView(_videoView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent));
            var media         = new Media(_libVLC, "https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4", FromType.FromLocation);
            var configuration = new MediaConfiguration();

            configuration.EnableHardwareDecoding();
            media.AddOption(configuration);
            _videoView.MediaPlayer.Play(media);
        }