MediaControl seekbar问题android [英] Mediacontrol seekbar issue android

查看:128
本文介绍了MediaControl seekbar问题android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Android应用程序中,我正在使用MediaControllerMediaController搜寻栏.
我想知道用户是否搜索到大于缓冲位置的位置,我需要显示一个对话框,然后在搜索完成时关闭对话.
请让我知道是否可以解决此问题.

In my Android application I am facing issue with seekbar of MediaController that I am using for Videoview.
I would like to know if the user seeks to a position greater than the buffered position,I need to show a dialog and then dismiss the dialogue on seek completed.
Please let me know if I can have this solved.

推荐答案

mSeekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

   @Override
   public void onStopTrackingTouch(SeekBar arg0) {
         // you can check for the current buffer state and where the use seek using mSeekBar.getProgress() and then open up a dialog.

        if(condition to match buffering and seek position)
               openDialog();
   }

   @Override
   public void onStartTrackingTouch(SeekBar arg0) {

   }

   @Override
   public void onProgressChanged(SeekBar arg0, int progress, boolean arg2) {

   }
  });

...

public void openDialog()
{
  ...
  // check for buffer level to match your seek position
  // when it meets the codition,cancel the dialog.
  ...
}

这篇关于MediaControl seekbar问题android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆