libvlc read m3u android

This forum is about all development around libVLC.
lebossejames76
New Cone
New Cone
Posts: 2
Joined: 24 Aug 2022 06:58

libvlc read m3u android

Postby lebossejames76 » 24 Aug 2022 07:03

Hello,

I want to use m3u file (local file) with libvlc, how can i do that please?

Thank you.

mfkl
Developer
Developer
Posts: 746
Joined: 13 Jun 2017 10:41

Re: libvlc read m3u android

Postby mfkl » 25 Aug 2022 04:18

What have you tried so far? Can you share some code? Which programming language are you using? Have you looked at the vlc-android code?

Here is a C# example (youtube or m3u work similar).

Code: Select all

using(var libVLC = new LibVLC()) { var media = new Media(libVLC, "https://www.youtube.com/watch?v=dQw4w9WgXcQ", FromType.FromLocation); await media.Parse(MediaParseOptions.ParseNetwork); using (var mp = new MediaPlayer(media.SubItems.First())) { var r = mp.Play(); Console.ReadKey(); } }
https://mfkl.github.io

lebossejames76
New Cone
New Cone
Posts: 2
Joined: 24 Aug 2022 06:58

Re: libvlc read m3u android

Postby lebossejames76 » 27 Aug 2022 14:41

I try this code, i doesn't listen audio stream (m3u file works fine with VLC on my computer):

Code: Select all

final Media media = new Media(mLibVLC, Environment.getExternalStorageDirectory().getAbsolutePath()+ "/Download/modele.m3u"); mMediaPlayer.setMedia(media); media.release(); mMediaPlayer.play();

Code: Select all

196 16367-16367/org.videolan.java_sample D/VLC: [00000075fbd86090/3fef] libvlc input: Creating an input for 'modele.m3u' 2022-08-27 14:35:47.201 16367-16457/org.videolan.java_sample D/VLC: [00000075fbd86090/4049] libvlc input: using timeshift granularity of 50 MiB 2022-08-27 14:35:47.201 16367-16457/org.videolan.java_sample D/VLC: [00000075fbd86090/4049] libvlc input: using default timeshift path 2022-08-27 14:35:47.202 16367-16457/org.videolan.java_sample D/VLC: [00000075fbd86090/4049] libvlc input: `file:///storage/emulated/0/Download/modele.m3u' gives access `file' demux `any' path `/storage/emulated/0/Download/modele.m3u' 2022-08-27 14:35:47.202 16367-16457/org.videolan.java_sample D/VLC: [00000075e9f28810/4049] libvlc input source: creating demux: access='file' demux='any' location='/storage/emulated/0/Download/modele.m3u' file='/storage/emulated/0/Download/modele.m3u' 2022-08-27 14:35:47.202 16367-16457/org.videolan.java_sample D/VLC: [00000075e9f28950/4049] libvlc demux: looking for access_demux module matching "file": 7 candidates 2022-08-27 14:35:47.203 16367-16457/org.videolan.java_sample D/VLC: [00000075e9f28950/4049] libvlc demux: no access_demux modules matched 2022-08-27 14:35:47.203 16367-16457/org.videolan.java_sample D/VLC: [000000760be45d10/4049] libvlc stream: creating access: file:///storage/emulated/0/Download/modele.m3u 2022-08-27 14:35:47.203 16367-16457/org.videolan.java_sample D/VLC: [000000760be45d10/4049] libvlc stream: (path: /storage/emulated/0/Download/modele.m3u) 2022-08-27 14:35:47.203 16367-16457/org.videolan.java_sample D/VLC: [000000760be45d10/4049] libvlc stream: looking for access module matching "file": 25 candidates 2022-08-27 14:35:47.203 16367-16457/org.videolan.java_sample D/VLC: [000000760be45d10/4049] libvlc stream: using access module "filesystem" 2022-08-27 14:35:47.203 16367-16457/org.videolan.java_sample D/VLC: [000000760be45e90/4049] libvlc stream: looking for stream_filter module matching "prefetch,cache_read": 26 candidates 2022-08-27 14:35:47.203 16367-16457/org.videolan.java_sample D/VLC: [000000760be45e90/4049] libvlc stream: Using stream method for AStream* 2022-08-27 14:35:47.203 16367-16457/org.videolan.java_sample D/VLC: [000000760be45e90/4049] libvlc stream: starting pre-buffering 2022-08-27 14:35:47.204 16367-16457/org.videolan.java_sample D/VLC: [000000760be45e90/4049] libvlc stream: received first data after 0 ms 2022-08-27 14:35:47.204 16367-16457/org.videolan.java_sample D/VLC: [000000760be45e90/4049] libvlc stream: pre-buffering done 258 bytes in 0s - 1749 KiB/s


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 29 guests