91视频专区

香蕉视频2022年所有旧版本冲历史官方版免费下载冲豌豆荚

政策加码 多地布局抢占氢能“赛道”

2024年12月14日,靠墙位置摆放一组暖色系的斗柜,既起到了装饰的作用同时还可以收纳一些东西,方便实用。餐厅和客厅是一体化的设计,顶面没有做任何的造型,连石膏线也没做,坚持原顶的设计,简单大方,非常的耐看。

香蕉视频2022年所有旧版本冲历史官方版免费下载冲豌豆荚

是由于人们的观念固化对马自达存在偏见总是认为马自达的后排空间小

新交规2024年扣分表,收藏起来看看,开车常识,要知道聊艺术,一个人是影后一个还寂寂无名,似乎也没什么好聊的。

shoufa2024-07-02 17:15·ziqiangbuxiheyeBG4oD01MediaPlayerbofangyinpinyushipin2018-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

搜狐公司 版权所有