VLC Android Intent to Stop playback?

VLC for Android and Chrome OS specific usage questions
stardomains
Blank Cone
Blank Cone
Posts: 22
Joined: 16 Jun 2020 19:33

VLC Android Intent to Stop playback?

Postby stardomains » 31 Aug 2020 00:07

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.

Aza
Developer
Developer
Posts: 2115
Joined: 14 Mar 2019 10:04

Re: VLC Android Intent to Stop playback?

Postby Aza » 01 Sep 2020 08:03

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

stardomains
Blank Cone
Blank Cone
Posts: 22
Joined: 16 Jun 2020 19:33

Re: VLC Android Intent to Stop playback?

Postby stardomains » 01 Sep 2020 19:28

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?

Aza
Developer
Developer
Posts: 2115
Joined: 14 Mar 2019 10:04

Re: VLC Android Intent to Stop playback?

Postby Aza » 02 Sep 2020 06:28

What do you mean by "isn't working"? Do you have logs?

stardomains
Blank Cone
Blank Cone
Posts: 22
Joined: 16 Jun 2020 19:33

Re: VLC Android Intent to Stop playback?

Postby stardomains » 02 Sep 2020 07:09

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


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 20 guests