- 易迪拓培训,专注于微波、射频、天线设计工程师的培养
后台播放音乐过程中播放视频 ,长按蓝牙耳机的下一首按键音乐与视频同时播 放
录入:edatop.com 点击:
[DESCRIPTION]
操作步骤:
1. 手机连接蓝牙耳机,后台播放音乐
2. 播放任意视频,在视频播放界面长按蓝牙耳机的上一首/下一首按键
实际结果:
音乐和视频同时播放
[SOLUTION]
请修改
alps\packages\apps\gallery2\src\com\android\gallery3d\app\MoviePlayer.java中以下方法,
1. private static boolean isMediaKey(int keyCode) {
return keyCode == KeyEvent.KEYCODE_HEADSETHOOK
keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD || /////// add this line.
keyCode == KeyEvent.KEYCODE_MEDIA_REWIND || ///////add this line.
keyCode == KeyEvent.KEYCODE_MEDIA_PREVIOUS ||
keyCode == KeyEvent.KEYCODE_MEDIA_NEXT ||
keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE ||
keyCode == KeyEvent.KEYCODE_MEDIA_PLAY ||
keyCode == KeyEvent.KEYCODE_MEDIA_PAUSE;
}
2. 在onKeyDown() switch语句里增加一个case:
public boolean onKeyDown(int keyCode, KeyEvent event) {
.....
.....
case KeyEvent.KEYCODE_MEDIA_NEXT:
// /M:modify for slidevideo
if (!(mActivityContext instanceof MovieActivity)) {
return false;
}
if (((MovieActivity) mActivityContext).mMovieList == null) {
return false;
}
mPlayerExt.startNextVideo(((MovieActivity) mActivityContext).mMovieList
.getNext(mMovieItem));
return true;
case KEYCODE_MEDIA_FAST_FORWARD: ///////add this case
case KEYCODE_MEDIA_REWIND: ///////add this case
return true;
}
return false;
}
操作步骤:
1. 手机连接蓝牙耳机,后台播放音乐
2. 播放任意视频,在视频播放界面长按蓝牙耳机的上一首/下一首按键
实际结果:
音乐和视频同时播放
[SOLUTION]
请修改
alps\packages\apps\gallery2\src\com\android\gallery3d\app\MoviePlayer.java中以下方法,
1. private static boolean isMediaKey(int keyCode) {
return keyCode == KeyEvent.KEYCODE_HEADSETHOOK
keyCode == KeyEvent.KEYCODE_MEDIA_FAST_FORWARD || /////// add this line.
keyCode == KeyEvent.KEYCODE_MEDIA_REWIND || ///////add this line.
keyCode == KeyEvent.KEYCODE_MEDIA_PREVIOUS ||
keyCode == KeyEvent.KEYCODE_MEDIA_NEXT ||
keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE ||
keyCode == KeyEvent.KEYCODE_MEDIA_PLAY ||
keyCode == KeyEvent.KEYCODE_MEDIA_PAUSE;
}
2. 在onKeyDown() switch语句里增加一个case:
public boolean onKeyDown(int keyCode, KeyEvent event) {
.....
.....
case KeyEvent.KEYCODE_MEDIA_NEXT:
// /M:modify for slidevideo
if (!(mActivityContext instanceof MovieActivity)) {
return false;
}
if (((MovieActivity) mActivityContext).mMovieList == null) {
return false;
}
mPlayerExt.startNextVideo(((MovieActivity) mActivityContext).mMovieList
.getNext(mMovieItem));
return true;
case KEYCODE_MEDIA_FAST_FORWARD: ///////add this case
case KEYCODE_MEDIA_REWIND: ///////add this case
return true;
}
return false;
}
申明:网友回复良莠不齐,仅供参考。如需专业帮助,请学习易迪拓培训专家讲授的ADS视频培训课程。
上一篇:CADSTAR 16的破解
下一篇:ADS的help打不开...怎么办
ADS培训课程推荐详情>>
国内最全面、最专业的Agilent ADS培训课程,可以帮助您从零开始,全面系统学习ADS设计应用【More..】
- Agilent ADS教学培训课程套装
- 两周学会ADS2011、ADS2013视频教程
- ADS2012、ADS2013射频电路设计详解
- ADS高低阻抗线微带滤波器设计培训教程
- ADS混频器仿真分析实例视频培训课程
- ADS Momentum电磁仿真设计视频课程
- ADS射频电路与通信系统设计高级培训
- ADS Layout和电磁仿真设计培训视频
- ADS Workspace and Simulators Training Course
- ADS Circuit Simulation Training Course
- ADS Layout and EM Simulation Training Course
- Agilent ADS 内部原版培训教材合集