【问题标题】:I want to play https videos in android app我想在安卓应用中播放 https 视频
【发布时间】:2016-12-10 20:13:36
【问题描述】:

我想在 android 中播放来自安全 url (https) 的视频。 我用过 vitamio 播放器,但这个播放器只播放来自 http 连接而不是 https 的视频。 这是我的代码。

Vitamio.isInitialized(getApplicationContext());

    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.tvplay);
    Log.d("url=", getIntent().getStringExtra("url"));
    url = getIntent().getStringExtra("url");
    init();

}

public void init() {
    load = (ProgressBar) this.findViewById(R.id.load);
    empty = (TextView) this.findViewById(R.id.empty);
    mVideoView = (VideoView) this.findViewById(R.id.surface_view);
    mVideoView.setMediaController(new MediaController(this));
    mVideoView.setOnCompletionListener(this);
    mVideoView.setOnPreparedListener(this);
    mVideoView.setOnErrorListener(this);
    Uri videoUri = Uri.parse(url);
    mVideoView.setVideoURI(videoUri);
    mVideoView.requestFocus();
    loading();
}

private void loading() {
    load.setVisibility(View.VISIBLE);
    empty.setVisibility(View.GONE);
}

private void loadComplete(MediaPlayer arg0) {
    load.setVisibility(View.GONE);
    // vv.setVisibility(View.VISIBLE);
    empty.setVisibility(View.GONE);
    mVideoView.start();
    mVideoView.resume();
}

private void error(String msg) {
    load.setVisibility(View.GONE);
    mVideoView.setVisibility(View.GONE);
    empty.setVisibility(View.VISIBLE);
    if (msg != null)
        empty.setText(msg);
}

请帮助我。 谢谢

【问题讨论】:

    标签: android https youtube android-videoview vitamio


    【解决方案1】:

    Vitamio 不直接支持 https。您可能需要使用 OpenSSL 重新编译库。或者使用其他支持 SSL 的开源播放器

    【讨论】:

      猜你喜欢
      • 2013-03-05
      • 1970-01-01
      • 2012-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-26
      • 1970-01-01
      相关资源
      最近更新 更多