iOS MobileVLCKit "VLCMediaPlayerStateError" is not called when there is a network cut
I'm using MobileVLCKit (iOS). I realized there is no state change if the network connection gets cut. I tested this by turning off wifi and there is no call to -(void)mediaPlayerStateChanged:(NSNotification *)aNotification
, the last player state is VLCMediaPlayerStateBuffering
(I think it's a known bug because it's so while playing also) although there is no sound and no internet. Here is an example of the setup
VLCMediaListPlayer *vlcMediaPlayer = [[VLCMediaListPlayer alloc] init];
vlcMediaPlayer.rootMedia = [[VLCMedia alloc] initWithURL:streamURL];
vlcMediaPlayer.mediaPlayer.delegate = self;
[vlcMediaPlayer play];
Here's the VLC's log just in case it's useful
[DBG] VLC media player - 3.0.19 Vetinari [lib-vlc]
[DBG] `http://24273.live.streamtheworld.com:80/CONTINENTALAAC_SC' gives access `http' demux `any' path `24273.live.streamtheworld.com:80/CONTINENTALAAC_SC' [lib-vlc]
[DBG] Copyright © 1996-2023 the VideoLAN team [lib-vlc]
[DBG] creating demux: access='http' demux='any' location='24273.live.streamtheworld.com:80/CONTINENTALAAC_SC' file='(null)' [lib-vlc]
[DBG] revision 3.0.18-298-gfa48bfaa11 [lib-vlc]
[DBG] looking for access_demux module matching "http": 12 candidates [lib-vlc]
[DBG] configured with /Users/videolanci/builds/iHxegY-y/1/videolan/VLCKit/libvlc/vlc/configure '--prefix=/Users/videolanci/builds/iHxegY-y/1/videolan/VLCKit/libvlc/vlc/install-iPhoneOS/arm64' '--host=aarch64-apple-darwin' '--with-contrib=/Users/videolanci/builds/iHxegY-y/1/videolan/VLCKit/libvlc/vlc/contrib/iPhoneOS-aarch64-apple-darwin-aarch64' '--enable-static' '--enable-dvbpsi' '--enable-avcodec' '--disable-macosx' '--disable-macosx-qtkit' '--disable-macosx-avfoundation' '--disable-shared' '--enable-opus' '--disable-faad' '--disable-lua' '--disable-a52' '--enable-fribidi' '--disable-qt' '--disable-skins2' '--disable-vcd' '--disable-vlc' '--disable-vlm' '--disable-nls' '--disable-sse' '--disable-notify' '--enable-live555' '--enable-realrtsp' '--enable-swscale' '--disable-projectm' '--enable-libass' '--enable-libxml2' '--disable-goom' '--disable-dvdread' '--disable-dvdnav' '--disable-bluray' '--disable-linsys' '--disable-libva' '--disable-gme' '--disable-tremor' '--enable-vorbis' '--disable-fluidsynth' '--disable-jack' '--disable-pulse' '--disable-mtp' '--enable-ogg' '--enable-speex' '--enable-theora' '--enable-flac' '--disable-screen' '--enable-freetype' '--enable-taglib' '--enable-smb2' '--disable-mmx' '--disable-sparkle' '--disable-addonmanagermodules' '--disable-mad' 'host_alias=aarch64-apple-darwin' 'CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk -mios-version-min=9.0 -arch arm64 -g -DNDEBUG' 'LDFLAGS=-arch arm64 -Wl,-ios_version_min,9.0' 'CPPFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk -mios-version-min=9.0 -arch arm64 -g' 'CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++' 'CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk -mios-version-min=9.0 -arch arm64 -g' 'OBJC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'OBJCFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.4.sdk -mios-version-min=9.0 -arch arm64 -g' 'CCAS=gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang' 'PKG_CONFIG_PATH=' [lib-vlc]
[DBG] no access_demux modules matched [lib-vlc]
[DBG] creating access: http://24273.live.streamtheworld.com:80/CONTINENTALAAC_SC [lib-vlc]
[DBG] looking for access module matching "http": 66 candidates [lib-vlc]
[DBG] looking for keystore module matching "any": 6 candidates [lib-vlc]
[DBG] no keystore modules matched [lib-vlc]
[DBG] resolving 24273.live.streamtheworld.com ... [lib-vlc]
[DBG] outgoing request:
GET /CONTINENTALAAC_SC HTTP/1.1
Host: 24273.live.streamtheworld.com:80
Accept: */*
Accept-Language: en_US
User-Agent: VLC/3.0.19 LibVLC/3.0.19
Range: bytes=0-
[lib-vlc]
[DBG] incoming response:
HTTP/1.0 200 OK
Expires: Thu, 01 Dec 2003 16:00:00 GMT
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
X-STW-lsid: ipua:540ed115a258cccc17167aa4b1b77f12
Set-Cookie: uuid=d39acbd5-094c-475c-927f-e1a7ddd2e4f2; expires=Wed, 14 Feb 2024 20:14:53 GMT; path=/; domain=.live.streamtheworld.com
Set-Cookie: uuid-s=d39acbd5-094c-475c-927f-e1a7ddd2e4f2; expires=Wed, 14 Feb 2024 20:14:53 GMT; path=/; domain=.live.streamtheworld.com; SameSite=None; Secure; HttpOnly
Content-Type: audio/aacp
Connection: close
icy-name:
icy-description:
icy-url: http://www.continental.com.ar/
icy-genre: Misc
icy-br: 32
Server: MediaGateway 6.3.0-0740.el6
[lib-vlc]
[DBG] connection failed [lib-vlc]
[DBG] no access modules matched [lib-vlc]
[DBG] redirecting to: icyx://24273.live.streamtheworld.com:80/CONTINENTALAAC_SC [lib-vlc]
[DBG] creating access: icyx://24273.live.streamtheworld.com:80/CONTINENTALAAC_SC [lib-vlc]
[DBG] looking for access module matching "icyx": 66 candidates [lib-vlc]
[DBG] querying proxy for icyx://24273.live.streamtheworld.com:80/CONTINENTALAAC_SC [lib-vlc]
[DBG] no proxy [lib-vlc]
[DBG] http: server='24273.live.streamtheworld.com' port=80 file='/CONTINENTALAAC_SC' [lib-vlc]
[DBG] looking for keystore module matching "any": 6 candidates [lib-vlc]
[DBG] no keystore modules matched [lib-vlc]
[DBG] net: connecting to 24273.live.streamtheworld.com port 80 [lib-vlc]
[DBG] connection succeeded (socket = 6) [lib-vlc]
[DBG] sending request:
GET /CONTINENTALAAC_SC HTTP/1.0
Host: 24273.live.streamtheworld.com
User-Agent: VLC/3.0.19 LibVLC/3.0.19
Icy-MetaData: 1
[lib-vlc]
[DBG] HTTP answer code 200 [lib-vlc]
[DBG] Content-Type: audio/aacp [lib-vlc]
[DBG] Icy-Name: [lib-vlc]
[DBG] Meta-Info: icy-description: [lib-vlc]
[DBG] Meta-Info: icy-url: http://www.continental.com.ar/ [lib-vlc]
[DBG] Icy-Genre: Misc [lib-vlc]
[DBG] Meta-Info: icy-br: 32 [lib-vlc]
[DBG] Icy-MetaInt: 16000 [lib-vlc]
[WARN] ICY metaint=16000 [lib-vlc]
[DBG] Server: MediaGateway 6.3.0-0740.el6 [lib-vlc]
[DBG] auto re-connect enabled [lib-vlc]
[DBG] using access module "http" [lib-vlc]
[DBG] looking for stream_filter module matching "prefetch,cache_read": 75 candidates [lib-vlc]
[DBG] using 16777216 bytes buffer, 16777216 bytes read [lib-vlc]
[DBG] using stream_filter module "prefetch" [lib-vlc]
[DBG] looking for stream_filter module matching "any": 75 candidates [lib-vlc]
[DBG] no stream_filter modules matched [lib-vlc]
[DBG] looking for stream_directory module matching "any": 3 candidates [lib-vlc]
[DBG] no stream_directory modules matched [lib-vlc]
[DBG] attachment of directory-extractor failed for icyx://24273.live.streamtheworld.com:80/CONTINENTALAAC_SC [lib-vlc]
[DBG] looking for stream_filter module matching "record": 75 candidates [lib-vlc]
[DBG] using stream_filter module "record" [lib-vlc]
[DBG] creating demux: access='http' demux='m4a' location='24273.live.streamtheworld.com:80/CONTINENTALAAC_SC' file='(null)' [lib-vlc]
[DBG] looking for demux module matching "m4a": 138 candidates [lib-vlc]
[DBG] detected format mp4a [lib-vlc]
[DBG] looking for packetizer module matching "any": 75 candidates [lib-vlc]
[DBG] running MPEG4 audio packetizer [lib-vlc]
[DBG] using packetizer module "mpeg4audio" [lib-vlc]
[DBG] detected ADTS format [lib-vlc]
[INF] AAC channels: 1 samplerate: 22050 [lib-vlc]
[DBG] selecting program id=0 [lib-vlc]
[DBG] using demux module "es" [lib-vlc]
[DBG] looking for audio decoder module matching "any": 48 candidates [lib-vlc]
[DBG] using ffmpeg Lavc58.134.100 [lib-vlc]
[ERR] option quiet does not exist [lib-vlc]
[DBG] CPU flags: 0x00000068 [lib-vlc]
[DBG] codec (aac) started [lib-vlc]
[DBG] using audio decoder module "avcodec" [lib-vlc]
[DBG] looking for meta reader module matching "any": 3 candidates [lib-vlc]
[DBG] no meta reader modules matched [lib-vlc]
[DBG] `http://24273.live.streamtheworld.com:80/CONTINENTALAAC_SC' successfully opened [lib-vlc]
[DBG] Buffering 0% [lib-vlc]
[DBG] Buffering 4% [lib-vlc]
[DBG] Buffering 9% [lib-vlc]
[DBG] Buffering 13% [lib-vlc]
[DBG] Buffering 18% [lib-vlc]
[DBG] Buffering 23% [lib-vlc]
[DBG] Buffering 27% [lib-vlc]
[DBG] Buffering 32% [lib-vlc]
[DBG] reusing audio output [lib-vlc]
[DBG] Buffering 37% [lib-vlc]
[DBG] VLC is looking for: 'f32l' 44100 Hz Stereo frame=1 samples/8 bytes [lib-vlc]
[DBG] Buffering 41% [lib-vlc]
[DBG] Buffering 46% [lib-vlc]
[DBG] Buffering 51% [lib-vlc]
[DBG] Buffering 55% [lib-vlc]
[DBG] Buffering 60% [lib-vlc]
[DBG] Buffering 65% [lib-vlc]
[DBG] Buffering 69% [lib-vlc]
[DBG] Buffering 74% [lib-vlc]
[DBG] Buffering 78% [lib-vlc]
[DBG] Buffering 83% [lib-vlc]
[DBG] Buffering 88% [lib-vlc]
[DBG] Buffering 92% [lib-vlc]
[DBG] Buffering 97% [lib-vlc]
[DBG] Stream buffering done (1021 ms in 16 ms) [lib-vlc]
[DBG] Output on Default, channel count: 2, spatialAudioEnabled 1 [lib-vlc]
[DBG] Current device has a latency of 8729 us [lib-vlc]
[DBG] VLC keeping the same input layout [lib-vlc]
[DBG] Current AU format: [44100.000000][mcpl][9][8][1][8][2][32] [lib-vlc]
[DBG] analog AudioUnit output successfully opened for f32l Stereo [lib-vlc]
[DBG] output 'f32l' 44100 Hz Stereo frame=1 samples/8 bytes [lib-vlc]
[DBG] looking for audio volume module matching "any": 6 candidates [lib-vlc]
[DBG] using audio volume module "float_mixer" [lib-vlc]
[DBG] input 'f32l' 44100 Hz Stereo frame=1 samples/8 bytes [lib-vlc]
[DBG] looking for audio filter module matching "scaletempo": 39 candidates [lib-vlc]
[DBG] format: 44100 rate, 2 nch, 4 bps, fl32 [lib-vlc]
[DBG] params: 30 stride, 0.200 overlap, 14 search [lib-vlc]
[DBG] 1.000 scale, 1323.000 stride_in, 1323 stride_out, 1059 standing, 264 overlap, 617 search, 2204 queue, fl32 mode [lib-vlc]
[DBG] using audio filter module "scaletempo" [lib-vlc]
[DBG] conversion: 'f32l'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo [lib-vlc]
[DBG] conversion pipeline complete [lib-vlc]
[DBG] looking for audio meter module matching "ebur128": 3 candidates [lib-vlc]
[DBG] using audio meter module "ebur128" [lib-vlc]
[DBG] conversion: 'f32l'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo [lib-vlc]
[DBG] conversion pipeline complete [lib-vlc]
[DBG] conversion: 'f32l'->'f32l' 44100 Hz->44100 Hz Stereo->Stereo [lib-vlc]
[DBG] conversion pipeline complete [lib-vlc]
[DBG] looking for audio resampler module matching "soxr": 6 candidates [lib-vlc]
[DBG] Using SoX Resampler with 'cr32s' engine and 'Medium 16-bit with medium roll-off' quality to convert f32l/44100Hz to f32l/44100Hz. [lib-vlc]
[DBG] using audio resampler module "soxr" [lib-vlc]
[WARN] non-dated audio buffer received [lib-vlc]
[DBG] Decoder wait done in 543 ms [lib-vlc]
If I turn on the WiFi again, sometimes it starts but sometimes doesn't. But, in both cases, The player state does not receive updates so I keep showing the "Playing" word to our users.
Versions I tried with: 3.6.0b10 and 3.5.1, both with the same results.
Am I doing something wrong? Is something missing to get an error in that situation?
Thank you for your work guys!