Note: UWP is not currently supported. Your Xamarin.Forms UWP app may work for testing, but it won't pass the Microsoft Store checks. See https://github.com/mfkl/libvlc-nuget/issues/8
Not Windows. Your UWP app has a memory violation exception likely because the libvlc build uses win32 apis. This is not the same issue, and expected, as pointed above UWP isn't yet an officially supported target.
The crash I get is on Android is probably a duplicate of #40 (closed)
[0:] System.NullReferenceException: Object reference not set to an instance of an object. at LibVLCSharp.Shared.MediaEventManager.OnMediaFreed (System.IntPtr ptr) [0x00000] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0 at (wrapper managed-to-native) LibVLCSharp.Shared.Media+Native.LibVLCMediaRelease(intptr) at LibVLCSharp.Shared.Internal.Dispose (System.Boolean disposing) [0x00027] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0 at LibVLCSharp.Shared.Media.Dispose (System.Boolean disposing) [0x0001b] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0 at LibVLCSharp.Shared.Internal.Finalize () [0x00000] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0 at LibVLCSharp.Shared.Media.Finalize () [0x00009] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0 12-11 13:05:19.066 E/mono-rt (14536): [ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object.12-11 13:05:19.066 E/mono-rt (14536): at LibVLCSharp.Shared.MediaEventManager.OnMediaFreed (System.IntPtr ptr) [0x00000] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0 12-11 13:05:19.066 E/mono-rt (14536): at (wrapper managed-to-native) LibVLCSharp.Shared.Media+Native.LibVLCMediaRelease(intptr)12-11 13:05:19.066 E/mono-rt (14536): at LibVLCSharp.Shared.Internal.Dispose (System.Boolean disposing) [0x00027] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0 12-11 13:05:19.066 E/mono-rt (14536): at LibVLCSharp.Shared.Media.Dispose (System.Boolean disposing) [0x0001b] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0 12-11 13:05:19.066 E/mono-rt (14536): at LibVLCSharp.Shared.Internal.Finalize () [0x00000] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0 12-11 13:05:19.066 E/mono-rt (14536): at LibVLCSharp.Shared.Media.Finalize () [0x00009] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0
Notes:
It is safe (and encouraged) to dispose of Media objects after it has been set on the mediaplayer (libvlc will copy the reference).
Didn't quite understand what you were trying to achieve with gzip, but you might wanna have a look at the media stream constructor callbacks and !4 (closed)
If you manage to provide a failing unit tests, that'd be great though.
Not Windows. Your UWP app has a memory violation exception likely because the libvlc build uses win32 apis.
Yes, let's focus on android for this issue.
It is safe (and encouraged) to dispose of Media objects after it has been set on the mediaplayer (libvlc will copy the reference).
Yes, but, if I'm not wrong, this is not the case of issue
Didn't quite understand what you were trying to achieve with gzip, but you might wanna have a look at the media stream constructor callbacks
In my application I'm doing the following:
On application start the last used IPTV playlist is auto loading
After successfull playlist load, player starts to autoplay last played IPTV channel
At the same time (right after IPTV playlist is loaded) application runs EPG (Electronic program guide) updater for all channels from IPTV playlist. During this proccess, the updater downloads .gz archive from url and reads it.
The problem is that after using GZipStream for reading .gz archive, the MediaPlayer becomes unresponsible.
For example, if the Media.State was Playing during the GZipStream using process, it becomes 168165633 (in debug console the Media.State is showed as integer)
If I try to change Media, I'm getting
12-07 17:06:02.244 E/mono-rt (11070): at <unknown> <0xffffffff>
12-07 17:06:02.244 E/mono-rt (11070): at (wrapper managed-to-native) LibVLCSharp.Shared.MediaPlayer/Native.LibVLCMediaPlayerSetMedia (intptr,intptr) <0x00012>
12-07 17:06:02.244 E/mono-rt (11070): at LibVLCSharp.Shared.MediaPlayer.set_Media (LibVLCSharp.Shared.Media) [0x00016] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0
12-07 17:06:02.244 E/mono-rt (11070): at LibVLCSharp.Shared.MediaPlayer.Play (LibVLCSharp.Shared.Media) [0x00002] in <a1f1fb9b6c8240e5bf986c5ed7f5ed98>:0
I can't pause, stop MediaPlayer or to do anything else.
App not crashing immediately after GZipStream using process, but MediaPlayer becomes totally unresponsible
If you manage to provide a failing unit tests, that'd be great though.
I'll see what I can do. In testing repository i'm not getting the full picture of what is happening in my main project. Not sure that will be able to reproduce it using unit test as well.