0

use LibVLCSharp in my project cause the video pixeled and grey screen

I tried to add file-caching=1500 to media player with no success and you can see my code below

          this.VideoPath = extras.GetString(INTENT_KEY_PARAM_VIDEO_PATH);
          Core.Initialize();
          _libVLC = new LibVLC();
          _mediaPlayer = new MediaPlayer(_libVLC);
          _videoView.MediaPlayer = _mediaPlayer;
          var mediaUri = Android.Net.Uri.Parse(this.VideoPath);
          var m = new Media(_libVLC, mediaUri.ToString(), FromType.FromPath);
          var configuration = new MediaConfiguration();
          configuration.EnableHardwareDecoding();


          m.AddOption(":fullscreen");
          m.AddOption(":codec=avcodec");
          m.AddOption(configuration);
          m.AddOption(":file-caching=1500");
          _mediaPlayer.Media = m;
          _videoView.MediaPlayer.Play(m);
mfkl
  • 1,914
  • 1
  • 11
  • 21
AAHN
  • 381
  • 1
  • 4
  • 18
  • Remove `m.AddOption(":codec=avcodec");` – mfkl Mar 26 '19 at 14:23
  • Share logs and your media file if possible. – mfkl Mar 26 '19 at 14:23
  • Remove :codec=avcodec cause the video show grey screen from first opening – AAHN Mar 26 '19 at 14:51
  • Remove `EnableHardwareDecoding`, color glitches are usually hardware related. Share your device and media file – mfkl Mar 26 '19 at 16:13
  • media file any type of videos, my device samsung J6, huawii , I tried to remove hardwaredecoding same thing, actually I have a recycler view and each cell contains video file when video cell click I am trying to play video it's work fine for first call no grey screen no lake if i go back to my recycler view and select any other video even same video grey screen come back – AAHN Mar 27 '19 at 01:30
  • I am testing your code with a simple demo but in my project, _videoView.MediaPlayer = _mediaPlayer; shows error: 'VideoView' does not contain a definition for 'MediaPlayer' ... – AbbyWang - MSFT Mar 27 '19 at 08:28
  • Share your **full** code – mfkl Mar 27 '19 at 09:04

0 Answers0