91视频专区

《熊出没重返地球播放》-电影-完整版高清视频在线观看...

可大部分酒吧全都是凌晨开放,一直到通宵,短短几个小时就能够让你释放掉所有的激情与活力。

2024年12月14日,2024-07-12 14:16·羊城派

《熊出没重返地球播放》-电影-完整版高清视频在线观看...

你真的能帮我忘掉烦恼吗我问

推特旧金山办公室位于该市金融区,距离推特总部大楼约3.2公里。推特此前被曝出,已经数个星期未支付总部大楼或其他全球办公室的租金。一是突出旅游装备。结合天津市全国先进制造研发基地的城市定位,重点展示房车露营装备、景区装备、酒店装备、特种旅游装备等内容,特别是结合天津资源禀赋,呈现海洋旅游装备、邮轮游艇等内容。

MediaPlayerbofangyinpinyushipin2018-07-06 12:31·aiyinledechengxuyuanxiaoxinren1.xiangguanfangfaxiangjie1)huodeMediaPlayershili:keyizhijienewhuozhediaoyongcreatefangfachuangjian:MediaPlayer mp = new MediaPlayer();MediaPlayer mp = MediaPlayer.create(this, R.raw.test); //wuxuzaidiaoyongsetDataSourcelingwaicreatehuanyouzheyangdexingshi: create(Context context, Uri uri, SurfaceHolder holder) tongguoUrihezhiding SurfaceHolder 【chouxianglei】 chuangjianyigeduomeitibofangqi2)shezhibofangwenjian://①rawxiadeziyuan:MediaPlayer.create(this, R.raw.test);//②bendiwenjianlujing:mp.setDataSource("/sdcard/test.mp3");//③wangluoURLwenjian:mp.setDataSource("http://www.xxx.com/music/test.mp3");lingwaisetDataSource()fangfayouduoge,limianyouzheyangyigeleixingdecanshu:FileDescriptor,zaishiyongzhege APIdeshihou,xuyaobawenjianfangdaoreswenjianjiapingjideassetswenjianjiali,ranhoushiyongxiashudaimashezhiDataSource:AssetFileDescriptor fileDescriptor = getAssets().openFd("rain.mp3");m_mediaPlayer.setDataSource(fileDescriptor.getFileDescriptor(),fileDescriptor.getStartOffset(), fileDescriptor.getLength());3)qitafangfagetCurrentPosition( ):dedaodangqiandebofangweizhigetDuration() :dedaowenjiandeshijiangetVideoHeight() :dedaoshipingaodugetVideoWidth() :dedaoshipinkuanduisLooping():shifouxunhuanbofangisPlaying():shifouzhengzaibofangpause():zantingprepare():zhunbei(tongbu)prepareAsync():zhunbei(yibu)release():shifangMediaPlayerduixiangreset():zhongzhiMediaPlayerduixiangseekTo(int msec):zhidingbofangdeweizhi(yihaomiaoweidanweideshijian)setAudioStreamType(int streamtype):zhidingliumeitideleixingsetDisplay(SurfaceHolder sh):shezhiyongSurfaceHolderlaixianshiduomeitisetLooping(boolean looping):shezhishifouxunhuanbofangsetOnBufferingUpdateListener(MediaPlayer.OnBufferingUpdateListener listener): wangluoliumeitidehuanchongjiantingsetOnCompletionListener(MediaPlayer.OnCompletionListener listener): wangluoliumeitibofangjieshujiantingsetOnErrorListener(MediaPlayer.OnErrorListener listener): shezhicuowuxinxijiantingsetOnVideoSizeChangedListener(MediaPlayer.OnVideoSizeChangedListener listener): shipinchicunjiantingsetScreenOnWhilePlaying(boolean screenOn):shezhishifoushiyongSurfaceHolderxianshisetVolume(float leftVolume, float rightVolume):shezhiyinliangstart():kaishibofangstop():tingzhibofang2.shiyongdaimashilishiliyi:shiyongMediaPlayerbofangyinpin:yunxingxiaoguotu:guanjiandaima:public class MainActivity extends AppCompatActivity implements View.OnClickListener{ private Button btn_play; private Button btn_pause; private Button btn_stop; private MediaPlayer mPlayer = null; private boolean isRelease = true; //panduanshifouMediaPlayershifoushifangdebiaozhi @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); bindViews(); } private void bindViews() { btn_play = (Button) findViewById(R.id.btn_play); btn_pause = (Button) findViewById(R.id.btn_pause); btn_stop = (Button) findViewById(R.id.btn_stop); btn_play.setOnClickListener(this); btn_pause.setOnClickListener(this); btn_stop.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()){ case R.id.btn_play: if(isRelease){ mPlayer = MediaPlayer.create(this,R.raw.fly); isRelease = false; } mPlayer.start(); //kaishibofang btn_play.setEnabled(false); btn_pause.setEnabled(true); btn_stop.setEnabled(true); break; case R.id.btn_pause: mPlayer.pause(); //tingzhibofang btn_play.setEnabled(true); btn_pause.setEnabled(false); btn_stop.setEnabled(false); break; case R.id.btn_stop: mPlayer.reset(); //zhongzhiMediaPlayer mPlayer.release(); //shifangMediaPlayer isRelease = true; btn_play.setEnabled(true); btn_pause.setEnabled(false); btn_stop.setEnabled(false); break; } }}zhuyishixiang:bofangdeshires/rawmuluxiadeyinpinwenjian,chuangjianMediaPlayerdiaoyongdeshicreatefangfa,diyiciqidongbofangqian buxuyaozaidiaoyongprepare(),ruguoshishiyonggouzaofangfagouzaodehua,zexuyaodiaoyongyiciprepare()fangfa! lingwaitiexiaguanfangwendangzhong,congqitaliangzhongtujingbofangyinpindeshilidaima:bendiUri:Uri myUri = ....; // initialize Uri hereMediaPlayer mediaPlayer = new MediaPlayer();mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);mediaPlayer.setDataSource(getApplicationContext(), myUri);mediaPlayer.prepare();mediaPlayer.start();waibuURL:String url = "http://........"; // your URL hereMediaPlayer mediaPlayer = new MediaPlayer();mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);mediaPlayer.setDataSource(url);mediaPlayer.prepare(); // might take long! (for buffering, etc)mediaPlayer.start();Note:jiarunitongguoyigeURLyiliudexingshibofangzaixianyinpinwenjian,gaiwenjianbixukeyijinxing jianjinshixiazaishilier:shiyongMediaPlayerbofangshipinMediaPlayerzhuyaoyongyubofangyinpin,meiyoutigongtuxiangshuchujiemian,suoyiwomenxuyaojiezhuqitade zujianlaixianshiMediaPlayerbofangdetuxiangshuchu,womenkeyishiyongyongSurfaceView laixianshi,xiamianwomenshiyongSurfaceViewlaixiegeshipinbofangdelizi:yunxingxiaoguotu:shixiandaima:bujuwenjian:activity_main.xml

意见反馈 合作

Copyright ? 2023 Sohu All Rights Reserved

搜狐公司 版权所有