如何隐藏“正在播放网址"在控制中心 [英] How to hide "Now playing url" in control center

查看:199
本文介绍了如何隐藏“正在播放网址"在控制中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图隐藏在UIWebView中播放的实时URL. 播放直播网址并打开控制中心(iOS)时,您会看到正在播放的网址:

I am trying to hide livestream urls that are playing in an UIWebView. When you play a livestream url and open control center (iOS) you see the url that is playing:

.

我想用基于HTML或基于xcode的脚本将其隐藏.

I would like to hide that with a HTML-based or xcode-based script.

推荐答案

您可以通过

You can control this information with the MPNowPlayingInfoCenter. The defaultCenter's nowPlayingInfo dictionary controls what is displayed about the current audio track on the lock screen and command center.

MPNowPlayingInfoCenter *infoCenter = [MPNowPlayingInfoCenter defaultCenter];

NSDictionary *nowPlayingInfo = @{
                                 MPMediaItemPropertyTitle : @"Media Name",
                                 MPMediaItemPropertyArtist : @"Media Artist"
                                 };

[infoCenter setNowPlayingInfo:[NSDictionary dictionaryWithDictionary:nowPlayingInfo]];

文档中列出了完整的键列表,但是您似乎想将曲目名称设置为空字符串.

The full list of keys are listed in the docs, but it looks like you want to set the track name to the empty string.

MPMediaItemPropertyTitle : @""

这篇关于如何隐藏“正在播放网址"在控制中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆