groove锁屏的时候会苹果自动锁屏停止播放放音乐

Win10 Groove音乐无法播放怎么办_Groove音乐无法播放的解决方法
最近很多朋友都在问Win10自带的Groove音乐无法播放怎么办呢?如何解决呢?下面小编就来详细的介绍一下吧。
Win10自带的Groove音乐无法播放是由于不是最新版了,可以下载最新版本。
今天微软《Groove音乐》团队宣布该应用迎来里程碑版本,带来了大量的修复和改进,并实现了应用在不同设备中版本和功能的统一,成为名副其实的通用应用,版本号为3.6.1886.0。
以下是本次更新内容详情:
音乐播放相关:
&&当遇到无法播放的音乐时,会将其灰色处理并自动跳过,而不再只是给出错误提示;
&&选择的音乐无法播放时的处理。举例,当你处于离线状态,并尝试播放在线音乐时,会停止尝试播放并立即提示无法播放的原因;
& 对播放功能添加了额外的错误遥测功能,方便开发团队继续改进应用;
其他更新内容包括:
& 移除了对Xbox Live的依赖,意味着你不需要Xbox Live账户就能够使用Groove音乐的功能,另外登录过程也变得快速和可靠;
& 应用首次同步收藏内容时,你能够非常清楚地知道应用在干什么;
& 检索本地音乐文件元数据信息的速度提升10倍,搜索结果更加准确;
& 如果你拥有一个Groove音乐通行证并且没有流量限制,应用会默认搜索结果;
& 查看艺术家时可按歌曲或者专辑视图查看;
&&可从专辑或者歌曲中启动电台;
&&在收藏视图的顶部显示收藏数量;
& 手机版本中,背景填充整个屏幕,顶部图标之下也可看到;
& 可根据收藏来源过滤,包括OneDrive、Pass、购买以及本机;
&&可重置云端收藏;
& 收藏视图支持跳转列表,按年份排序;
& 手机版专辑视图支持hotlinks;
& 针对Continuum模式做了大量的样式改进,为Continuum模式增加了简单的锁屏设置。
新版本还存在一些问题:
& 点击界面中控件的文本会导致播放停止,不要点击文本;
&&冷启动后立即播放音乐会导致播放错误(0xc20200ae),等待一会会恢复正常;
& 更新后,默认的文件关联会重置为Windows Media Player,你可以在设置&&系统&&默认应用&&音乐播放器中自行设置关联;
如果设备名称中包含非Unicode字符时,下载DRM保护音乐会失败,重命名设备即可。
热门安卓游戏排行
类别:动作游戏
类别:模拟经营
类别:动作游戏
最新安卓游戏排行
类别:休闲游戏
类别:射击游戏
类别:休闲游戏iOS_33_音乐播放(后台播放+锁屏歌词)
最终效果图:
应用程序代理(后台播放三步曲)
BeyondAppDelegate.h
Created by beyond on 14-9-10.
Copyright (c) 2014年 com.beyond. All rights reserved.
@interface BeyondAppDelegate : UIResponder
@property (strong, nonatomic) UIWindow *
BeyondAppDelegate.m
Created by beyond on 14-9-10.
Copyright (c) 2014年 com.beyond. All rights reserved.
#import "BeyondAppDelegate.h"
@implementation BeyondAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
// Override point for customization after application launch.
return YES;
- (void)applicationDidEnterBackground:(UIApplication *)application
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
// 后台播放三步骤之一:让应用在后台运行
[application beginBackgroundTaskWithExpirationHandler:nil];
SongController.h
Created by beyond on 14-9-10.
Copyright (c) 2014年 com.beyond. All rights reserved.
音乐播放控制器,继承自tableViewCtrl
@interface SongController : UITableViewController
SongController.m
Created by beyond on 14-9-10.
Copyright (c) 2014年 com.beyond. All rights reserved.
音乐播放控制器,继承自tableViewCtrl
#import "SongController.h"
// 核心框架,必须导入,锁屏显歌词
#import "Song.h"
#import "SongCell.h"
#import "SongTool.h"
#pragma mark - 类扩展
@interface SongController ()
// 对象数组
@property (strong, nonatomic) NSArray *songA
// 当前选中的那一行所对应的播放器(暂没用到)
@property (nonatomic, strong) AVAudioPlayer *currentPlayingAudioP
// 播放器的代理方法中,没有监听歌曲播放进度的方法
// 只能自己 开一个定时器,实时监听歌曲的播放进度
@property (nonatomic, strong) CADisplayLink *
- (IBAction)jump:(id)
@implementation SongController
- (void)viewDidLoad
[super viewDidLoad];
// 防止被导航栏盖住
self.tableView.contentInset = UIEdgeInsetsMake(20, 0, 0, 0);
#pragma mark - 懒加载
- (NSArray *)songArr
if (!_songArr) {
// 分类方法,一步转对象数组
self.songArr = [Song objectArrayWithFilename:@"SongArr.plist"];
return _songA
// 播放器的代理方法中,没有监听歌曲播放进度的方法
// 只能自己 开一个定时器,实时监听歌曲的播放进度
- (CADisplayLink *)link
if (!_link) {
self.link = [CADisplayLink displayLinkWithTarget:self selector:@selector(update)];
#pragma mark - 时钟方法
// 播放器的代理方法中,没有监听歌曲播放进度的方法
// 只能自己 开一个定时器,实时监听歌曲的播放进度
实时更新(1秒中调用60次)
- (void)update
NSLog(@"总长:%f 当前播放:%f", self.currentPlayingAudioPlayer.duration, self.currentPlayingAudioPlayer.currentTime);
#warning 调整锁屏时的歌词
#pragma mark - 连线方法
- (IBAction)jump:(id)sender
// 控制播放进度(单位:秒)
self.currentPlayingAudioPlayer.currentTime = self.currentPlayingAudioPlayer.duration - 3;
#pragma mark - AVAudioPlayer代理方法
// 一曲播放完毕时调用,停止动画,并跳至下一首播放
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag
// 1.先得当前播放完毕的这首歌的行号,通过它,计算下一行的行号(防越界)
NSIndexPath *selectedPath = [self.tableView indexPathForSelectedRow];
int nextRow = selectedPath.row + 1;
if (nextRow == self.songArr.count) {
nextRow = 0;
// 2.停止上一首歌的转圈 (修改模型,并再次传递模型给自定义cell)
SongCell *cell = (SongCell *)[self.tableView cellForRowAtIndexPath:selectedPath];
Song *music = self.songArr[selectedPath.row];
music.playing = NO;
// 内部会拦截setter方法,并停止转圈动画
cell.music =
// 3.播放下一首歌 (选中并滚动至对应位置)
NSIndexPath *nextPath = [NSIndexPath indexPathForRow:nextRow inSection:selectedPath.section];
// 界面上选中
[self.tableView selectRowAtIndexPath:nextPath animated:YES scrollPosition:UITableViewScrollPositionTop];
// 手动调用代理方法
[self tableView:self.tableView didSelectRowAtIndexPath:nextPath];
#pragma mark 播放被打断和恢复
音乐播放器被打断 (如开始 打、接电话)
- (void)audioPlayerBeginInterruption:(AVAudioPlayer *)player
// 会自动暂停
do nothing ...
NSLog(@"audioPlayerBeginInterruption---被打断");
音乐播放器打断终止 (如结束 打、接电话)
- (void)audioPlayerEndInterruption:(AVAudioPlayer *)player withOptions:(NSUInteger)flags
// 手动恢复播放
[player play];
NSLog(@"audioPlayerEndInterruption---打断终止");
#pragma mark - 数据源
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
return self.songArr.
// 每一行独一无二的的cell (给自定义cell传递模型)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
// 1.自定义cell的类方法,快速创建cell
SongCell *cell = [SongCell cellWithTableView:tableView];
// 2.设置cell的数据源
cell.music = self.songArr[indexPath.row];
// 3.返回生成并填充好的cell
// 每一行的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
return 70;
#pragma mark - 代理方法
// 选中一行,播放对应的音乐
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
// 1.取得该行对应的模型,并修改其isPlaying属性
Song *music = self.songArr[indexPath.row];
if (music.isPlaying) {
// 属性【正在播放】赋值为真
music.playing = YES;
// 2.传递数据源模型 给工具类播放音乐
AVAudioPlayer *audioPlayer = [SongTool playMusic:music.filename];
audioPlayer.delegate =
self.currentPlayingAudioPlayer = audioP
// 3.重要~~~在锁屏界面显示歌曲信息
[self showInfoInLockedScreen:music];
// 4.开启定时器,监听播放进度 (先关闭旧的)
[self.link invalidate];
self.link =
[self.link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
// 5.再次传递数据源模型 给自定义cell(执行转圈动画)
SongCell *cell = (SongCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.music =
// 取消选中一行时,停止音乐,动画
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
// 1.取得该行对应的模型,并修改其isPlaying属性
Song *music = self.songArr[indexPath.row];
music.playing = NO;
// 2.根据音乐名,停止音乐(内部会遍历)
[SongTool stopMusic:music.filename];
// 3.再次传递数据源模型 给自定义cell(停止转圈)
SongCell *cell = (SongCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.music =
#pragma mark - 锁屏显歌词
// 在锁屏界面显示歌曲信息(实时换图片MPMediaItemArtwork可以达到实时换歌词的目的)
- (void)showInfoInLockedScreen:(Song *)music
// 健壮性写法:如果存在这个类,才能在锁屏时,显示歌词
if (NSClassFromString(@"MPNowPlayingInfoCenter")) {
// 核心:字典
NSMutableDictionary *info = [NSMutableDictionary dictionary];
// 标题(音乐名称)
info[MPMediaItemPropertyTitle] = music.
info[MPMediaItemPropertyArtist] = music.
// 专辑名称
info[MPMediaItemPropertyAlbumTitle] = music.
info[MPMediaItemPropertyArtwork] = [[MPMediaItemArtwork alloc] initWithImage:[UIImage imageNamed:music.icon]];
// 唯一的API,单例,nowPlayingInfo字典
[MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo =
Created by beyond on 14-9-10.
Copyright (c) 2014年 com.beyond. All rights reserved.
模型,一首歌曲,成员很多
@interface Song : NSObject
@property (copy, nonatomic) NSString *
// 文件名,如@"a.mp3"
@property (copy, nonatomic) NSString *
@property (copy, nonatomic) NSString *
// 艺术家头像
@property (copy, nonatomic) NSString *singerI
// 艺术家大图片(锁屏的时候用)
@property (copy, nonatomic) NSString *
// 标记,用于转动头像
@property (nonatomic, assign, getter = isPlaying) BOOL
自定义View
SongCell.h
Created by beyond on 14-9-10.
Copyright (c) 2014年 com.beyond. All rights reserved.
View,自定义cell,依赖模型
// View 需依赖模型
@interface SongCell : UITableViewCell
// 数据源模型
@property (nonatomic, strong) Song *
// 控制器知道得最少
+ (instancetype)cellWithTableView:(UITableView *)tableV
SongCell.m
Created by beyond on 14-9-10.
Copyright (c) 2014年 com.beyond. All rights reserved.
View,自定义cell,依赖模型
#import "SongCell.h"
// 模型,数据源
#import "Song.h"
#import "Colours.h"
#pragma mark - 类扩展
@interface SongCell ()
// 用于 头像的旋转 CGAffineTransformRotate,一秒钟转45度
@property (nonatomic, strong) CADisplayLink *
@implementation SongCell
#pragma mark - 懒加载
- (CADisplayLink *)link
if (!_link) {
self.link = [CADisplayLink displayLinkWithTarget:self selector:@selector(update)];
#pragma mark - 供外界调用
+ (instancetype)cellWithTableView:(UITableView *)tableView
static NSString *ID = @"music";
SongCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
if (cell == nil) {
cell = [[SongCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
// 拦截setter方法,为内部子控件赋值,并进行转圈动画
- (void)setMusic:(Song *)music
// 设置独一无二的数据
self.textLabel.text = music.
self.detailTextLabel.text = music.
// 分类方法,创建一个圆形的边框
self.imageView.image = [UIImage circleImageWithName:music.singerIcon borderWidth:2 borderColor:[UIColor skyBlueColor]];
// 如果模型的属性isPlaying为真,则开始CGAffineTransformRotate
if (music.isPlaying) {
[self.link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
// 如果模型的isPlaying为假,则停止时钟动画,并将CGAffineTransformRotate归零
[self.link invalidate];
self.link =
self.imageView.transform = CGAffineTransformI
#pragma mark - 时钟方法
// 角速度 :
45°/s
,即8秒转一圈
- (void)update
// deltaAngle = 1/60秒 * 45
// 两次调用之间 转动的角度 == 时间 * 速度
CGFloat angle = self.link.duration * M_PI_4;
// 不用核心动画,是因为 进入后台之后,动画就停止了
self.imageView.transform = CGAffineTransformRotate(self.imageView.transform, angle);
音乐播放工具类
SongTool.h
Created by beyond on 14-9-10.
Copyright (c) 2014年 com.beyond. All rights reserved.
// 音乐工具类,必须导入AVFoundation的主头文件
@interface SongTool : NSObject
// 类方法, 播放音乐,
参数:音乐文件名 如@"a.mp3",同时为了能够给播放器AVAudioPlayer对象设置代理,在创建好播放器对象后,将其返回给调用者
// 设置代理后,可以监听播放器被打断和恢复打断
+ (AVAudioPlayer *)playMusic:(NSString *)
// 类方法, 暂停音乐,
参数:音乐文件名 如@"a.mp3"
+ (void)pauseMusic:(NSString *)
// 类方法, 停止音乐,
参数:音乐文件名 如@"a.mp3",记得从字典中移除
+ (void)stopMusic:(NSString *)
// 返回当前正在播放的音乐播放器,方便外界控制其快进,后退或其他方法
+ (AVAudioPlayer *)currentPlayingAudioP
SongTool.m
Created by beyond on 14-9-10.
Copyright (c) 2014年 com.beyond. All rights reserved.
#import "SongTool.h"
@implementation SongTool
// 字典,存放所有的音乐播放器,键是:音乐名,值是对应的音乐播放器对象audioPlayer
// 一首歌对应一个音乐播放器
static NSMutableDictionary *_audioPlayerD
#pragma mark - Life Cycle
+ (void)initialize
// 字典,键是:音乐名,值是对应的音乐播放器对象
_audioPlayerDict = [NSMutableDictionary dictionary];
// 设置后台播放
[self sutupForBackgroundPlay];
// 设置后台播放
+ (void)sutupForBackgroundPlay
// 后台播放三步曲之第三步,设置 音频会话类型
AVAudioSession *session = [AVAudioSession sharedInstance];
// 类型是:播放和录音
[session setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
// 而且要激活 音频会话
[session setActive:YES error:nil];
#pragma mark - 供外界调用
// 类方法, 播放音乐,
参数:音乐文件名 如@"a.mp3"
// 同时为了能够给播放器AVAudioPlayer对象设置代理,在创建好播放器对象后,将其返回给调用者
// 设置代理后,可以监听播放器被打断和恢复打断
+ (AVAudioPlayer *)playMusic:(NSString *)filename
// 健壮性判断
if (!filename)
// 1.先从字典中,根据音乐文件名,取出对应的audioPlayer
AVAudioPlayer *audioPlayer = _audioPlayerDict[filename];
if (!audioPlayer) {
// 如果没有,才需创建对应的音乐播放器,并且存入字典
// 1.1加载音乐文件
NSURL *url = [[NSBundle mainBundle] URLForResource:filename withExtension:nil];
// 健壮性判断
// 1.2根据音乐的URL,创建对应的audioPlayer
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
// 1.3开始缓冲
[audioPlayer prepareToPlay];
// 如果要实现变速播放,必须同时设置下面两个参数
audioPlayer.enableRate = YES;
audioPlayer.rate = 10.0;
// 1.4最后,放入字典
_audioPlayerDict[filename] = audioP
// 2.如果是暂停或停止时,才需要开始播放
if (!audioPlayer.isPlaying) {
[audioPlayer play];
// 3.返回创建好的播放器,方便调用者设置代理,监听播放器的进度currentTime
return audioP
// 类方法, 暂停音乐,
参数:音乐文件名 如@"a.mp3"
+ (void)pauseMusic:(NSString *)filename
// 健壮性判断
if (!filename)
// 1.先从字典中,根据key【文件名】,取出audioPlayer【肯定 有 值】
AVAudioPlayer *audioPlayer = _audioPlayerDict[filename];
// 2.如果是正在播放,才需要暂停
if (audioPlayer.isPlaying) {
[audioPlayer pause];
// 类方法, 停止音乐,
参数:音乐文件名 如@"a.mp3",记得从字典中移除
+ (void)stopMusic:(NSString *)filename
// 健壮性判断
if (!filename)
// 1.先从字典中,根据key【文件名】,取出audioPlayer【肯定 有 值】
AVAudioPlayer *audioPlayer = _audioPlayerDict[filename];
// 2.如果是正在播放,才需要停止
if (audioPlayer.isPlaying) {
// 2.1停止
[audioPlayer stop];
// 2.2最后,记得从字典中移除
[_audioPlayerDict removeObjectForKey:filename];
// 返回当前正在播放的音乐播放器,方便外界控制其快进,后退或其他方法
+ (AVAudioPlayer *)currentPlayingAudioPlayer
// 遍历字典的键,再根据键取出值,如果它是正在播放,则返回该播放器
for (NSString *filename in _audioPlayerDict) {
AVAudioPlayer *audioPlayer = _audioPlayerDict[filename];
if (audioPlayer.isPlaying) {
return audioP
图片加圆圈边框的分类
UIImage+Circle.h
Created by beyond on 14-9-15.
Copyright (c) 2014年 com.beyond. All rights reserved.
@interface UIImage (Circle)
+ (instancetype)circleImageWithName:(NSString *)name borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderC
UIImage+Circle.m
Created by beyond on 14-9-15.
Copyright (c) 2014年 com.beyond. All rights reserved.
#import "UIImage+Circle.h"
@implementation UIImage (Circle)
+ (instancetype)circleImageWithName:(NSString *)name borderWidth:(CGFloat)borderWidth borderColor:(UIColor *)borderColor
// 1.加载原图
UIImage *oldImage = [UIImage imageNamed:name];
// 2.开启上下文
CGFloat imageW = oldImage.size.width + 2 * borderW
CGFloat imageH = oldImage.size.height + 2 * borderW
CGSize imageSize = CGSizeMake(imageW, imageH);
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0);
// 3.取得当前的上下文
CGContextRef ctx = UIGraphicsGetCurrentContext();
// 4.画边框(大圆)
[borderColor set];
CGFloat bigRadius = imageW * 0.5; // 大圆半径
CGFloat centerX = bigR // 圆心
CGFloat centerY = bigR
CGContextAddArc(ctx, centerX, centerY, bigRadius, 0, M_PI * 2, 0);
CGContextFillPath(ctx); // 画圆
CGFloat smallRadius = bigRadius - borderW
CGContextAddArc(ctx, centerX, centerY, smallRadius, 0, M_PI * 2, 0);
// 裁剪(后面画的东西才会受裁剪的影响)
CGContextClip(ctx);
[oldImage drawInRect:CGRectMake(borderWidth, borderWidth, oldImage.size.width, oldImage.size.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
// 8.结束上下文
UIGraphicsEndImageContext();
return newI
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'为什么我的苹果5s用QQ音乐听歌,每次锁屏后,音乐会自动暂停。怎么会事啊。_百度知道
为什么我的苹果5s用QQ音乐听歌,每次锁屏后,音乐会自动暂停。怎么会事啊。
我有更好的答案
0会修复这个问题,可以直接去app store更新就不会有这个问题,你可以试试把手机密码取消掉就可以了.0,尽量不要用itools或者手机助手之类软件升级qq音乐,我的就是这样。4。腾讯软件技术人员说了上面的回答都没用的
在qq音乐里面,设置后台播放
没有后台播放
呵呵,呵呵呵,没事滴,自然情况。。。偶滴也是,,,嘻嘻
按返回,自己按锁屏
我也是,同求
我的也这样,你的好了没?
其他类似问题
为您推荐:
qq音乐的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁为什么我的iPhone4S在播放音乐时锁屏会停止播放音乐?有没有什么解决办法?急!!!_百度知道
为什么我的iPhone4S在播放音乐时锁屏会停止播放音乐?有没有什么解决办法?急!!!
我有更好的答案
用app软件下载正版播放器。
用的什么播放器?
用酷狗呗!
用的什么app?
锁屏时候摁home.看是不是暂停了
锁屏就暂停
按不安home都一样
1/安装了清理软件.卸载. 2/没越狱系统本身问题.有能力就重刷新的ios
清理软件?
你都装了什么.比如金山.360这些
什么都没装啊
那就是酷我的问题了,酷我设置里.你找找是不是锁屏设置问题
其他类似问题
为您推荐:
iphone4s的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 苹果自动锁屏停止播放 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信