Exemple #1
0
 @Override
 public void handleMessage(Message msg) {
   // TODO Auto-generated method stub
   super.handleMessage(msg);
   // Log.i("tvinfo", msg.what + "-" + msg.obj);
   if (msg.what == 1) {
     progress.setVisibility(View.VISIBLE);
     title.setText("开始播放 ...");
   }
   if (msg.what == 2) {
     title.setText("开始加载 ...");
   }
   if (msg.what == 3) {
     title.setText("开始播放 ...");
     play(prg);
   }
   if (msg.what == 4) {
     title.setText("加载失败 ...");
   }
   if (msg.what == 9) {
     show("获取", "正在获取播放列表,请稍后...");
   }
   if (msg.what == -100) {
     playmenu.setVisibility(View.GONE);
   }
   if (msg.what == 66) {
     if (player != null && player.isPlaying() && !isseek) {
       currtime.setText(Utils.longToString(player.getCurrentPosition()));
       playSeek.setProgress(player.getCurrentPosition() / 1000);
     }
   }
 }
Exemple #2
0
 @Override
 public void onPrepared(MediaPlayer player) {
   // TODO Auto-generated method stub
   Log.i("tvinfo", "onPrepared");
   player.start();
   playSeek.setEnabled(true);
   playSeek.setMax(player.getDuration() / 1000);
   totaltime.setText(Utils.longToString(player.getDuration()));
   if (tupdate == null) {
     tupdate = new SeekBarUpdateThread(handler);
     tupdate.start();
   }
 }