2

在自适应比特率的情况下,任何人都可以提供视频的配置。我有一个基于 smil 的 m3u8 格式。他们是我们可以在搜索栏中为高清选项使用的任何选项吗?我的设备使用 VITAMIO 播放器。

public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        if (!LibsChecker.checkVitamioLibs(this))
            return;
        setContentView(R.layout.videoview);
        mEditText = (EditText) findViewById(R.id.url);
        //mVideoView = (VideoView) findViewById(R.id.surface_view);
        mVideoView=(io.vov.vitamio.widget.VideoView) findViewById(R.id.surface_view);
        if (path == "") {
            // Tell the user to provide a media file URL/path.
            Toast.makeText(this, "Please edit VideoViewDemo Activity, and set path" + " variable to your media file URL/path", Toast.LENGTH_LONG).show();
            return;
        } else {
            /*
             * Alternatively,for streaming media you can use
             * mVideoView.setVideoURI(Uri.parse(URLstring));
             */
            mVideoView.setVideoPath(path);
            mVideoView.setMediaController(new MediaController(this));
            mVideoView.requestFocus();

            mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
                @Override
                public void onPrepared(MediaPlayer mediaPlayer) {
                    // optional need Vitamio 4.0
                    mediaPlayer.setPlaybackSpeed(1.0f);
                    mediaPlayer.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
                    mediaPlayer.setAdaptiveStream(true);
                    //Log.d("**********************Testing   ",""+mediaPlayer.getCurrentFrame());
                    //Log.d("TESTING      dvdherdhdfhdfhdfh  ",""+MediaPlayer.VIDEOQUALITY_LOW);
                }
            });
        }

    }

    public void startPlay(View view) {
        String url = mEditText.getText().toString();
        path = url;
        if (!TextUtils.isEmpty(url)) {
            mVideoView.setVideoPath(url);
        }
    }

    public void openVideo(View View) {
      mVideoView.setVideoPath(path);
    }
4

0 回答 0