在Xamarin.android项目中使用vlc播放器

时间:2019-03-26 12:55:26

标签: android xamarin.android libvlc vlc-android libvlcsharp

在我的项目中使用LibVLCSharp会导致视频像素化和灰屏

我尝试将file-caching = 1500添加到媒体播放器失败,您可以在下面看到我的代码

          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);

0 个答案:

没有答案