惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
C
Check Point Blog
I
InfoQ
A
About on SuperTechFans
Engineering at Meta
Engineering at Meta
月光博客
月光博客
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
T
Tailwind CSS Blog
Y
Y Combinator Blog
博客园 - Franky
博客园_首页
罗磊的独立博客
量子位
美团技术团队
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Martin Fowler
Martin Fowler
博客园 - 叶小钗
aimingoo的专栏
aimingoo的专栏

博客园 - 狗尾草-大数据收割基

微信小程序-本地云函数调试失败,卡在“正在开启本地调试中” VS Code调试Python时,选择conda虚拟环境,配置环境变量 微信小程序集成vant mac配置ssh 到github ios app响应background,foreground 事件实现 ios UIScrollView 中控件自动增加间隔 iOS 导航栏实现总结 ios界面布局整理 android ProGuard 代码混淆实现 mac版 android破解软件下载安装 在unix系统下的 .o文件 .a文件 .so文件说明和相互关系 android中的广播接收实现总结 用java的jdk 生成android 的jni接口文档 Android 自定义Application android项目中配置NDK自动编译生成so文件 创建android Notification (ios) nsnotification总结 (ios) 屏幕触摸总结 sqlite数据库 select 查询带换行符数据
(ios)MPMoviePlayerController首次播放视频的时候,没有控制条
狗尾草-大数据收割基 · 2015-04-26 · via 博客园 - 狗尾草-大数据收割基

问题:

      在视频播放时,现在控制条采用磨砂的效果,会遮罩部分视频

解决思路

1 播放器直接设置不带控制条,在app在 Foreground状态,默认播放器暂停,这样需要在获得Foreground事件,进行设置播放

- (void) viewWillAppear:(BOOL)animated{  

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterForegroundNotification) name:UIApplicationWillEnterForegroundNotification object:nil];  

}  

- (void) appWillEnterForegroundNotification{  

    NSLog(@"trigger event when will enter foreground.");  

}  

-(void) viewDidDisappear:(BOOL)animated{  

    [[NSNotificationCenter defaultCenter] removeObserver:self];      

}  

2 直接侦听播放器准备播放通知,在通知中设置播放器带控制条

  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:)

                                                     name:MPMoviePlayerReadyForDisplayDidChangeNotification

                                                   object:player];

- (void) moviePlayBackDidFinish:(NSNotification*)notification

{

    player.controlStyle =MPMovieControlStyleEmbedded;

    [[NSNotificationCenter defaultCenter]removeObserver:self name:MPMoviePlayerReadyForDisplayDidChangeNotification object:player];

}