Comments (24)
@webwayscript Can you describe it in detail about "sleep" and "wake"
from snow.
sleep time:
assume time is 9.30 pm . if user want stop music 10.30 pm. they will select 60 minutes in timer or set time 10.30. timer must start running inside service. when finished 60 minutes or reach 10.30 music must stop automatically even app is closed.
also we need get balance running time . ( if user want how many minutes balance is there for stop)
wake up time ( optional)
if user set 6 am for particular song. when if is 6 am audio server must start and play. even app is closed.
check more details in radiodroid app they doing it nicely
from snow.
OK, I will add support for "sleep time", but “wake up” need yourself handle it.
from snow.
@webwayscript sleep timer is finished.
from snow.
New methods on PlayerClient
:
startSleepTimer(long time)
: start sleep timer (unit: ms).time
must>= 0
.cancelSleepTimer()
: cancel started sleep timer.addOnSleepTimerStateChangeListener(SleepTimer.OnStateChangeListener listener)
addOnSleepTimerStateChangeListener(LifecycleOwner owner, SleepTimer.OnStateChangeListener listener)
removeOnSleepTimerStateChangeListener(SleepTimer.OnStateChangeListener listener)
isSleepTimerStarted()
: check whether sleep timer is started.getSleepTimerTime()
: get the time of sleep timer (unit: ms).getSleepTimerStartedTime()
: get the time of sleep timer started (unit: ms).
New type:
SleepTimer
SleepTimer.OnStateChangeListener
from snow.
If you want get the elapsed time of sleep timer, just use SystemClock.elapsedRealtime() - startTime
.
from snow.
Thank you bro i will check today
from snow.
from snow.
@webwayscript This bug has been fixed.
from snow.
from snow.
You can put them in MusicItem
extras.
Example:
public static final String KEY_CATEGORY = "category";
public static final String KEY_AUDIO_TYPE = "audio_type";
...
Bundle song1Extra = new Bundle();
song1Extra.putString(KEY_CATEGORY, "song 1 category");
song1Extra.putString(KEY_AUDIO_TYPE, "song 1 audio type");
MusicItem song1 = new MusicItem.Builder()
...
.setExtra(song1Extra)
.build();
Bundle song2Extra = new Bundle();
song2Extra.putString(KEY_CATEGORY, "song 2 category");
song2Extra.putString(KEY_AUDIO_TYPE, "song 2 audio type");
MusicItem song2 = new MusicItem.Builder()
...
.setExtra(song2Extra)
.build();
Note: Don't put large objects in extra as this may cause Binder to crash.
from snow.
from snow.
from snow.
@webwayscript I need more information about this.
from snow.
from snow.
@webwayscript Sorry, I can't find any useful information from these message.
from snow.
from snow.
OK, I will add support for it.
from snow.
@webwayscript I optimized some code that might cause bugs, you can try it again.
from snow.
from snow.
@webwayscript add a new method: PlayerService.setMaxIDLETime(int minutes)
. You can invoke this method in PlayerService.onCreate
. After paused or stopped, PlayerService
will automatic shutdown when timeout.
from snow.
from snow.
Can you explain more? where i need add? inside my MyPlayerService extends PlayerService ?
from snow.
Example:
public class MyPlayerService extends PlayerService {
...
@Override
public void onCreate() {
super.onCreate();
// set max IDLE time
setMaxIDLETime(10);
...
}
...
}
from snow.
Related Issues (20)
- Fatal Exception: java.lang.IndexOutOfBoundsException HOT 2
- EqualizerActivity Failed resolution of: Landroidx/databinding/DataBinderMapperImpl; HOT 7
- STATE_BUFFERING update when play start HOT 1
- 忽略音频焦点会闪退,闪退后无法播放音频,需要重新启用音频焦点才行 HOT 6
- EqualizerActivity 正在播放音频开启均衡器会闪退 HOT 3
- 为什么有些网络歌曲没播放完就直接播放下一首了
- How can I add images of songs in local music and album ? HOT 5
- moveMusicItem 移动歌曲位置有问题啊。 HOT 3
- “"音量均衡”功能和修改”随机播放“算法 HOT 10
- AppWidget 怎么接收不到广播啊? HOT 12
- MIUI14上通知栏专辑封面显示问题 HOT 6
- setNextPlay()添加下一首播放有问题。 HOT 3
- qq音乐的播放链接不能播放,用浏览器直接打开是没问题的 HOT 1
- Android 13 黑屏音乐过一会就会停止播放 HOT 15
- 寻求一下帮助。 HOT 9
- 没有设置播放音量大小的方法吗 HOT 6
- 1.2.11 多次点击播放暂停会出现无声音播放 HOT 3
- 可以出蓝牙车载歌词功能吗 HOT 3
- Need Update Library HOT 4
- Media Notification Not closed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snow.