当前位置: 首页>>代码示例>>Java>>正文


Java MediaPlayer.getVideoWidth方法代码示例

本文整理汇总了Java中android.media.MediaPlayer.getVideoWidth方法的典型用法代码示例。如果您正苦于以下问题:Java MediaPlayer.getVideoWidth方法的具体用法?Java MediaPlayer.getVideoWidth怎么用?Java MediaPlayer.getVideoWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.media.MediaPlayer的用法示例。


在下文中一共展示了MediaPlayer.getVideoWidth方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPrepared

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onPrepared(MediaPlayer mp) {
    Log.d(TAG,"onPrepared...");
    mStatus = STATUS_PREPARED;

    onPlayerEvent(OnPlayerEventListener.EVENT_CODE_PREPARED,null);

    // Get the capabilities of the player for this stream
    // REMOVED: Metadata

    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();

    int seekToPosition = startSeekPos;  // mSeekWhenPrepared may be changed after seekTo() call
    if (seekToPosition != 0) {
        seekTo(seekToPosition);
        startSeekPos = 0;
    }

    // We don't know the video size yet, but should start anyway.
    // The video size might be reported to us later.
    Log.d(TAG,"mTargetStatus = " + mTargetStatus);
    if (mTargetStatus == STATUS_STARTED) {
        start();
    }
}
 
开发者ID:jiajunhui,项目名称:PlayerBase,代码行数:26,代码来源:DefaultDecoderPlayer.java

示例2: onVideoSizeChanged

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
    try {
        PureVideoView.this.mVideoWidth = mp.getVideoWidth();
        PureVideoView.this.mVideoHeight = mp.getVideoHeight();
    } catch (IllegalStateException ex) {
        PureVideoView.this.notifyError("onVideoSizeChanged", ex, PureVideoView
                .MEDIA_ERROR_ILLEGAL_STATE);
        PureVideoView.this.mVideoWidth = 0;
        PureVideoView.this.mVideoHeight = 0;
    }
    PureVideoView.this.mVideoSarNum = 1;
    PureVideoView.this.mVideoSarDen = 1;
    if (PureVideoView.this.mVideoWidth != 0 && PureVideoView.this.mVideoHeight != 0) {
        if (PureVideoView.this.mRenderView != null) {
            PureVideoView.this.mRenderView.setVideoSize(PureVideoView.this.mVideoWidth,
                    PureVideoView.this.mVideoHeight);
            PureVideoView.this.mRenderView.setVideoSampleAspectRatio(PureVideoView.this
                    .mVideoSarNum, PureVideoView.this.mVideoSarDen);
        }
        PureVideoView.this.requestLayout();
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:23,代码来源:PureVideoView.java

示例3: surfaceCreated

import android.media.MediaPlayer; //导入方法依赖的package包/类
@Override
public void surfaceCreated(SurfaceHolder holder) {
    if (bgVideo != 0) {
        mp = new MediaPlayer();
        AssetFileDescriptor afd = context.getResources().openRawResourceFd(bgVideo);
        try {
            mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getDeclaredLength());
            mp.prepare();
        } catch (IOException e) {
            e.printStackTrace();
        }
        int videoWidth = mp.getVideoWidth();
        int videoHeight = mp.getVideoHeight();
        int screenHeight = getHeight();
        android.view.ViewGroup.LayoutParams lp = getLayoutParams();

        lp.height = screenHeight;

        setLayoutParams(lp);
        mp.setDisplay(getHolder());

        mp.setLooping(true);
        mp.start();
    }
}
 
开发者ID:vrjgamer,项目名称:VVideoBackground,代码行数:26,代码来源:VVideoBackground.java

示例4: onPrepared

import android.media.MediaPlayer; //导入方法依赖的package包/类
@Override
public void onPrepared(MediaPlayer mp) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    setVideoViewSize(TYPE_NORMAL);
    mp.start();
    mLoadingView.setVisibility(View.INVISIBLE);
    mMediaSkb.setMax(mVideoPlayer.getDuration());
    mTotalDuration.setText(TimeUtils.toTimeStr(mVideoPlayer.getDuration()));
    mHandler.sendEmptyMessageDelayed(REFRESH_MESSAGE, 1000);
    if (mUri != null) {
        mMediaName.setText(mUri.toString());
    } else if (mMediaItems != null) {
        if (mMediaItems.get(mCurrentPlayIndex) != null)
            mMediaName.setText(mMediaItems.get(mCurrentPlayIndex).getDisplayName());
    } else if (!TextUtils.isEmpty(mPath)) {
        mMediaName.setText(mPath);
    }
}
 
开发者ID:iPanelkegy,项目名称:MobileMedia,代码行数:20,代码来源:SystemVideoPlayerActivity.java

示例5: onPrepared

import android.media.MediaPlayer; //导入方法依赖的package包/类
/**
 * ピックアップビデオ準備完了
 */
@Override
public void onPrepared(MediaPlayer mp) {
    int height = mp.getVideoHeight();
    int width = mp.getVideoWidth();

    int[] outSize = calcVideoSize(width, height);

    ViewGroup.LayoutParams layoutParams = mPickedVideoView.getLayoutParams();
    layoutParams.width = outSize[0];
    layoutParams.height = outSize[1];

    mRootView.requestLayout();

    mp.start();

    Handler handler = new Handler();
    handler.postDelayed(new Runnable() {
        @Override
        public void run() {
            mPickedVideoView.setVisibility(View.VISIBLE);
            mPickedVideoView.startAnimation(
                    AnimationUtils.loadAnimation(
                            getActivity().getApplicationContext(), R.anim.fadein_anim));
        }
    }, 200);
}
 
开发者ID:ficklerobot,项目名称:grid-video-viewer,代码行数:30,代码来源:VideoGridFragment.java

示例6: onVideoSizeChanged

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
    LogTag.i("onVideoSizeChanged(), width=" + width + ", heigth=" + height);
    VideoViewH264m3u8.this.mVideoWidth = mp.getVideoWidth();
    VideoViewH264m3u8.this.mVideoHeight = mp.getVideoHeight();
    if (!(VideoViewH264m3u8.this.mVideoWidth == 0 || VideoViewH264m3u8.this.mVideoHeight == 0)) {
        VideoViewH264m3u8.this.mFisrtSetFixedSize = 1;
        VideoViewH264m3u8.this.getHolder().setFixedSize(VideoViewH264m3u8.this.mVideoWidth, VideoViewH264m3u8.this.mVideoHeight);
        LogTag.i("onVideoSizeChanged()->setFixedSize(), mVideoWidth=" + VideoViewH264m3u8.this.mVideoWidth + ", mVideoHeight=" + VideoViewH264m3u8.this.mVideoHeight);
    }
    if (VideoViewH264m3u8.this.mOnVideoSizeChangedListener != null) {
        VideoViewH264m3u8.this.mOnVideoSizeChangedListener.onVideoSizeChanged(mp, VideoViewH264m3u8.this.mVideoWidth, VideoViewH264m3u8.this.mVideoHeight);
        LogTag.i("onVideoSizeChanged()-> run user listener, mVideoWidth=" + VideoViewH264m3u8.this.mVideoWidth + ", mVideoHeight=" + VideoViewH264m3u8.this.mVideoHeight);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:15,代码来源:VideoViewH264m3u8.java

示例7: onVideoSizeChanged

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
    VideoViewH264m3u8Hw.this.mVideoWidth = mp.getVideoWidth();
    VideoViewH264m3u8Hw.this.mVideoHeight = mp.getVideoHeight();
    if (!(VideoViewH264m3u8Hw.this.mVideoWidth == 0 || VideoViewH264m3u8Hw.this.mVideoHeight == 0)) {
        VideoViewH264m3u8Hw.this.getHolder().setFixedSize(VideoViewH264m3u8Hw.this.mVideoWidth, VideoViewH264m3u8Hw.this.mVideoHeight);
    }
    if (VideoViewH264m3u8Hw.this.mOnVideoSizeChangedListener != null) {
        VideoViewH264m3u8Hw.this.mOnVideoSizeChangedListener.onVideoSizeChanged(mp, VideoViewH264m3u8Hw.this.mVideoWidth, VideoViewH264m3u8Hw.this.mVideoHeight);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:VideoViewH264m3u8Hw.java

示例8: onVideoSizeChanged

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
    VideoViewH264m3u8HwLeMobile.this.mVideoWidth = mp.getVideoWidth();
    VideoViewH264m3u8HwLeMobile.this.mVideoHeight = mp.getVideoHeight();
    if (!(VideoViewH264m3u8HwLeMobile.this.mVideoWidth == 0 || VideoViewH264m3u8HwLeMobile.this.mVideoHeight == 0)) {
        VideoViewH264m3u8HwLeMobile.this.getHolder().setFixedSize(VideoViewH264m3u8HwLeMobile.this.mVideoWidth, VideoViewH264m3u8HwLeMobile.this.mVideoHeight);
    }
    if (VideoViewH264m3u8HwLeMobile.this.mOnVideoSizeChangedListener != null) {
        VideoViewH264m3u8HwLeMobile.this.mOnVideoSizeChangedListener.onVideoSizeChanged(mp, VideoViewH264m3u8HwLeMobile.this.mVideoWidth, VideoViewH264m3u8HwLeMobile.this.mVideoHeight);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:VideoViewH264m3u8HwLeMobile.java

示例9: onVideoSizeChanged

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
    LogTag.i("onVideoSizeChanged(), width=" + width + ", heigth=" + height);
    VideoViewH264m3u8_4D.this.mVideoWidth = mp.getVideoWidth();
    VideoViewH264m3u8_4D.this.mVideoHeight = mp.getVideoHeight();
    if (!(VideoViewH264m3u8_4D.this.mVideoWidth == 0 || VideoViewH264m3u8_4D.this.mVideoHeight == 0)) {
        VideoViewH264m3u8_4D.this.getHolder().setFixedSize(VideoViewH264m3u8_4D.this.mVideoWidth, VideoViewH264m3u8_4D.this.mVideoHeight);
    }
    if (VideoViewH264m3u8_4D.this.mOnVideoSizeChangedListener != null) {
        VideoViewH264m3u8_4D.this.mOnVideoSizeChangedListener.onVideoSizeChanged(mp, VideoViewH264m3u8_4D.this.mVideoWidth, VideoViewH264m3u8_4D.this.mVideoHeight);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:VideoViewH264m3u8_4D.java

示例10: onVideoSizeChanged

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
    VideoViewH264m3u8Hw_4D.this.mVideoWidth = mp.getVideoWidth();
    VideoViewH264m3u8Hw_4D.this.mVideoHeight = mp.getVideoHeight();
    if (!(VideoViewH264m3u8Hw_4D.this.mVideoWidth == 0 || VideoViewH264m3u8Hw_4D.this.mVideoHeight == 0)) {
        VideoViewH264m3u8Hw_4D.this.getHolder().setFixedSize(VideoViewH264m3u8Hw_4D.this.mVideoWidth, VideoViewH264m3u8Hw_4D.this.mVideoHeight);
    }
    if (VideoViewH264m3u8Hw_4D.this.mOnVideoSizeChangedListener != null) {
        VideoViewH264m3u8Hw_4D.this.mOnVideoSizeChangedListener.onVideoSizeChanged(mp, VideoViewH264m3u8Hw_4D.this.mVideoWidth, VideoViewH264m3u8Hw_4D.this.mVideoHeight);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:VideoViewH264m3u8Hw_4D.java

示例11: onVideoSizeChanged

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
    mVideoWidth = mp.getVideoWidth();
    mVideoHeight = mp.getVideoHeight();
    Bundle bundle = new Bundle();
    bundle.putInt(OnPlayerEventListener.BUNDLE_KEY_VIDEO_WIDTH, mVideoWidth);
    bundle.putInt(OnPlayerEventListener.BUNDLE_KEY_VIDEO_HEIGHT, mVideoHeight);
    onPlayerEvent(OnPlayerEventListener.EVENT_CODE_ON_VIDEO_SIZE_CHANGE,bundle);
}
 
开发者ID:jiajunhui,项目名称:PlayerBase,代码行数:9,代码来源:DefaultDecoderPlayer.java

示例12: prepareToTarget

import android.media.MediaPlayer; //导入方法依赖的package包/类
private void prepareToTarget(MediaPlayer mp) {
    if (this.mOnPreparedListener != null) {
        this.mOnPreparedListener.onPrepared(this.mMediaPlayer);
    }
    if (this.mMediaController != null) {
        this.mMediaController.setEnabled(true);
    }
    this.mVideoWidth = mp.getVideoWidth();
    this.mVideoHeight = mp.getVideoHeight();
    int seekToPosition = this.mSeekWhenPrepared;
    if (seekToPosition != 0) {
        seekTo(seekToPosition);
    }
    if (this.mVideoWidth == 0 || this.mVideoHeight == 0) {
        if (this.mTargetState == 3) {
            start();
        }
    } else if (this.mRenderView != null) {
        this.mRenderView.setVideoSize(this.mVideoWidth, this.mVideoHeight);
        this.mRenderView.setVideoSampleAspectRatio(this.mVideoSarNum, this.mVideoSarDen);
        if (this.mRenderView.shouldWaitForResize() && (this.mSurfaceWidth != this.mVideoWidth
                || this.mSurfaceHeight != this.mVideoHeight)) {
            return;
        }
        if (this.mTargetState == 3) {
            start();
            if (this.mMediaController != null) {
                this.mMediaController.show();
            }
        } else if (!isPlaying()) {
            if ((seekToPosition != 0 || getCurrentPosition() > 0) && this.mMediaController !=
                    null) {
                this.mMediaController.show(0);
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:38,代码来源:PureVideoView.java

示例13: onPrepared

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onPrepared(MediaPlayer mp) {
    LogTag.i("onPrepared()");
    String currentDate = Tools.getCurrentDate();
    if (((FFMpegPlayer) mp) != VideoViewH264m3u8.this.mMediaPlayer || VideoViewH264m3u8.this.mMediaPlayer == null) {
        LogTag.i(VideoViewH264m3u8.TAG, "The  mMediaPlayer is released already while onPrepared() callbak is running!");
        return;
    }
    if (VideoViewH264m3u8.this.mOnMediaStateTimeListener != null) {
        VideoViewH264m3u8.this.mOnMediaStateTimeListener.onMediaStateTime(MeidaStateType.PREPARED, currentDate);
    }
    VideoViewH264m3u8.this.mCurrentState = 2;
    VideoViewH264m3u8.this.StateChange(VideoViewH264m3u8.this.mCurrentState);
    VideoViewH264m3u8 videoViewH264m3u8 = VideoViewH264m3u8.this;
    VideoViewH264m3u8 videoViewH264m3u82 = VideoViewH264m3u8.this;
    VideoViewH264m3u8.this.mCanSeekForward = true;
    videoViewH264m3u82.mCanSeekBack = true;
    videoViewH264m3u8.mCanPause = true;
    if (VideoViewH264m3u8.this.mOnPreparedListener != null) {
        VideoViewH264m3u8.this.mOnPreparedListener.onPrepared(VideoViewH264m3u8.this.mMediaPlayer);
    }
    VideoViewH264m3u8.this.mLastUrl = ((FFMpegPlayer) mp).getLastUrl();
    VideoViewH264m3u8.this.mVersion = ((FFMpegPlayer) mp).getVersion();
    LogTag.i(".so verison=" + VideoViewH264m3u8.this.mVersion);
    if (VideoViewH264m3u8.this.mMediaController != null) {
        VideoViewH264m3u8.this.mMediaController.setEnabled(true);
    }
    int seekToPosition = VideoViewH264m3u8.this.mSeekWhenPrepared;
    if (seekToPosition != 0) {
        VideoViewH264m3u8.this.seekTo(seekToPosition);
    }
    VideoViewH264m3u8.this.mVideoWidth = mp.getVideoWidth();
    VideoViewH264m3u8.this.mVideoHeight = mp.getVideoHeight();
    if (VideoViewH264m3u8.this.mVideoWidth == 0 || VideoViewH264m3u8.this.mVideoHeight == 0) {
        if (VideoViewH264m3u8.this.mTargetState == 3) {
            VideoViewH264m3u8.this.start();
        }
    } else if (VideoViewH264m3u8.this.mSurfaceWidth == VideoViewH264m3u8.this.mVideoWidth && VideoViewH264m3u8.this.mSurfaceHeight == VideoViewH264m3u8.this.mVideoHeight) {
        if (VideoViewH264m3u8.this.mTargetState == 3) {
            VideoViewH264m3u8.this.start();
            if (VideoViewH264m3u8.this.mMediaController != null) {
                VideoViewH264m3u8.this.mMediaController.show();
            }
        } else if (!VideoViewH264m3u8.this.isPlaying() && ((seekToPosition != 0 || VideoViewH264m3u8.this.getCurrentPosition() > 0) && VideoViewH264m3u8.this.mMediaController != null)) {
            VideoViewH264m3u8.this.mMediaController.show(0);
        }
        VideoViewH264m3u8.this.getHolder().setFixedSize(VideoViewH264m3u8.this.mVideoWidth, VideoViewH264m3u8.this.mVideoHeight);
        VideoViewH264m3u8.this.mFisrtSetFixedSize = 1;
        LogTag.i("onPrepared(1)->setFixedSize(), mVideoWidth=" + VideoViewH264m3u8.this.mVideoWidth + ", mVideoHeight=" + VideoViewH264m3u8.this.mVideoHeight);
    } else {
        VideoViewH264m3u8.this.getHolder().setFixedSize(VideoViewH264m3u8.this.mVideoWidth, VideoViewH264m3u8.this.mVideoHeight);
        VideoViewH264m3u8.this.mFisrtSetFixedSize = 1;
        LogTag.i("onPrepared(2)->setFixedSize(), mVideoWidth=" + VideoViewH264m3u8.this.mVideoWidth + ", mVideoHeight=" + VideoViewH264m3u8.this.mVideoHeight);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:55,代码来源:VideoViewH264m3u8.java

示例14: onPrepared

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onPrepared(MediaPlayer mp) {
    LogTag.i("onPrepared()");
    String currentDate = Tools.getCurrentDate();
    if (VideoViewH264m3u8Hw.this.mOnMediaStateTimeListener != null) {
        VideoViewH264m3u8Hw.this.mOnMediaStateTimeListener.onMediaStateTime(MeidaStateType.PREPARED, currentDate);
    }
    VideoViewH264m3u8Hw.this.mCurrentState = 2;
    VideoViewH264m3u8Hw.this.StateChange(VideoViewH264m3u8Hw.this.mCurrentState);
    VideoViewH264m3u8Hw videoViewH264m3u8Hw = VideoViewH264m3u8Hw.this;
    VideoViewH264m3u8Hw videoViewH264m3u8Hw2 = VideoViewH264m3u8Hw.this;
    VideoViewH264m3u8Hw.this.mCanSeekForward = true;
    videoViewH264m3u8Hw2.mCanSeekBack = true;
    videoViewH264m3u8Hw.mCanPause = true;
    if (VideoViewH264m3u8Hw.this.mOnPreparedListener != null) {
        VideoViewH264m3u8Hw.this.mOnPreparedListener.onPrepared(VideoViewH264m3u8Hw.this.mMediaPlayer);
    }
    VideoViewH264m3u8Hw.this.mLastUrl = ((FFMpegPlayer) mp).getLastUrl();
    VideoViewH264m3u8Hw.this.mVersion = ((FFMpegPlayer) mp).getVersion();
    if (VideoViewH264m3u8Hw.this.mMediaController != null) {
        VideoViewH264m3u8Hw.this.mMediaController.setEnabled(true);
    }
    int seekToPosition = VideoViewH264m3u8Hw.this.mSeekWhenPrepared;
    if (seekToPosition != 0) {
        VideoViewH264m3u8Hw.this.seekTo(seekToPosition);
    }
    VideoViewH264m3u8Hw.this.mVideoWidth = mp.getVideoWidth();
    VideoViewH264m3u8Hw.this.mVideoHeight = mp.getVideoHeight();
    if (VideoViewH264m3u8Hw.this.mVideoWidth == 0 || VideoViewH264m3u8Hw.this.mVideoHeight == 0) {
        if (VideoViewH264m3u8Hw.this.mTargetState == 3) {
            VideoViewH264m3u8Hw.this.start();
        }
    } else if (VideoViewH264m3u8Hw.this.mSurfaceWidth != VideoViewH264m3u8Hw.this.mVideoWidth || VideoViewH264m3u8Hw.this.mSurfaceHeight != VideoViewH264m3u8Hw.this.mVideoHeight) {
        VideoViewH264m3u8Hw.this.getHolder().setFixedSize(VideoViewH264m3u8Hw.this.mVideoWidth, VideoViewH264m3u8Hw.this.mVideoHeight);
    } else if (VideoViewH264m3u8Hw.this.mTargetState == 3) {
        VideoViewH264m3u8Hw.this.start();
        if (VideoViewH264m3u8Hw.this.mMediaController != null) {
            VideoViewH264m3u8Hw.this.mMediaController.show();
        }
    } else if (!VideoViewH264m3u8Hw.this.isPlaying()) {
        if ((seekToPosition != 0 || VideoViewH264m3u8Hw.this.getCurrentPosition() > 0) && VideoViewH264m3u8Hw.this.mMediaController != null) {
            VideoViewH264m3u8Hw.this.mMediaController.show(0);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:45,代码来源:VideoViewH264m3u8Hw.java

示例15: onPrepared

import android.media.MediaPlayer; //导入方法依赖的package包/类
public void onPrepared(MediaPlayer mp) {
    LogTag.i("onPrepared()");
    String currentDate = Tools.getCurrentDate();
    LetvMediaPlayerManager.getInstance().writePlayLog("系统当前时间:  " + currentDate + " VideoViewH264LeMobileHw(硬解m3u8)  onPrepared()");
    if (VideoViewH264m3u8HwLeMobile.this.mOnMediaStateTimeListener != null) {
        VideoViewH264m3u8HwLeMobile.this.mOnMediaStateTimeListener.onMediaStateTime(MeidaStateType.PREPARED, currentDate);
    }
    VideoViewH264m3u8HwLeMobile.this.mCurrentState = 2;
    VideoViewH264m3u8HwLeMobile.this.StateChange(VideoViewH264m3u8HwLeMobile.this.mCurrentState);
    VideoViewH264m3u8HwLeMobile videoViewH264m3u8HwLeMobile = VideoViewH264m3u8HwLeMobile.this;
    VideoViewH264m3u8HwLeMobile videoViewH264m3u8HwLeMobile2 = VideoViewH264m3u8HwLeMobile.this;
    VideoViewH264m3u8HwLeMobile.this.mCanSeekForward = true;
    videoViewH264m3u8HwLeMobile2.mCanSeekBack = true;
    videoViewH264m3u8HwLeMobile.mCanPause = true;
    if (VideoViewH264m3u8HwLeMobile.this.mOnPreparedListener != null) {
        VideoViewH264m3u8HwLeMobile.this.mOnPreparedListener.onPrepared(VideoViewH264m3u8HwLeMobile.this.mMediaPlayer);
    }
    VideoViewH264m3u8HwLeMobile.this.mLastUrl = ((FFMpegPlayer) mp).getLastUrl();
    VideoViewH264m3u8HwLeMobile.this.mVersion = ((FFMpegPlayer) mp).getVersion();
    if (VideoViewH264m3u8HwLeMobile.this.mMediaController != null) {
        VideoViewH264m3u8HwLeMobile.this.mMediaController.setEnabled(true);
    }
    int seekToPosition = VideoViewH264m3u8HwLeMobile.this.mSeekWhenPrepared;
    if (seekToPosition != 0) {
        VideoViewH264m3u8HwLeMobile.this.seekTo(seekToPosition);
    }
    VideoViewH264m3u8HwLeMobile.this.mVideoWidth = mp.getVideoWidth();
    VideoViewH264m3u8HwLeMobile.this.mVideoHeight = mp.getVideoHeight();
    if (VideoViewH264m3u8HwLeMobile.this.mVideoWidth == 0 || VideoViewH264m3u8HwLeMobile.this.mVideoHeight == 0) {
        if (VideoViewH264m3u8HwLeMobile.this.mTargetState == 3) {
            VideoViewH264m3u8HwLeMobile.this.start();
        }
    } else if (VideoViewH264m3u8HwLeMobile.this.mSurfaceWidth != VideoViewH264m3u8HwLeMobile.this.mVideoWidth || VideoViewH264m3u8HwLeMobile.this.mSurfaceHeight != VideoViewH264m3u8HwLeMobile.this.mVideoHeight) {
        VideoViewH264m3u8HwLeMobile.this.getHolder().setFixedSize(VideoViewH264m3u8HwLeMobile.this.mVideoWidth, VideoViewH264m3u8HwLeMobile.this.mVideoHeight);
    } else if (VideoViewH264m3u8HwLeMobile.this.mTargetState == 3) {
        VideoViewH264m3u8HwLeMobile.this.start();
        if (VideoViewH264m3u8HwLeMobile.this.mMediaController != null) {
            VideoViewH264m3u8HwLeMobile.this.mMediaController.show();
        }
    } else if (!VideoViewH264m3u8HwLeMobile.this.isPlaying()) {
        if ((seekToPosition != 0 || VideoViewH264m3u8HwLeMobile.this.getCurrentPosition() > 0) && VideoViewH264m3u8HwLeMobile.this.mMediaController != null) {
            VideoViewH264m3u8HwLeMobile.this.mMediaController.show(0);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:46,代码来源:VideoViewH264m3u8HwLeMobile.java


注:本文中的android.media.MediaPlayer.getVideoWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。