Commit ad39c954 authored by Geoffrey Métais's avatar Geoffrey Métais

Convert VLC transcode warning to Toast

parent 8695d116
......@@ -208,9 +208,7 @@ public class VLCApplication extends Application {
@Override
public void onDisplay(Dialog.QuestionDialog dialog) {
if ("Insecure site".equals(dialog.getTitle())) {
Util.byPassChromecastDialog(dialog);
} else {
if (!Util.byPassChromecastDialog(dialog)) {
final String key = DialogActivity.KEY_QUESTION + sDialogCounter++;
fireDialog(dialog, key);
}
......
......@@ -27,6 +27,7 @@ import android.content.pm.ResolveInfo;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.widget.Toast;
import org.videolan.libvlc.Dialog;
import org.videolan.libvlc.util.AndroidUtil;
......@@ -187,9 +188,17 @@ public class Util {
ctx.startForegroundService(intent);
}
public static void byPassChromecastDialog(Dialog.QuestionDialog dialog) {
if ("View certificate".equals(dialog.getAction1Text())) dialog.postAction(1);
else if ("Accept permanently".equals(dialog.getAction2Text())) dialog.postAction(2);
dialog.dismiss();
public static boolean byPassChromecastDialog(Dialog.QuestionDialog dialog) {
if ("Insecure site".equals(dialog.getTitle())) {
if ("View certificate".equals(dialog.getAction1Text())) dialog.postAction(1);
else if ("Accept permanently".equals(dialog.getAction2Text())) dialog.postAction(2);
dialog.dismiss();
return true;
} else if ("Performance warning".equals(dialog.getTitle())) {
Toast.makeText(VLCApplication.getAppContext(), dialog.getText(), Toast.LENGTH_LONG).show();
dialog.dismiss();
return true;
}
return false;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment