Search in sources :

Example 1 with PLOnInfoListener

use of com.pili.pldroid.player.PLOnInfoListener in project PLDroidPlayer by pili-engineering.

the class ChangeActivity method initLive.

private void initLive() {
    // mVideoView = new PLVideoView(this);
    // mBinding.main2VideoLayout.removeAllViews();
    // mBinding.main2VideoLayout.addView(mVideoView);
    mVideoView.setOnPreparedListener(new PLOnPreparedListener() {

        @Override
        public void onPrepared(int i) {
            Log.i("==plVideo==", "onPrepared:" + i);
            mVideoView.start();
        }
    });
    mVideoView.setOnInfoListener(new PLOnInfoListener() {

        @Override
        public void onInfo(int i, int i1, Object o) {
            if (i == PLOnInfoListener.MEDIA_INFO_VIDEO_RENDERING_START) {
                Log.i("==plVideo==", "onInfo:" + i + "," + i1);
            }
        }
    });
    mVideoView.setOnCompletionListener(new PLOnCompletionListener() {

        @Override
        public void onCompletion() {
            Log.i("==plVideo==", "onCompletion:");
        }
    });
    mVideoView.setOnVideoSizeChangedListener(new PLOnVideoSizeChangedListener() {

        @Override
        public void onVideoSizeChanged(int i, int i1) {
            Log.i("==plVideo==", "onVideoSizeChanged:" + i + "," + i1);
        }
    });
    mVideoView.setOnErrorListener(new PLOnErrorListener() {

        @Override
        public boolean onError(int i, Object o) {
            Log.i("==plVideo==", "onError:" + i);
            return false;
        }
    });
    // mVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_ORIGIN);
    mVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_FIT_PARENT);
    // mVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_PAVED_PARENT);
    // mVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_16_9);
    // mVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_4_3);
    mVideoView.setAVOptions(getAVOptions());
    mVideoView.setVideoPath(url1);
}
Also used : PLOnErrorListener(com.pili.pldroid.player.PLOnErrorListener) PLOnCompletionListener(com.pili.pldroid.player.PLOnCompletionListener) PLOnPreparedListener(com.pili.pldroid.player.PLOnPreparedListener) PLOnInfoListener(com.pili.pldroid.player.PLOnInfoListener) PLOnVideoSizeChangedListener(com.pili.pldroid.player.PLOnVideoSizeChangedListener)

Aggregations

PLOnCompletionListener (com.pili.pldroid.player.PLOnCompletionListener)1 PLOnErrorListener (com.pili.pldroid.player.PLOnErrorListener)1 PLOnInfoListener (com.pili.pldroid.player.PLOnInfoListener)1 PLOnPreparedListener (com.pili.pldroid.player.PLOnPreparedListener)1 PLOnVideoSizeChangedListener (com.pili.pldroid.player.PLOnVideoSizeChangedListener)1