Search code examples
libvlclibvlcsharp

Passing in a playlist file to LibVLCSharp?


Is it possible to pass in a playlist file into LibVLCSharp? I have tried both a .pls file and a .m3u8 file and served them up a webserver but have not had success.

I created media as such:

media = new Media(_libLVC, new Uri("http://192.168.1.100/test.m3u8"));

Contents of test.m3u8:

#EXTM3U
http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

Looking at the debug logs, I can see that it interprets it as a playlist:

11-29 12:39:09.430 D/Mono    ( 5328): DllImport searching in: 'libvlc' ('libvlc.so').
11-29 12:39:09.430 D/Mono    ( 5328): Searching for 'libvlc_media_release'.
11-29 12:39:09.430 D/Mono    ( 5328): Probing 'libvlc_media_release'.
11-29 12:39:09.430 D/VLC     ( 5328): [ec1e1d50/14ea] libvlc stream: using access module "access"
11-29 12:39:09.430 D/VLC     ( 5328): [ec1e1df0/14ea] libvlc stream: looking for stream_filter module matching "prefetch,cache_block": 26 candidates
11-29 12:39:09.430 D/Mono    ( 5328): Found as 'libvlc_media_release'.
11-29 12:39:09.432 D/VLC     ( 5328): [ec1e1df0/14ea] libvlc stream: using 90 bytes buffer, 90 bytes read
11-29 12:39:09.432 D/VLC     ( 5328): [ec1e1df0/14ea] libvlc stream: using stream_filter module "prefetch"
11-29 12:39:09.433 D/VLC     ( 5328): [ec1e1e90/14ea] libvlc stream: looking for stream_filter module matching "any": 26 candidates
11-29 12:39:09.433 D/VLC     ( 5328): [ec1e1df0/14ec] libvlc stream: end of stream
11-29 12:39:09.434 D/VLC     ( 5328): [ec1e1e90/14ea] libvlc stream: found valid M3U playlist
11-29 12:39:09.434 D/VLC     ( 5328): [ec1e1e90/14ea] libvlc stream: using stream_filter module "playlist"
11-29 12:39:09.434 D/VLC     ( 5328): [ec1e1e90/14ea] libvlc stream: stream filter added to 0xec1e1df0
11-29 12:39:09.437 D/VLC     ( 5328): [ec1e1f30/14ea] libvlc stream: looking for stream_filter module matching "any": 26 candidates
11-29 12:39:09.438 D/VLC     ( 5328): [ec1e1f30/14ea] libvlc stream: no stream_filter modules matched
11-29 12:39:09.438 D/VLC     ( 5328): [ec191fb0/14ea] libvlc stream_directory: looking for stream_directory module matching "any": 1 candidates
11-29 12:39:09.438 D/VLC     ( 5328): [ec191fb0/14ea] libvlc stream_directory: no stream_directory modules matched
11-29 12:39:09.438 D/VLC     ( 5328): [ec1e1c10/14ea] libvlc input source: attachment of directory-extractor failed for http://192.168.1.100/test.m3u8
11-29 12:39:09.438 D/VLC     ( 5328): [ec1e1f30/14ea] libvlc stream: looking for stream_filter module matching "record": 26 candidates
11-29 12:39:09.438 D/VLC     ( 5328): [ec1e1f30/14ea] libvlc stream: using stream_filter module "record"
11-29 12:39:09.438 D/VLC     ( 5328): [ec1e1c10/14ea] libvlc input source: creating demux: access='http' demux='any' location='192.168.1.100/test.m3u8' file='(null)'
11-29 12:39:09.440 D/VLC     ( 5328): [ec1e1fd0/14ea] libvlc demux: looking for demux module matching "any": 47 candidates
11-29 12:39:09.440 D/VLC     ( 5328): [ec1e1fd0/14ea] libvlc demux: cannot peek
11-29 12:39:09.440 I/chatty  ( 5328): uid=10069(com.companyname.playlistissue) config_GetGener identical 3 lines
11-29 12:39:09.441 D/VLC     ( 5328): [ec1e1fd0/14ea] libvlc demux: cannot peek
11-29 12:39:09.441 D/VLC     ( 5328): [ec1e1fd0/14ea] libvlc demux: using demux module "directory"
11-29 12:39:09.441 D/VLC     ( 5328): [ec1847b0/14ea] libvlc demux meta: looking for meta reader module matching "any": 2 candidates
11-29 12:39:09.446 D/VLC     ( 5328): [ec1847b0/14ea] libvlc demux meta: Trying Lua scripts in /data/user/0/com.companyname.playlistissue/files/.share/lua/meta/reader
11-29 12:39:09.446 D/VLC     ( 5328): [ec1847b0/14ea] libvlc demux meta: Trying Lua scripts in /data/app/com.companyname.playlistissue-4psrEdfCR_33zAzGGCIW_w==/lib/x86/vlc/lua/meta/reader
11-29 12:39:09.446 D/VLC     ( 5328): [ec1847b0/14ea] libvlc demux meta: Trying Lua scripts in /data/app/com.companyname.playlistissue-4psrEdfCR_33zAzGGCIW_w==/share/vlc/lua/meta/reader
11-29 12:39:09.446 D/VLC     ( 5328): [ec1847b0/14ea] libvlc demux meta: no meta reader modules matched
11-29 12:39:09.447 D/VLC     ( 5328): [d246b830/14ea] libvlc input: `http://192.168.1.100/test.m3u8' successfully opened
11-29 12:39:09.449 D/VLC     ( 5328): [d246b830/14ea] libvlc input: EOF reached
11-29 12:39:09.450 D/VLC     ( 5328): [ec1e1fd0/14ea] libvlc demux: removing module "directory"
11-29 12:39:09.450 D/VLC     ( 5328): [ec1e1f30/14ea] libvlc stream: removing module "record"
11-29 12:39:09.450 D/VLC     ( 5328): [ec1e1e90/14ea] libvlc stream: removing module "playlist"
11-29 12:39:09.450 D/VLC     ( 5328): [ec1e1df0/14ea] libvlc stream: removing module "prefetch"
11-29 12:39:09.455 D/VLC     ( 5328): [ec1e1d50/14ea] libvlc stream: removing module "access"

I can successfully open the playlist in the VLC app for Windows by going to "Open Network Stream" and pointing it to the same URL ("http://192.168.1.100/test.m3u8").

Is this a bug in libvlcsharp or am I using the API incorrectly?


Solution

  • No, it's not supported.

    There is the MediaListPlayer API for playlist, but I was advised not to use that, so, for now, it's better that you parse your file and play each file individually.