Commit 26d2e42d authored by Martin Finkel's avatar Martin Finkel

Android sample: Dispose resources

parent dee75209
......@@ -40,6 +40,7 @@
<EnableLLVM>false</EnableLLVM>
<BundleAssemblies>false</BundleAssemblies>
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
......@@ -56,6 +57,7 @@
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<BundleAssemblies>false</BundleAssemblies>
<LangVersion>8.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android.Export" />
......
......@@ -37,7 +37,7 @@ namespace LibVLCSharp.Android.Sample
_videoView = new VideoView(this) { MediaPlayer = _mediaPlayer };
AddContentView(_videoView, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent));
var media = new Media(_libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"));
using var media = new Media(_libVLC, new Uri("http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"));
_videoView.MediaPlayer.Play(media);
}
......@@ -45,8 +45,9 @@ namespace LibVLCSharp.Android.Sample
{
base.OnPause();
_videoView.MediaPlayer.Stop();
_videoView.Dispose();
_mediaPlayer.Dispose();
_libVLC.Dispose();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment