Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么后台播放 #95

Closed
ghost opened this issue May 9, 2016 · 7 comments
Closed

怎么后台播放 #95

ghost opened this issue May 9, 2016 · 7 comments

Comments

@ghost
Copy link

ghost commented May 9, 2016

Audioplayer用于纯音频播放,支持后台运行(文档原话)。但是我用了发现并不支持后台播放,按home键后,直接报 av_read_frame error: abb6a7bb( , , , ): AVERROR_EXIT

@Jhuster
Copy link
Contributor

Jhuster commented May 9, 2016

@suikatomoki 请问使用的哪一个版本,1.2.0 以后,推荐使用 PLMediaPlayer 来实现音频的播放,具体示例可以参考 demo 代码

@ghost
Copy link
Author

ghost commented May 9, 2016

@Jhuster 知道的,我都试过了。后台播放音频是默认的吗,不需要配置任何参数?

@Jhuster
Copy link
Contributor

Jhuster commented May 9, 2016

@suikatomoki 嗯,不需要,只是进入后台的时候不要调用 pause 或者 stop 即可。

@ghost
Copy link
Author

ghost commented May 9, 2016

@Jhuster 我这边后台之后,过了两到三秒的样子,就会停止播放,并有如下log
-49a2238e2b9ef5d5

@Jhuster
Copy link
Contributor

Jhuster commented May 9, 2016

@suikatomoki 建议把播放音乐的代码放到`Service`中。

@ghost
Copy link
Author

ghost commented May 9, 2016

@Jhuster 放到service里了,还用的是前台service,加了通知。

@ghost
Copy link
Author

ghost commented May 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants