Comments (25)
看看你是怎么使用的?
from starrysky.
按照步骤application初始化,
然后
SongInfo songInfo2 = new SongInfo();
songInfo2.setSongId("id"+musicStateBean.getLocation());
songInfo2.setSongUrl(musicStateBean.getSong().path);
MusicManager.get().playMusicByInfo(songInfo2);
from starrysky.
from starrysky.
不会是服务没起来吧,你看看有没有:musiclibrary进程,因为是在 ServiceConnection 里面赋值的
from starrysky.
我看看
from starrysky.
你断点一下第143行,看看ServiceConnection里面有没有赋值
from starrysky.
from starrysky.
这么神奇吗,你再断下137行,看看有没有bindService
from starrysky.
from starrysky.
刚刚我在demo中试了一下,是没问题的。你这里很奇怪,它绑定了服务还不走 onServiceConnected 回调这么神奇
from starrysky.
我刚刚自己写了个服务是可以绑定回调的,是不是要AndroidManifest注册?
from starrysky.
不需要自己注册,我里面都注册好了。
我觉得可以试试下面的做法:
第一个看看服务启动了没有,看看有没有musiclibrary进程。
第二个可以先clone代码,先用library的方式引用,方便调试问题所在
第三个,我是在NiceMusic这个demo里面测试的,没重现到问题,你也可以看看
from starrysky.
本地引用库,一样没回调,额(⊙﹏⊙)
from starrysky.
你的NiceMusic应该是用AndroidStudio3.0+开发的,我花了点功夫刚移植到AndroidStudio2.3,现在测试体体
from starrysky.
现在都用3.0了吧,我用3.0.1的
from starrysky.
用惯2.3.3,我个人不太喜欢3.0的调试器,还有一些项目都是2.3.3开发的,出问题麻烦,所以没用,不过我装了最新的as预览版
from starrysky.
你的项目的确可以回调的,奇怪
from starrysky.
不知道你是不是设置了什么其他东西影响到了……
from starrysky.
吖,用不了
from starrysky.
我刚刚开了一个新demo,也不可以,没有回调,你也试试创建一个新的demo,引用,然后application断init里面的回调
from starrysky.
我创建一个试试
from starrysky.
试了,没问题,你直接在你的主activity里面初始化,看看 control 还是不是null 试试
你加我qq吧,方便一点
from starrysky.
qq1023509177
from starrysky.
implementation 'com.android.support:appcompat-v7:26.1.0'
27+版本抛null
from starrysky.
27+, 需要额外引用
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'
from starrysky.
Related Issues (20)
- 有歌词吗? HOT 1
- 可以把歌词也加上 HOT 1
- 当前播放器,是不是不支持aac、m4a格式的音频,我这边播放没有声音。如果没有支持是不是需要自己重新编译so库 HOT 3
- 啊我炸了
- 什么时候能适配下Android10以上、API30以上?目前设置了缓存不生效 HOT 4
- 不能确定正在播放哪一首歌
- Bug Play m4a File auto pause not play HOT 3
- 在fragment中如何移除进度监听? HOT 1
- Unable to create service com.lzx.starrysky.service.MusicService. SecurityException: listen HOT 5
- java.lang.ClassNotFoundException HOT 1
- 能否为PlayProgress提供LiveData的监听方式,现有的在compose中使用不方便并且容易造成内存泄漏 HOT 1
- 在api32上无法播放,没有任何反馈 HOT 2
- 配置custom_notification闪退 HOT 1
- 隐私合规问题:获取运行中进程信息 HOT 1
- 通知无法显示
- 设置了7首歌,然后设置随机播放,一直在循环播其中的三首 HOT 4
- 适配Android 12
- 希望添加一个注意事项 HOT 2
- 好像不支持.caf格式音频文件播放 HOT 1
- 打开app,然后在设置中关闭存储权限,直接从后台启动app,app会重启,这时调用播放音乐,不会播放
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 starrysky.