简体   繁体   English

Cordova插件可在iOS和Android Lockscreen上显示音频信息和控件

[英]Cordova Plugin to display audio information and controls on iOS and Android Lockscreen

I am looking for a plugin or plugins that would allow me to show audio metadata (Title, Artwork etc.) on the Lockscreen of both iOS and Android. 我正在寻找一个插件或插件,允许我在iOS和Android的锁屏上显示音频元数据(标题,图稿等)。 Along with that I would like to control the audio from the lockscreen (Play pause etc, it already happens in iOS I need it happen on Android). 除此之外,我想控制来自锁屏的音频(播放暂停等,它已经在iOS中发生,我需要它在Android上发生)。 Lastly the plugin should provide audio information within the control center in iOS and the notification area in Android of cause with the ability to Play Pause etc. 最后,该插件应该在iOS的控制中心内提供音频信息,并在Android中提供具有播放暂停等功能的通知区域。

If it is easier to do with some native code tweaks then can someone please point that out also to a tutorial as to how it can be done. 如果对某些本机代码调整更容易,那么有人可以指出一个关于如何完成它的教程。

Below are some examples of what I am speaking about 以下是我所说的一些例子

Control Center iOS中的音频信息

在此输入图像描述

在此输入图像描述

在此输入图像描述

This plugin does what you're looking for: https://github.com/homerours/cordova-music-controls-plugin 这个插件可以满足您的需求: https//github.com/homerours/cordova-music-controls-plugin

As of writing it has a few issues with iOS html5 audio (see https://github.com/homerours/cordova-music-controls-plugin/issues/97 and https://github.com/homerours/cordova-music-controls-plugin/issues/66 ) but works across iOS, android and windows phone. 在写作时,iOS html5音频存在一些问题(参见https://github.com/homerours/cordova-music-controls-plugin/issues/97https://github.com/homerours/cordova-music- controls-plugin / issues / 66 )但适用于iOS,Android和Windows手机。

You could also try this, however I have never tried it. 你也可以尝试这个,但我从未尝试过。 It uses the native players for iOS and Android, and will not work on chrome or your dev machine. 它使用适用于iOS和Android的原生播放器,不适用于chrome或dev机器。 https://github.com/wnyc/cordova-plugin-playerhater https://github.com/wnyc/cordova-plugin-playerhater

On my current project I have much the same need as you, (I am using HTML5 audio) and have had to put together a number of different plugins. 在我目前的项目中,我和你一样需要(我使用的是HTML5音频)并且必须将许多不同的插件组合在一起。

iOS Background Audio iOS背景音频

https://github.com/AubreyHewes/cordova-background-audio https://github.com/AubreyHewes/cordova-background-audio

iOS Meta data: iOS Meta数据:

https://github.com/ChoiZ/NowPlaying https://github.com/shi11/RemoteControls https://github.com/ChoiZ/NowPlaying https://github.com/shi11/RemoteControls

I am working on a solution for a modular android audio notification controls using the webintent plugin, but I am far from finishing it. 我正在使用webintent插件开发模块化Android音频通知控件的解决方案,但我还远未完成它。 I'll post back here when it's done. 完成后我会在这里回复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM