PLAY MUSIC ON SERVICE AND SHOW ALL THE ICONS IN NOTIFICATION

75 views
Skip to first unread message

J1 Tech Solutions -j1theguru

unread,
Dec 17, 2021, 7:40:44 PM12/17/21
to DroidScript
Is it possible to play music through service and show all icons like pause play next using Droidscript?

Alan Hendry

unread,
Dec 18, 2021, 12:15:06 PM12/18/21
to DroidScript
HI,
documents how to play files like .mp3 and .ogg
You can have icons with ontouch functions that Play() Pause() and Stop()
In the Samples (touch the rocket icon in the top-right of the app) 
is Audio Player (Simple Audio Player)
Regards, ah

J1 Tech Solutions -j1theguru

unread,
Dec 19, 2021, 5:05:34 AM12/19/21
to DroidScript

Please i need it that someone can pause/play from the notification bar. Without doing it from the main app.

Alan Hendry

unread,
Dec 19, 2021, 4:47:37 PM12/19/21
to DroidScript
HI,
You can create a notification with option AutoCancel (dismiss the notification if the user touches it).
There's SetOnNotify (presumably invoked when the user touches the notification)
You could try sending a notification(tile "Play", perhaps an image), 
when the user touches it then play music and send another notify (title "Pause", perhaps an image),
when they touch that then  pause music and send another notify (title "Play").
If that works then you could have more notify's (prev,next,etc)
"If you use more than one notification, app.GetNotifyId can be used to check which notification was pressed by the user."
Regards, ah
Reply all
Reply to author
Forward
0 new messages