GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - fallllllll/MusicLibrary: 一个丰富的音乐播放封装库。

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

78 Commits
78 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
app
app
 
 
art
art
 
 
gradle/wrapper
gradle/wrapper
 
 
musiclibrary
musiclibrary
 
 
.gitignore
.gitignore
 
 
API_README.md
API_README.md
 
 
Model_README.md
Model_README.md
 
 
Notification_README.md
Notification_README.md
 
 
README.md
README.md
 
 
article_README.md
article_README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

MusicLibrary

一个比较完善的音乐播放封装库。 集成了 MediaPlayer 和 ExoPlayer 两个播放器(默认 ExoPlayer ),可以随意选择。
有了它,你只需要简单初始化后调用相关的方法即可实现音频播放功能,从此摆脱麻烦的封装。

目前功能:

  • 集成了 MediaPlayer 和 ExoPlayer 两个播放器
  • 集成了自定义通知栏和系统通知栏
  • 播放器该有的操作功能都有

开发计划

  1. 集成系统通知栏(已完成)
  2. 集成下载功能
  3. 集成保存播放进度功能
  4. 支持直播

PS:

  • 如果你有想法或者意见和建议,欢迎提issue,喜欢点个star。欢迎各位大佬指点指点。

Demo

具体应用 Demo 请参考 NiceMusic

导入

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

dependencies {
     compile 'com.github.lizixian18:MusicLibrary:v1.2.4'
}

文档

  1. 集成方法:
  
  
  在 Application 中完成初始化,会自动开启音乐服务和初始化:
  
  if (!BaseUtil.getCurProcessName(this).contains(":musicLibrary")) {
      MusicManager.get().setContext(this).init();
  }
  
  其中,一定要调用 setContext 设置上下文,否则会报错。 
  因为音乐服务是运行在 musicLibrary 进程里面的,多进程的情况下,Application 会创建多次, 
  所以需要加上以上判断,在非 musicLibrary 进程里面初始化。
    
  初始化的时候还有一些参数可以配置:  
  
  setAutoPlayNext(boolean autoPlayNext) 是否在播放完当前歌曲后自动播放下一首
  setUseMediaPlayer(boolean isUseMediaPlayer) 是否使用 MediaPlayer
  setNotificationCreater(NotificationCreater creater) 通知栏配置
  
  (通过 MusicManager 去调用 lib 中所有的 api ,静态方法可以直接调用,
    非静态方法需要通过 MusicManager.get() 去调用。)
  1. Model字典

    详细见 Model字典说明

  2. 播放器API

    详细见 API说明

  3. 通知栏集成

    详细见 通知栏集成

  4. 代码实现以及原理

    详细见 代码实现以及原理




About me

An android developer in GuangZhou
简书:http://www.jianshu.com/users/286f9ad9c417/latest_articles
Email:[email protected]
If you want to make friends with me, You can give me a Email and follow me。

License

Copyright 2018 L_Xian   

Licensed under the Apache License, Version 2.0 (the "License");  
you may not use this file except in compliance with the License.  
You may obtain a copy of the License at  

http://www.apache.org/licenses/LICENSE-2.0  

Unless required by applicable law or agreed to in writing, software  
distributed under the License is distributed on an "AS IS" BASIS,  
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
See the License for the specific language governing permissions and  
limitations under the License.

About

一个丰富的音乐播放封装库。

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.