如何使用MX PLAYER等外部视频播放器播放视频?

时间:2019-03-23 11:26:10

标签: java android

我申请了一个网站,该网站包含链接iptv“ m3u8”和“ ts”,例如,当我单击“ bein sport”之类的频道时,该频道只能在MX PLAYER上运行视频播放器,该怎么做?

public class Main4Activity extends Activity {

    InterstitialAd mInterstitialAd;
    private InterstitialAd interstitial;
    ProgressBar b;

    private WebView mWeeb1;
    private String wuffy = "co.wuffy.player";
    private static final String _IPTV_CORE_CLASS_NAME = "org.wuffy.videoplayer.WuffyPlayer";
    private static final String _IPTV_CORE_PACKAGE_NAME = "co.wuffy.player";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);

mWeeb1 = (WebView) findViewById(R.id.webview);
        mWeeb1.loadUrl("https://mywebsite465.com/?m=0");

        WebSettings webSettings = mWeeb1.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webSettings.setSupportZoom(false);
        webSettings.setAllowFileAccess(true);

    }
    private void b(String paramString)
        {
            new Bundle();
            try {
                Intent localIntent = new Intent();
                localIntent.setClassName("co.wuffy.player", "org.wuffy.videoplayer.WuffyPlayer");
                localIntent.setData(Uri.parse(paramString));
                localIntent.putExtra("package", getPackageName());
                localIntent.putExtra("path", paramString);
                localIntent.putExtra("name", "www..com");
                localIntent.putExtra("decode_mode", (byte)2);
                localIntent.putExtra("secure_uri", true);
                startActivity(localIntent);
                finish();
                return;
            } catch (ActivityNotFoundException localActivityNotFoundException) {
                checkInstalledwuffy();
            }
        }

        private void checkInstalledwuffy () {
            AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
            localBuilder.setTitle("Wuffy Media Player not installed");
            localBuilder.setMessage("Please install Wuffy Media Player app from Google Play to Watch Channel");
            localBuilder.setPositiveButton("Install", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt) throws ActivityNotFoundException {
                    Main4Activity.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=co.wuffy.player")));
                    return;
                }
            });
            localBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt) {
                    Main4Activity.this.finish();
                }
            });
            localBuilder.setCancelable(false);
            localBuilder.create().show();
        }

0 个答案:

没有答案