0
이 코드에서는 getDuration()
메서드를 사용하여 비디오 지속 시간을 가져 오려고하지만 작동하지 않고 항상 -1을 반환합니다. 뭐가 잘못 되었 니? ? 당신이 할 수없는, 내가 보는 것과 그래서Android의 비디오 지속 시간
public int getDuration(){
if (isInPlaybackState()) {
return mMediaPlayer.getDuration();
}
return -1;
}
: 나는 다른 방법으로 시간을 얻을 수
videoPlayer = (VideoView) this.findViewById(R.id.videoView2);
videoPlayer.setVideoPath("android.resource://"+getPackageName()+"/"+R.raw.video3);
int duration = videoPlayer.getDuration();
동영상에 링크가있는 것을 확인 했습니까 ** – Zoe
예, 동영상을 볼 수 있기 때문에 – EmLe49
시작한 다음 기능을 사용하려고합니다. –