hty527 / imusic Goto Github PK
View Code? Open in Web Editor NEW一个集视频播放器、音乐播放器封装库于一身的iMusic工程
一个集视频播放器、音乐播放器封装库于一身的iMusic工程
VideoPlayerManager.getInstance().setVideoDisplayType(VideoConstants.VIDEO_DISPLAY_TYPE_CUT);
mVideoPlayer = findViewById(R.id.video_player);
int itemHeight = this.getResources().getDisplayMetrics().widthPixels * 9 / 16;
mVideoPlayer.getLayoutParams().height = itemHeight;
DetailsCoverController coverController = new DetailsCoverController(VideoPlayerActivity.this);
mVideoPlayer.setVideoCoverController(coverController, true);
mVideoPlayer.setGlobaEnable(true);
mVideoPlayer.startPlayVideo("http://baobab.kaiyanapp.com/api/v1/playUrl?vid=189024&resourceType=video&editionType=default&source=aliyun&playUrlType=url_oss", "测试一下视屏功能");
核心代码就这些点击播放时候一直转圈圈
MusicPlayerManager的 addOnPlayerEventListener 这个方法,我始终没找到调用处,这个方法调了吗?
由于通知栏已经有了音乐小窗,系统级音乐悬浮窗就多余了,我想要只在应用内显示,请问该如何设置呢?
if (action.equals(MusicConstants.MUSIC_INTENT_ACTION_CLICK_PAUSE)) {
MusicPlayerManager.getInstance().playOrPause();
ToastManager.mToastshow(context, "点击了暂停");
// MusicPlayerManager.getInstance().getPlayerState();
//前台进程-关闭前台进程
} else if (action.equals(MusicConstants.MUSIC_INTENT_ACTION_CLICK_CLOSE)) {
MusicPlayerManager.getInstance().stopServiceForeground();
ToastManager.mToastshow(context, "点击了关闭");
//收藏
}
在体验你的 app 时 , 感觉视频在多个界面切换时都很流畅 , 丝毫没有停顿 , 不知道理论上实现机制是怎么样的?
如题
集成到 react-native ui组件点击全屏按钮不管用
视频显示有点问题 有集成rn 的uidoc 吗?
I can not find to set PlaybackParams, It's not public interface in the project.
Please help me, thank you.
VideoConstants.VIDEO_DISPLAY_TYPE_ZOOM
大佬好,您的iPlayer十分好用,我想使用此库作为音频播放器。在实际使用过程中,我是用addPlayMusicToTop配合play调用,却发现没有任何声音被播放,且日志无输出。麻烦大佬看一下是否设置正确。
MusicPlayerManager.getInstance().addPlayMusicToTop(BaseAudioInfo().also {
it.audioId = 1847746003
it.audioDurtion = 216837
it.audioName = "长街烟火"
it.audioCover = "https://p2.music.126.net/q39xkl_Kn4_Pv--l712jNg==/109951166028225197.jpg"
it.audioPath = "http://172.27.208.1:12345/Zyboy%E5%BF%A0%E5%AE%87%20-%20%E5%A0%95%20%28%E5%8F%98%E9%80%9F%E7%89%88%29.mp3"
it.nickname = "等什么君(邓寓君)"
})
MusicPlayerManager.getInstance().play()
audioPath是可以被访问的,已经开启cleartextTrafficPermitted, 封面也可以正常访问
如果不行,多个页面都需要播放是不是都要初始化和反初始化一次呢,设置的参数是不是都要重新设置一次,比如说:
//应用播放器配置
.setMusicPlayerConfig(config)
//通知栏交互,默认开启
.setNotificationEnable(true)
//常驻进程开关,默认开启
.setLockForeground(true)
//设置点击通知栏跳转的播放器界面,需开启常驻进程开关
.setPlayerActivityName(MusicPlayerActivity.class.getCanonicalName())
//设置锁屏界面,如果禁用,不需要设置或者设置为null
.setLockActivityName(MusicLockActivity.class.getCanonicalName())
你好,你的demo写的很成熟了,很美观,体验也是极好.
问题在于集成后无法正常播放url视频, grade 和 导入module 都失败了.
嗨,我今天检查了你的项目。这太棒了。我期待一个基本的音乐播放器,但当我看到该应用程序的高级功能时,我感到很惊讶。我很乐意通过创建某些文档为您的项目做出贡献。隐私政策,常见问题解答,贡献者指南等。我很想知道您对此的看法。
Hi, I checked out your project today. It's really amazing. I was expecting a basic music player, but I was surprised when I saw the app's advanced features. I'd love to contribute to your project by creating certain documents. A privacy policy, FAQs, contributors guide etc. I'd love to know what you think about that.
可惜不维护了
在播放得xml增加以下代码:
<com.video.player.lib.view.VideoPlayerTrackView
android:id="@+id/video_track"
android:layout_width="match_parent"
android:layout_height="200dp"
app:video_autoSetCoverController="true"
app:video_autoSetVideoController="true"/>
编译后跳转到页面报以下错误(是否需要全局初始化?项目未体现):
Caused by: android.view.InflateException: Binary XML file line #15 in com.zszs.activity:layout/activity_test: Binary XML file line #15 in com.zszs.activity:layout/activity_test: Error inflating class com.video.player.lib.view.VideoPlayerTrackView
Caused by: android.view.InflateException: Binary XML file line #15 in com.zszs.activity:layout/activity_test: Error inflating class com.video.player.lib.view.VideoPlayerTrackView
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:470)
at android.app.Activity.setContentView(Activity.java:3337)
at com.zszs.activity.TestActivity.onCreate(TestActivity.kt:37)
at android.app.Activity.performCreate(Activity.java:7815)
at android.app.Activity.performCreate(Activity.java:7804)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1325)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3350)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3514)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2110)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7697)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
Caused by: android.view.InflateException: Binary XML file line #23 in com.zszs.activity:layout/video_default_controller_layout: Binary XML file line #23 in com.zszs.activity:layout/video_default_controller_layout: Error inflating class
Caused by: android.view.InflateException: Binary XML file line #23 in com.zszs.activity:layout/video_default_controller_layout: Error inflating class
播放列表存在闪退。
我发现当我返回上一页面时,Activity的onDestroy方法都已经执行了,但是还是有音频在播放。请问怎样才能暂停播放?播放器的不是跟页面的生命周期绑定了吗?
如题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.