-1

In my application i want to stream video. In case if mobile can not play that video VideoView shows dilogue like this what i want if to customize this dialogue and insert two buttons one to download this video and one to try to play an Low Quality video. right now in onErrorLitener of VideoView i am showing dialogue to user but in this way with my dialogue VideoView own dialogue also show on screen which i don't want.

If i cant customize VideoView Error dialogue can i make it dont show on screen

enter image description here

Yahya Arshad
  • 1,626
  • 2
  • 19
  • 34

2 Answers2

0
        AlertDialog.Builder builder=new Builder(YourActivityName.this);
        builder.setTitle("Video");
        builder.setMessage("Message you want to pass");
        builder.setPositiveButton("Download", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub

            }
        });
        builder.setNegativeButton("Play", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub

            }
        });
        builder.create();
        builder.show();

Just write code u wanna perform on download/play button click.

AkashG
  • 7,868
  • 3
  • 28
  • 43
0

I solved my problem @AkashG by putting your code in MediaPlay.setOnErrorListener()

AlertDialog.Builder builder=new Builder(YourActivityName.this);
        builder.setTitle("Video");
        builder.setMessage("Message you want to pass");
        builder.setPositiveButton("Download", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub

            }
        });
        builder.setNegativeButton("Play", new DialogInterface.OnClickListener() {

            public void onClick(DialogInterface dialog, int which) {
                // TODO Auto-generated method stub

            }
        });
        builder.create();
        builder.show();
User42590
  • 2,473
  • 12
  • 44
  • 85
Yahya Arshad
  • 1,626
  • 2
  • 19
  • 34