Xamarin RTSP streaming auto shudown after 1 minute
I am working on Xamarin.Android Project on VS2017, and copy the official sample code from VideoMosaic
However the RTSP streaming will auto shutdown connection after 1 mins, even the UI have response and the app is not crash. The Activity is very simple, below is the code
`namespace XamarinAndroidBoxApp { [Activity(Label = "@string/app_name", MainLauncher = true, Theme = "@style/Theme.AppCompat.Light.NoActionBar.FullScreen")] public class MainActivity : AppCompatActivity {
const string VIDEO_URL = "rtsp://192.168.28.54/user=admin&password=&channel=1&stream=0.sdp?";
LibVLC _libvlc;
LibVLCSharp.Platforms.Android.VideoView _videoView;
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.activity_main);
}
protected override void OnResume()
{
base.OnResume();
Core.Initialize();
string[] options = new string[] { "-vvv", "--sout-keep", "--sout-all" };
_libvlc = new LibVLC(options);
var media = new Media(_libvlc, VIDEO_URL, FromType.FromLocation);
var config = new MediaConfiguration();
config.EnableHardwareDecoding = true; //It is same whether true or false
media.AddOption(":rtsp-timeout=300"); // the error same whether add this option
media.AddOption(":sout-all"); // the error same whether add this option
media.AddOption(":sout-keep"); // the error same whether add this option
media.AddOption(config);
_videoView = FindViewById<LibVLCSharp.Platforms.Android.VideoView>(Resource.Id.VideoView0);
_videoView.MediaPlayer = new MediaPlayer(_libvlc);
_videoView.MediaPlayer.Play(media);
}
}
} `
And I attached the full log log.txt