Page 1 of 1

VLC Android Intent to Stop playback?

Posted: 31 Aug 2020 00:07
by stardomains
I use this intent to start an internet radio stream on VLC.

https://wiki.videolan.org/Android_Player_Intents/

What I want to do is use an intent to Stop that internet stream. Is there an intent method to do that?

I'm trying to make an app for personal use only that with one press it will:

1. stop internet stream immediately(not pause)
2. wait a predetermined amout of time(probably will be three minutes)
3. then start the internet stream

I know how to do 2 and 3 but not sure of number 1. I'm thinking I could have some .ogg silence file play and set duration for 1 second but wondered if there is a simpler code.

Doing this so I can skip ads on streams that I listen to in case you were wondering.

Re: VLC Android Intent to Stop playback?

Posted: 01 Sep 2020 08:03
by Aza
There is no intent for stopping. You can maybe do this by sending a stop signal to the media session. See: https://github.com/googlesamples/androi ... controller

Re: VLC Android Intent to Stop playback?

Posted: 01 Sep 2020 19:28
by stardomains
The example shown on that page ( https://wiki.videolan.org/Android_Player_Intents/ ) isn't working in nightlies with device files. I works fine with internet audio streams. But:

Uri uri = Uri.parse("file:///storage/emulated/0/Movies/KUNG FURY Official Movie.mp4");

type isn't working. I tried it with mp3, ogg, mp4 etc. Have my paths right too. Is this an Android 10 scoped storage issue you think?

Re: VLC Android Intent to Stop playback?

Posted: 02 Sep 2020 06:28
by Aza
What do you mean by "isn't working"? Do you have logs?

Re: VLC Android Intent to Stop playback?

Posted: 02 Sep 2020 07:09
by stardomains
What do you mean by "isn't working"? Do you have logs?
I made this post to show:

https://forum.videolan.org/viewtopic.php?f=35&t=154779