在VideoView开始播放之前,我找不到任何解决方案来显示正在加载的动画(或只是imageView):在视频缓冲期间。

有人有线索吗 ?

谢谢。

最佳答案

或者,您可以只使用“进度对话框”;

public class VideoEkrani extends Activity {

    VideoView ekran;
    String kaynakYolu = "http://commonsware.com/misc/test2.3gp";
    ProgressDialog progDailog;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sayfa_video_goruntule);


        ekran = (VideoView) findViewById(R.id.videoViewESPU);
        ekran.setMediaController(new MediaController(this));
        ekran.setVideoURI(Uri.parse(kaynakYolu));
        ekran.requestFocus();
        ekran.start();

        progDailog = ProgressDialog.show(this, "Please wait ...", "Retrieving data ...", true);

        ekran.setOnPreparedListener(new OnPreparedListener() {

            public void onPrepared(MediaPlayer mp) {
                // TODO Auto-generated method stub
                progDailog.dismiss();
            }
        });
    }
}

关于android - Android在VideoView启动之前加载动画,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5859702/

10-11 00:08